I'm trying to right a custom action to swap all of the info for 2 items in my RPG game. Every item is a record. For example, the Inventory - Helm Slot variable (item) is
type: -Record
record: Item Record - Armor
The record then holds all of the info, such as the item's image, description, stats, name, tier, etc. I know i just need to take the two items to swap as parameters and make a var "temp", then set temp = parameter1, parameter1 = parameter2, and parameter2 = temp, but when I try to allow parameters of type record, it's not there. The only options with a dash at the beginning are Preset, Game Link, and File
If your records are global and kept in an array, simply pass their indexes in that array to the function, then access them the same way you did prior. If not, you're outta luck.
While the above is true, another option is to not pass the whole record but rather all parts of the record. once the record passes to the function you can reconstruct it again from its base parts.
I'm trying to right a custom action to swap all of the info for 2 items in my RPG game. Every item is a record. For example, the Inventory - Helm Slot variable (item) is
type: -Record
record: Item Record - Armor
The record then holds all of the info, such as the item's image, description, stats, name, tier, etc. I know i just need to take the two items to swap as parameters and make a var "temp", then set temp = parameter1, parameter1 = parameter2, and parameter2 = temp, but when I try to allow parameters of type record, it's not there. The only options with a dash at the beginning are Preset, Game Link, and File
Thanks for your help!
Not possible in GUI.
If you are familar with Galaxy script you can use structref to pass structs to functions.
@PerAnimus: Go
If your records are global and kept in an array, simply pass their indexes in that array to the function, then access them the same way you did prior. If not, you're outta luck.
While the above is true, another option is to not pass the whole record but rather all parts of the record. once the record passes to the function you can reconstruct it again from its base parts.
@SoulTaker916: Go
Also true, but not useful if your intent was to modify the record once inside the function.
Not to say that it completely defeats the purpose of using records in the first place. :)
@MasterWrath: Go @Mille25: Go You would neeed presets to identify, but yes records have limitation.