I wish to create a robust crafting system, using variables, where certain variables that I set to only certain kinds of items will check against Global Variables to define and alter their underlying variable values. For instance, I've created a formula that creates a global variable named 'Materials_Metal' and branches into a 'Check Game Variables' node. The node runs multiple checks to see if 'Materials_Metal' equals a number from zero to 'X' ('X' being the ultimate final number of metals in my game). When it hits on one, it adds a string changing the material's name accordingly (to Copper, Steel, Supercalifragilisticexpialidociousanium, what have you), then sets the values for certain other Global Variable properties, i.e. Hardness_Global, Toughness_Global, ValueMatMult_Global.

So, lets say I have a weapon with a blade, for instance. Could be a knife, a Sword, a spear, a weaponized ceiling fan-doesn't matter-all of my weapon's with similar properties share certain variables. A sword, a knife and a weaponized ceiling fan (each particular instance of said) all have a variable attached to them called 'Material_Blade'.

The Variable, 'Material_Blade', runs through a formula prior to the one using the global variable, 'Materials_Metal', in order to change and set its value to match the correct value branch in the 'Materials_Metal' formula. So, in other words, where the value for a certain steel alloy might be 5 (according to what I've decided) through the 'Material_Blade' formula, it might be referenced by the number 11 in the 'Materials_Metal' formula because there are more metals in the game than are suitable for use as blade materials.

Additionally, the specified values of the Global Variables, 'Hardness_Global', 'Toughness_Global' and 'ValueMatMult_Global', after being selected by the formula via whatever branch, need to then assign their set values to the corresponding Item Variables attached to the item. 'Hardness_Global' needs to set its value to the Item Variable, 'Hardness'. 'Toughness_Global' needs to assign directly to the Item Variable, 'Toughness', and 'ValueMatMult_Global' needs to alter multiple related variables and properties (that one's a bit of a headache to standardize, but the first two are both more straight forward and critical).

So, that explains in a rather convoluted nutshell what I'm trying to accomplish. Here's my basic question: how in the world do I do any of those things that I just mentioned?

I can, and have created the necessary host of variables, of course, and I've made a bunch of formula branches, but my grasp of ORK's variable system is, well, let's just say tentative would be reaching. I've managed, in a few instances, to successfully check the variable values assigned to items, but I don't really know what I'm doing, or how to effectively use them. So, using a formula...

-Can I check every item in a player/party's inventory individually to see whether it has a necessary variable, and then check it's value?

-Does the 'Select Item>Item Settings>All Items' feature just pool the collective value of every item that shares a variable, or is there a way to ensure that each item retains its variables' values individually?

-Assuming that I'm able to force an individual check on every item before branching into the necessary formulas to assign and reassign their values, how do I then loop back to change the local variables using the global ones?

  • Unless you're doing some calculations, I'd recommend doing this in a game event instead of a formula.

    Anyway, this might not be possible yet, there's currently no filtering of selected data based on variables available - I'll try to add that in the next update.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.