spawning Question

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

spawning Question

Post 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?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

spawning

Post 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.
Tom Trude,

Image
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

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

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

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Ahh I see, good explanation mate. All clear now. :)
Grassy
Post Reply