I want to add some Parameters to the Player. e.g "Hunger", "Thirst" (Survival Stuff) Can I do this with a lua script? Because the Player is something that's already set up in the engine. Can I acess him? Or what would be the best way to do that?
I need a hint for basic scripting in CryEngine 3
371 views Asked by Dawesign At
1
If it's the case that the player is immutable or you're otherwise unable to add new fields to it (userdata, etc.), then it's usually possible to construct a table which has the unchangeable data (in this case, the player) as an index key to fields representing the data you want to track.
For example, you could use this idiom any time you wanted to "add" more information to such an object, userdata, or table. This is just a general Lua idea, separate from any specific engine. Depending upon how CryEngine works, you might need to make
hunger
a global variable as opposed to a local one.