Spawning entities with multiple keys/values....

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Spawning entities with multiple keys/values....

Post 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
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post 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
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

lol, we were all (excepting those that don't script :x )there once. :lol:
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply