Page 1 of 1

Global Code Created Variables.

PostPosted: Fri Jul 21, 2006 8:20 am
by DilloDude
I have two questions about variables defined in Global Code:
  1. Can I make them into actor variables by extending the actor struct? if so how, and
  2. Can I add them to a save group, and how.

Re: Global Code Created Variables.

PostPosted: Fri Jul 21, 2006 12:46 pm
by makslane
Can I make them into actor variables by extending the actor struct?


The only way to extend the actor struct is adding an 'Actor variable' in the 'Add New Variable' panel.

Can I add them to a save group, and how.


You can use save groups only with global variables defiend in the 'Add New Variable' panel.

PostPosted: Fri Jul 21, 2006 1:52 pm
by DilloDude
That's what I thought.

PostPosted: Fri Jul 21, 2006 11:53 pm
by DilloDude
What would be good would be to be able to create more variable types from the variables panel, and I am thinking of structs in particular. In an rpg type of game, I might have a struct called item, which contains information about a specific item. I could have a use item function that reads the struct and decides what the item does and does it. I might want an array of items called 'inventory', which would store all the items the player has collected. But I would want to be able to save this variable when I save the game. There are also other cases wherse structs could become useful, but you would need them to have the ability to be saved, and possibly be actor variables.

PostPosted: Sat Jul 22, 2006 12:40 am
by DilloDude
Another thing that would be useful, although not necesary as you can just use ints, would be to allow variables of bool type.