Local.player lights

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

local.trigCR = spawn trigger_multiple
local.trigCR.origin = ( -990 -3010 -57 )
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR setthread Peace_room
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR wait 0
local.trigCR delay 0




Peace_room:
//self waittill trigger // You don't need this this thread is run by setthread
local.player = parm.other
if (local.player.isTrigger1==1) This line is for makeing only one thread run for this player but you didn't set it
end

local.player.isTrigger1 = 1 // ok now it is set you have to unset it too

//local.player = parm.other // You already grabed the parm.other value you don't need to do it again
local.player tele ( -2120 -3005 -120 )

//wait 30 // ???? is this what you are thinking of it will only delay the flicker from starting

local.counter = 30
///parm.other stopwatch 30 // parm.other can change when a trigger is triggered and be another player we want same player this thread is running for

local.player stopwatch 30 // thats better

while(local.counter != 0 && IsAlive local.player)
{
local.counter -= 1 // you can use local.counter-- too
wait .25
local.player light 0 1 0 200
wait .25
local.player light 0 0 1 200
wait .25
local.player light 1 0 0 200
wait .25
}

local.player takeall
wait 5
local.player stufftext "say Oh no, i'm getting crazy..!"
wait 25
local.player light_off // don't want this guy to keep glowing
local.player respawn
local.player.isTrigger1 = 0 // ok now unset it so player can trigger it again
end
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

I'm sorry to say this, but it still doesn't work

Code: Select all

level waittill prespawn

local.trigCR = spawn trigger_multiple 
local.trigCR.origin = ( -990 -3010 -57 ) 
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 ) 
local.trigCR setthread Peace_room 
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***" 
local.trigCR wait 0 
local.trigCR delay 0


level waittill spawn


Peace_room: 
//self waittill trigger // You don't need this this thread is run by setthread 
local.player = parm.other 
if (local.player.isTrigger1==1) This line is for makeing only one thread run for this player but you didn't set it 
end 

local.player.isTrigger1 = 1 // ok now it is set you have to unset it too 

//local.player = parm.other // You already grabed the parm.other value you don't need to do it again 
local.player tele ( -2120 -3005 -120 ) 

//wait 30 // ???? is this what you are thinking of it will only delay the flicker from starting 

local.counter = 30 
///parm.other stopwatch 30 // parm.other can change when a trigger is triggered and be another player we want same player this thread is running for 

local.player stopwatch 30 // thats better 

while(local.counter != 0 && IsAlive local.player) 
{ 
local.counter -= 1 // you can use local.counter-- too 
wait .25 
local.player light 0 1 0 200 
wait .25 
local.player light 0 0 1 200 
wait .25 
local.player light 1 0 0 200 
wait .25 
} 

local.player takeall 
wait 5 
local.player stufftext "say Oh no, i'm getting crazy..!" 
wait 25 
local.player light_off // don't want this guy to keep glowing 
local.player respawn 
local.player.isTrigger1 = 0 // ok now unset it so player can trigger it again 
end
by this script the map doesn't load my script (all of my script) :!: :!: :?: :?:


and about the console:
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

level waittill spawn

end // end of the main thread the peace_room thread is run by setthread guess I missed that

Peace_room:

also I missed some comment brackets

if (local.player.isTrigger1==1) // This line is for makeing only one thread run for this player but you didn't set it

and

local.player light_off

should have been

local.player lightoff
Image
GiffE1118
Warrant Officer
Posts: 137
Joined: Fri Aug 05, 2005 12:14 am
Contact:

Post by GiffE1118 »

Bartjerambo, the last question u had you for got to put the end after level waittill spawn

if you dont put that end when the map loads it will keep on loading all the threads untill there is an end

i think console would show the non commented out line. when people say what does console give you they as for you to look through the logfile and post anything thats relavent to the topic. console tells exactly whats wrong. and where its wrong.

i didnt know there was a cmd called lightoff. i always just made their light 0 0 0 0.
www.95thDivision.com
Image

BOTTOM 125th Poster! lol
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i have an end afther Waittill spawn, but i have short the exemple in.

here is the whole exemple as you wish

Code: Select all

level waittill prespawn 

local.trigCR = spawn trigger_multiple 
local.trigCR.origin = ( -990 -3010 -57 ) 
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 ) 
local.trigCR setthread Peace_room 
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***" 
local.trigCR wait 0 
local.trigCR delay 0 

//<--- i don't know if i must place here and end... :? 



level waittill spawn 
end

Peace_room: 
//self waittill trigger // You don't need this this thread is run by setthread 
local.player = parm.other 
if (local.player.isTrigger1==1) This line is for makeing only one thread run for this player but you didn't set it 
end 

local.player.isTrigger1 = 1 // ok now it is set you have to unset it too 

//local.player = parm.other // You already grabed the parm.other value you don't need to do it again 
local.player tele ( -2120 -3005 -120 ) 

//wait 30 // ???? is this what you are thinking of it will only delay the flicker from starting 

local.counter = 30 
///parm.other stopwatch 30 // parm.other can change when a trigger is triggered and be another player we want same player this thread is running for 

local.player stopwatch 30 // thats better 

while(local.counter != 0 && IsAlive local.player) 
{ 
local.counter -= 1 // you can use local.counter-- too 
wait .25 
local.player light 0 1 0 200 
wait .25 
local.player light 0 0 1 200 
wait .25 
local.player light 1 0 0 200 
wait .25 
} 

local.player takeall 
wait 5 
local.player stufftext "say Oh no, i'm getting crazy..!" 
wait 25 
local.player lightoff // don't want this guy to keep glowing 
local.player respawn 
local.player.isTrigger1 = 0 // ok now unset it so player can trigger it again 
end
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

make all the changes I said add the comment lines // to this line

if (local.player.isTrigger1==1) // This line is for makeing only one thread run for this player but you didn't set it

you should know that those lines // mean everything after them on that line is a comment in the script for you to read and please turn on your log file and read it you can't expect us to have to debug every script you do .
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i know that.... :)

but i'm asking if i have to set "end"afther Waittil prespawn, like:

---------------------------------------------------------------------------
level waittill prespawn

local.sandbank = spawn script_object
local.sandbank model "static/sandbag_link_main.tik"
local.sandbank.origin = ( -2200 -2890 -145 )
local.sandbank.angles = ( 0 90 0 )
local.sandbank hide
local.sandbank solid


end
---------------------------------------------------------------------------

(My trigger script still doesn't work can you see whats wrong :( )

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

Post by lizardkid »

end is used to "end" threads. anything with : after it (main: ) is a thread, or can be. so lets say you wanted a thread that says "I'm a thread." on the middle of your screen.

Code: Select all

newThread:
centerprint "I'm a thread."
end
so you need your end to tell it to stop running that thread.
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 »

most scripts put a thread name at the start of the script called main but if you run a script but do not call a thread or in a level script like this it starts at the top of the script and reads until it hits an end

main:

level waittill prespawn

local.trigCR = spawn trigger_multiple
local.trigCR.origin = ( -990 -3010 -57 )
local.trigCR setsize ( -10 -10 -10 ) ( 10 10 10 )
local.trigCR setthread Peace_room // tells the trigger to run the thread when it is triggered
local.trigCR message "***!You are now in CRAZY PEACE ROOM for 30 seconds!***"
local.trigCR wait 0
local.trigCR delay 0

level waittill spawn

end // end of the first thread or fist end in the script

Peace_room: // first thread after the start of the script or main thread


So you see that the Peace_room thread is started by the trigger and you see where the main thread stops
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

ok, but still doesn't work :? :? :?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

What error did you get in the log file qconsole.log ?
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

None error....
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Yea, it all correct, maybe he has another conflicting .scr or maybe wrong folder?
Last edited by Green Beret on Wed Sep 14, 2005 4:31 am, edited 1 time in total.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i cant see anything wrong with it besides convention. what are the errors? is it named correctly?

to get your errors, open MOH, type logfile 2, close MOH, open it and load your map, let it run for a few seconds, then close MOH. take the file C:\Program Files\EA Games\MOHAA\main\qconsole.log and copy/paste it here.

*cringe i hate telling people to do that, such a waste of forum space.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

i don't have any log file in my main.....
Post Reply