Page 1 of 1

spawning Question

Posted: Mon Oct 04, 2004 8:49 pm
by lizardkid
well i've seen two ways of spawning things and i'd like to know which one is more efficient both line-wise and speedwise. the way i normally use is this.

Code: Select all

spawn models/human/1st-ranger_private.tik "$targetname" "test_dummy" "angles" "50" "origin" "500 500 0"
and the way i see the more experienced scripters do it uses a ton of variables...

Code: Select all

local.spawner = spawn models/human/1st-ranger_private.tik
local.spawner.angles = 50
local.spawner.origin = ( 500 500 0 )
would they not achieve the same thing with the formor having less variable space taken up and quicker line reading? or am i just misguided?

spawning

Posted: Wed Oct 06, 2004 9:17 pm
by tltrude
It makes no difference to the script which way is used. Assigning a map reference targetname is just like assigning a local variable reference name. The only difference is that that the local name is only good in the local thread.

Posted: Wed Nov 03, 2004 11:15 am
by Grassy
That's a good point, which raises another question. You use "$targetname" "entity" in your single line string. I normally use the multiple line method but assign a targetname like so..
local.ent targetname "entity"
Note the missing "$" Is this a common method for AA scripters, I script in SH only and have never done it that way before.
Grassy

Posted: Wed Nov 03, 2004 3:31 pm
by lizardkid
yes, that's because i learned to console spawn before i actually scripted. i hacked (not cracked, hacked) together a way to spawn any model into the game provided you knew hte .tik filename. and that's exactly how i did it and i find it pretty effective.

as for the $ i jsut use that because i saw $targetname the first time i started spawning etc and have used it ever since. i also use $targetname in Rad :lol:

so yeah, i guess it's preference. :)

Posted: Wed Nov 03, 2004 9:00 pm
by Grassy
Ahh I see, good explanation mate. All clear now. :)
Grassy