Question about Variables

Status
Not open for further replies.
Level 7
Joined
Mar 5, 2009
Messages
254
Hello,im wondering which is the better way to make spells with variables,for example if i need to make 2 variables,1 for casting unit and 1 for target unit of ability being cast,is it better to make 1 variable for both units with array size 2 or 2 different variables without array size?
 
Depends what exactly you mean by 'better'.

I'd say use different variables as it keeps the clarity.
If you run into a situation where you need many variables you are confused if they are all in one array.
Use arrays for similar things and variables with clear names for different things.
 
Hello,im wondering which is the better way to make spells with variables,for example if i need to make 2 variables,1 for casting unit and 1 for target unit of ability being cast,is it better to make 1 variable for both units with array size 2 or 2 different variables without array size?

2 different variable and like was said its depend about situation, array mainly usefull when u want do something with loop

so a example the normal dot systems or mui systems where unit array used for check over all unit what currently do same action (damage over time to another unit, or all unit what example atm knocked back)

or another example when u want store all playable heroes to variable array in map init, there array better because u easily can pick any from unit array and dont must check alot variable :)

so array usefull if u need the stored things more times during game and u need work/order with data
 
Status
Not open for further replies.
Back
Top