Adrianis
Senior Member
Posts: 620
Threads: 6
Joined: Feb 2012
Reputation:
27
|
RE: [SIMPLE] Variables
You might have to use 'SetLocalVarInt' first to declare the var. Then AddLocal..etc just adds to the value
Though, I haven't tried only using AddLocal...etc so apologies if I'm wrong on that
More importantly, when using a variable set using the functions (SetLocal...etc), you can't use the variable just by using the name as you tried here, CreateParticleSystemAtEntity("CreakDust_"+CreakVar
You need to use the function GetLocalVar...etc in order to get the value - that goes for checking the value as well (in an if statement, for example)
To make things easier (so you can use the shorthand method like you tried), you can make a line like so,
int inCreakVar = GetLocalVarInt("CreakVar");
That way you assign the value from the function-declared variable into a local variable, then you can do CreateParticleSystemAtEntity("CreakDust_"+inCreakVar
(called it 'inCreakVar' to make it distinct from CreakVar, though you can use the same name as they are declared in a different way (theres more to the way variables work, but thats another topic for another time))
Hope that helps, let me know if you want more explanation
(This post was last modified: 03-12-2013, 05:17 PM by Adrianis.)
|
|
03-12-2013, 05:07 PM |
|