object calling from thread to thread
Posted: Sun Dec 12, 2004 8:46 pm
Here is what I have
What I want to do is have another thread under that for local.redlight and local.bluelight. How do I tell "light_ops" thread call local.redlight and local.bluelight so that my script is like this:
So the lights are changing colors all the time so the light_ops thread will be looping over and over. Is this enough info or do u need more?
Code: Select all
main:
level waittill presawn
setcvar "g_obj_alliedtext1" ""
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""
setcvar "g_scoreboardpic" ""
level waittill spawn
thread thing_ops
local.switch = $ts
local.trigger = $tt
local.thing = $thing
local.redlight = $rl
local.bluelight = $bl
local.way1 = $way1
local.way2 = $way2
local.way3 = $way3
local.way4 = $way4
local.way5 = $way5
local.way6 = $way6
local.thing time 3
local.switch bind local.thing
local.trigger bind local.thing
local.redlight bind local.thing
local.bluelight bind local.thing
end
thing_ops:
while(1)
}
local.trigger waittill trigger
local.switch anim turn
local.trigger nottriggerable
wait 2
local.thing moveto local.way1
local.thing waitmove
local.thing moveto local.way2
local.thing waitmove
local.thing moveto local.way3
local.thing waitmove
local.thing moveto local.way4
local.thing waitmove
local.thing moveto local.way5
local.thing waitmove
local.thing moveto local.way6
local.thing waitmove
iprintlnbold_noloc "End of the line. Now what?"
waitframe
{
endCode: Select all
main:
level waittill presawn
setcvar "g_obj_alliedtext1" "What The"
setcvar "g_obj_alliedtext2" "Heck Is"
setcvar "g_obj_alliedtext3" "That Thing!?"
setcvar "g_obj_axistext1" "What The"
setcvar "g_obj_axistext2" "Heck Is"
setcvar "g_obj_axistext3" "That Thing!?"
setcvar "g_scoreboardpic" ""
level waittill spawn
thread thing_ops
local.switch = $ts
local.trigger = $tt
local.thing = $thing
local.redlight = $rl
local.bluelight = $bl
local.way1 = $way1
local.way2 = $way2
local.way3 = $way3
local.way4 = $way4
local.way5 = $way5
local.way6 = $way6
local.thing time 3
local.switch bind local.thing
local.trigger bind local.thing
local.redlight bind local.thing
local.bluelight bind local.thing
local.redlight hide
local.bluelight hide
end
thing_ops:
while(1)
}
local.trigger waittill trigger
local.switch anim turn
local.trigger nottriggerable
wait 2
local.redlight show
local.bluelight show
local.thing moveto local.way1
local.thing waitmove
local.thing moveto local.way2
local.thing waitmove
local.thing moveto local.way3
local.thing waitmove
local.thing moveto local.way4
local.thing waitmove
local.thing moveto local.way5
local.thing waitmove
local.thing moveto local.way6
local.thing waitmove
iprintlnbold_noloc "End of the line. Now what?"
waitframe
{
end
light_ops:
while(1)
}
local.redlight _color 0.000000 0.000000 1.000000 //to change it to blue
local.bluelight _color 1.000000 0.000000 0.000000 //to change it to red
wait 1
local.redlight _color 1.000000 0.000000 0.000000 //to change it back to red
local.bluelight _color 0.000000 0.000000 1.000000 //to change it back to blue
waitframe
}
end