So, I've been messing around with modding starbound for well over a year now, and have decided to actually devote myself to a single project that I'll actually release on here. Anywho, I've run into a huge snag in the form of projectile powers (weapon damage). The way the every .sword file uses it is by calling a single, set number, but I want to do more with it. -Example 1: A weapon that is relatively weak, but occasionally deals massive damage, kinda like Mehrunes Razor. I have no clue how to do this though. I thought maybe a weighted list could work, but then, I don't know how to make a weighted list. -Example 2: A weapon whose projectile power is determined by the character's maximum health, like the Ultima Weapon from the Final Fantasy series. It would also use math. When I tried to implement this, I used the following: "projectile" : { "speed" : 0.1, "power" : {"maxHealth" * 10} as well as just: "projectile" : { "speed" : 0.1, "power" : "maxHealth" Both of which made the item appear invalid (generic item green cube thingy) which made me wonder: is it even possible to use variables, math, lists or other functions to determine a projectile's power? I'll keep messing around and report back with my findings, but it would be wonderful if any help whatsoever were to be provided.
I kind of a noob when it comes to Starbound modding, but I'm pretty sure that all weapons properties are currently defined in JSON. I don't think JSON is capable of doing the sort of scripting that you want. With the updates to status effects in the nightlies, you might be able to work through those.