Let say I want to do the following ("hyphotetical" coding):
Code: Select all
spawn trigger_use "targetname" "bla1"
$bla1.origin = ( 11 11 11 )
$bla1.angles = ( 11 11 11 )
// more properties
Code: Select all
new_bla local.origin local.angles:
local.ent = spawn trigger_use
local.ent.origin = local.origin
local.ent.angles = local.angles
// more properties
end local.ent
level.blas[0] = waitthread new_bla ( 11 11 11 ) ( 11 11 11 )
level.blas[1] = waitthread new_bla ( 22 22 22 ) ( 22 22 22 )
level.blas[2] = waitthread new_bla ( 33 33 33 ) ( 33 33 33 )
// etc.
What I want to know is if there's any way I can dynamically "targetname" the trigger_use I spawned, so that I can refer to it using the "$" symbol using the concept of variable variables (such as in PHP, with $$x returning $a if $x=='a').
This would be something like this (note I added local.id to this... I don't know if it would be necessary):
Code: Select all
new_bla local.id local.origin local.angles:
spawn trigger_use "targetname" "bla"+local.id
// Would this create a variable that I can refer to using $bla0 ?
// If so, would I be able to do something like the following? How would it actually spell out? -->
$bla+local.id = local.origin // eg. $bla1 = local.origin
$bla+local.id = local.angles
// more properties
end local.ent
level.blas[0] = waitthread new_bla 0 ( 11 11 11 ) ( 11 11 11 )
level.blas[1] = waitthread new_bla 1 ( 22 22 22 ) ( 22 22 22 )
level.blas[2] = waitthread new_bla 2 ( 33 33 33 ) ( 33 33 33 )
// etc.
Read next post...

