create custom properties on entities.

dcelso

Member
Is it possible?
for example,
setntityproperty(entity, propname, values)
I was thinking using it to store "kinves" value to avoid using globalvar. because I am using to store the amount of knives of a player entity, and should more intuitive to control it.
 
@dcelso,

I'm working on a tag system in next engine update to add properties at design time. For now, you just answered your own question. Use entity vars. I reccomend setting them in the onspawn event. Don't forget the script engine supports #define. That's a good way to code your starting values.

DC
 
@dcelso,

I'm working on a tag system in next engine update to add properties at design time. For now, you just answered your own question. Use entity vars. I reccomend setting them in the onspawn event. Don't forget the script engine supports #define. That's a good way to code your starting values.

DC
entity vars? or global vars.
 
entity vars? or global vars.

Entity vars.

Rule of thumb for any variables in any engine, language, etc: Always use the most narrow scope possible.


DC
 
entity vars? or global vars.
It depends on how long you want to store the value. If you only want to store it for one level only, entity var is good choice. But if you want to store it for multiple levels, use global var.

Is it possible?
for example,
setntityproperty(entity, propname, values)
I was thinking using it to store "kinves" value to avoid using globalvar. because I am using to store the amount of knives of a player entity, and should more intuitive to control it.

If your knives are carried from level to level, you'd have to use global variable.
 
Back
Top Bottom