Page 1 of 1

Spawn things in stock maps (not new)

Posted: Fri Jan 28, 2005 6:07 pm
by |NSC|-Steelie-NS*LR*
Hi there,

I've seen this on the Rjukan Project's site:

// Spawn a script model and give it a targetname
local.flak = spawn script_model "targetname" "flak88"
// Set the model to be drawn/used
local.flak model "statweapons/flak88turret.tik"
// Set where it should be
local.flak.origin = ( -100.0 .0 0.0 )
// Set where it should point at
local.flak.angles = ( 0.0 0.0 0.0 )
// Set how big it should be
local.flak.scale = 1.0

It says 'local.flak', but how do you know what to put there if you wanna, for example, put a wardrobe in it? where do you got that 'local thingy' from? Maybe I'm a n00b, but please answer! :lol:

Re: Spawn things in stock maps (not new)

Posted: Fri Jan 28, 2005 6:29 pm
by Rookie One.pl
|NSC|-Steelie-NS*LR* wrote:local.flak = spawn script_model "targetname" "flak88"
This line tells you what local.flak is. ;)

Posted: Sat Jan 29, 2005 11:10 am
by bdbodger
local.flak is just a varaiable name you can call it local.noob if you want , it is just used to set the values like what model to use . A local variable is local to the thread it is used in when the thread ends it is forgotten unlike a level variable . If he had used level.flak then in another thread he could have used level.flak remove for example and it would be removed you can't do that with a local variable except from the thread it is in unless you pass the value to a new thread like this

start:

local.noob = spawn script_model
....
....
bla bla
....
thread mythread local.noob

end

mythread local.incoming:

local.incoming remove

end

you see that only the value was passed not the variable name local.noob and local.incoming are the same thing , in the second thread local.noob does not exist the game will say it is NIL if you try to use it .

Posted: Sat Jan 29, 2005 11:54 am
by |NSC|-Steelie-NS*LR*
k, thanx