Page 1 of 1

Spawning entities with multiple keys/values....

Posted: Tue Jul 20, 2004 5:21 pm
by G3mInI
I know how to add a targetname to a spawned entity but how do I add additional keys-values to this same entity ?

Let me give you an example of what I know works and what doesnt...

//spawn the bomb
local.device = spawn script_model "targetname" "flak88_explode"
local.device model "items/pulse_explosive.tik"
local.device.origin = ( 802.00 -16.00 -106.00 )
local.device.angles = ( 0.00 180.00 0.00 )
local.device.scale = 1.0
local.device solid

This works just fine as is, but I want to add the following keys-values to this spawned entity....

key-value

target-flak88
$trigger_name-flak88_bomb
#exploder_set-1

I have tried this and it failed miserably, only the targetname worked...

//spawn the bomb
local.device = spawn script_model "targetname" "flak88_explode"
local.device = spawn script_model "target" "flak88"
local.device = spawn script_model "$trigger_name" "flak88_bomb"
local.device = spawn script_model "#exploder_set" "1"
local.device model "items/pulse_explosive.tik"
local.device.origin = ( 802.00 -16.00 -106.00 )
local.device.angles = ( 0.00 180.00 0.00 )
local.device.scale = 1.0
local.device solid



Anyone have any ideas how to add additional key-values to a spawned entity ?



G3mInI

Posted: Tue Jul 20, 2004 8:08 pm
by lizardkid
yes, don't spaw a trillion of them when doing it. just do this..

mybomb.target = $blah
mybomb.set = 1


your entity is selected by it's taretname (mybomb) and it selects or creates a new key by the . thingie, thne the value is set by the = xxx.

Posted: Tue Jul 20, 2004 9:51 pm
by bdbodger
you added 4 keys already to it do it the same for the other keys

local.device = spawn script_model "targetname" "flak88_explode"
local.device model "items/pulse_explosive.tik"
local.device.origin = ( 802.00 -16.00 -106.00 )
local.device.angles = ( 0.00 180.00 0.00 )
local.device.scale = 1.0
local.device.target = flak88
local.device.trigger_name = flak88_bomb
local.device.exploder_set = 1

Posted: Wed Jul 21, 2004 12:52 pm
by G3mInI
you added 4 keys already to it do it the same for the other keys

Yep I sure did. I am just an idiot is all. :)

Thanks guys....it works just fine now.
I will try to keep my embarrasing questions to a minimum !!

Peace,
G3mInI

Posted: Wed Jul 21, 2004 2:47 pm
by lizardkid
lol, we were all (excepting those that don't script :x )there once. :lol: