Page 2 of 2
Posted: Tue Dec 02, 2008 7:06 am
by $oldier Of Ra
Hmm, I have little experience with setting objectives in Singleplayer, I'm guessing you need to do something with the
Code: Select all
waitthread global/objectives.scr::add_objectives
in your "levelend" thread.
Posted: Thu Dec 04, 2008 8:04 pm
by dietje_schietje
i now get a new test map and a new script file.
my script file works but my compas don't works
Code: Select all
main:
exec global/loadout.scr maps/test_demolition.scr
level waittill prespawn
exec global/exploder.scr
exec global/ambient
// bind the switches to the elevator
// so it doesnt look weird
$down_switch bind $elevator_cab
$up_switch bind $elevator_cab
// bind triggers to the switches
$down_trigger bind $down_switch
$up_trigger bind $up_switch
// I had it moved up for lighting
$elevator_cab movedown 8
$elevator_cab time 0
$elevator_cab move
// sets the speed to 64 units per second
$elevator_cab speed 64
// starts on floor 1
level.elepos = 1
$elevator_cab2 speed 64
level waittill spawn
$player item weapons/thompsonsmg.tik
$player ammo smg 1000
$player useweaponclass smg
$player item explosive
thread elevator_prep
thread objectives
end
objectives:
waitthread global/items.scr::add_item "explosive" //gives player
//explosives
waitthread global/objectives.scr::add_objectives 1 1 "Bomb the wall to get in." $wall.origin
waitthread global/objectives.scr::add_objectives 2 1 "Bomb the flak 88." $flak88.origin
waitthread global/objectives.scr::add_objectives 3 1 "Bomb the 20mm Gun." $20mm.origin
waitthread global/objectives.scr::add_onjectives 4 1 "Bomb the Stuka." $stuka.origin
waitthread global/objectives.scr::add_objectives 1 2 "Bomb the wall to get in." $wall.origin
waitthread global/objectives.scr::current_objectives 1
thread objective1
end
elevator_prep:
thread movedown
thread moveup
end
movedown:
// waits until the player triggers the trigger
$down_trigger waittill trigger
// if the elevator is on floor 1 then end
// because it cant go down anymore
if (level.elepos == 1)
end
// turns off the triggers
// until the elevator is done moving
$up_trigger nottriggerable
$down_trigger nottriggerable
// sets another variable
local.position = level.elepos
//turns the switch
$down_switch anim turn
// makes some noise
$elevator_cab loopsound lighthouse_run
// says to move to the floor
// below the one that it is on
$elevator_cab moveto $("floor" + (local.position - 1))
$elevator_cab waitmove
$elevator_cab stoploopsound
$down_switch anim idle
// Tells the variable to minus 1 from itself.
// Makes the variable set to the correct floor.
level.elepos--
// turns the triggers back on
$down_trigger triggerable
$up_trigger triggerable
goto elevator_prep
end
moveup:
$up_trigger waittill trigger
// if the elevator is at the top then end
// because it cant go up anymore
if (level.elepos == 2)
end
$down_trigger nottriggerable
$up_trigger nottriggerable
local.position = level.elepos
$up_switch anim turn
$elevator_cab loopsound lighthouse_run
$elevator_cab moveto $("floor" + (local.position + 1))
$elevator_cab waitmove
$elevator_cab stoploopsound
$up_switch anim idle
level.elepos++
$up_trigger triggerable
$down_trigger triggerable
goto elevator_prep
end
objective1:
$bomb1_trigger waittill trigger
$bomb1 model "animate/explosive.tik"
$bomb1 playsound explosive
$player loopsound bombtick
$player stopwatch 5
wait 5
$player stoploopsound bombtick
$bomb1 playsound explode_tank
$bomb1 remove
waitthread global/exploder.scr::explode 1
radiusdamage $hurtobject1 256 384
waitthread global/objectives.scr::add_objectives 1 3 "Bomb the wall to get in." $wallgin
wait 2
waitthread global/objectives.scr::add_objectives 2 2 "Bomb the flak 88." $flak88.origin
waitthread global/objectives.scr::add_objectives 3 2 "Bomb the 20mm Gun." $20mm.origin
waitthread global/objectives.scr::add_onjectives 4 2 "Bomb the Stuka." $stuka.origin
waitthread global/objectives.scr::current_objectives 4
thread objective2
end
objective2:
$bomb2_trigger waittill trigger
$bomb2 model "animate/explosive.tik"
$bomb2 playsound explosive
$player loopsound bombtick
$player stopwatch 7
wait 7
$player stoploopsound bombtick
$bomb2 playsound explode_tank
$bomb2 remove
waitthread global/exploder.scr::explode 2
radiusdamage $hurtobject2 256 384
waitthread global/objectives.scr::add_objectives 2 3 "Bomb the flak 88." $flak88.origin
waitthread global/objectives.scr::current_objectives 4
thread objective3
end
objective3:
wait 1
$bomb3_trigger waittill trigger
$bomb3 model "animate/explosive.tik"
$bomb3 playsound explosive
$player loopsound bombtick
$player stopwatch 7
wait 7
$player stoploopsound bombtick
$bomb3 playsound explode_tank
$bomb3 remove
waitthread global/exploder.scr::explode 3
radiusdamage $hurtobject2 256 384
waitthread global/objectives.scr::add_objectives 3 3 "Bomb the 20mm Gun." $20mm.origin
waitthread global/objectives.scr::current_objectives 4
wait 1
thread objective4
end
objective4:
$bomb4_trigger waittill trigger
$bomb4 model "animate/explosive.tik"
$bomb4 playsound explosive
$player loopsound bombtick
$player stopwatch 7
wait 7
$player stoploopsound bombtick
$bomb4 playsound explode_tank
$bomb4 remove
waitthread global/exploder.scr::explode 4
radiusdamage $hurtobject2 256 384
waitthread global/objectives.scr::add_objectives 4 3 "Bomb the Stuka." $stuka.origin
waitthread global/objectives.scr::current_objectives 4
wait 1
thread levelend
end
levelend:
waitthread global/objectives.scr::current_objectives 0
exec global/missioncomplete.scr test_bombingstuff
end