T
The Man of Many Hats
Guest
Hey guys. I was wondering if it was at all possible to create modular variables in our scripts... Which I guess are kind of like arrays?
Here's an example of what I mean:
Var mod = ””
Var [mod]dog = 0
Var breed = 1
If (breed = 1)
{
mod = ”bull”
} else mod = "lab"
[mod]dog = 1
//Therefore var bulldog = 1
It would be really useful to do it with script calling. So if you have a few similarly named scripts, you could call many of them bassed on the return value of one variable instead of creating a bunch of if statements, or cases.
script_execute(SCR_[mod]dog)
// This would execute a script named SCR_bulldog bassed on the previous example.
So... If this is in here, how do you do it? Cuz I've tried a few different ways and I always get crashes :/
And if it's not in, do you think it would be a useful addition?
Here's an example of what I mean:
Var mod = ””
Var [mod]dog = 0
Var breed = 1
If (breed = 1)
{
mod = ”bull”
} else mod = "lab"
[mod]dog = 1
//Therefore var bulldog = 1
It would be really useful to do it with script calling. So if you have a few similarly named scripts, you could call many of them bassed on the return value of one variable instead of creating a bunch of if statements, or cases.
script_execute(SCR_[mod]dog)
// This would execute a script named SCR_bulldog bassed on the previous example.
So... If this is in here, how do you do it? Cuz I've tried a few different ways and I always get crashes :/
And if it's not in, do you think it would be a useful addition?