few noob scripting questions


(Macuiare) #1

Hey I have a flag in the middle of my map if the axis capture it and hold it for 30 secounds Allies loose, I have the Allies loose right but I need some sort of exit script if allies capture back

heres what im using


trigger axis_capture // Touched by an Axis player

{

accum 0 abort_if_equal 0 // do Axis own flag?

accum 0 trigger_if_equal 1 forward_flag axis_reclaim // Reclaimed from Allies

accum 0 set 0 // Axis own the flag


setstate forward_wobj default


wm_objective_status 1 0 1
	wm_objective_status 1 1 2
	wm_announce "^1Nazi Zombies has captured the flag!"
	wait 1000
        wm_announce "^1CAPTURE THE FLAG BACK"
wait 1000
	wm_announce "^130 seconds remaining!"
	wait 10000
	wm_announce "^120 seconds remaining!"
	wait 10000
	wm_announce "^110 seconds remaining!"
	wait 5000
	wm_announce "^15"
	wait 1000
	wm_announce "^14"
	wait 1000
	wm_announce "^13"
	wait 1000
	wm_announce "^12"
	wait 1000
	wm_announce "^11"
	wait 1000
      wm_announce "^1 Oh Noes"
      wait 2000
      wm_setwinner 0
	wm_endround


}

Also, I have 4 spawn points, 1 for allies when flag captured, one for axis when flag captured and 1 each for when flag is not theres, but the allies one isnt working they can still spawn by the flag, does anyone know a good map to look at or a prefab so I can see what im doing wrong

note: if you need any part of my script tell me

thank you


(Miki) #2

Hmm, this is a pretty harsh problem. Don’t know if its a good way – but my way to fix it, would be something like this


trigger axis_capture // Touched by an Axis player

{

accum 0 abort_if_equal 0 // do Axis own flag?

accum 0 trigger_if_equal 1 forward_flag axis_reclaim // Reclaimed from Allies

accum 0 set 0 // Axis own the flag


setstate forward_wobj default


        wm_objective_status 1 0 1
	wm_objective_status 1 1 2
	wm_announce "^1Nazi Zombies has captured the flag!"
	wait 1000
      // I use accum 9, I guess that you don't use that numer yet... -Miki
       accum 9 set 0 // Axis own the flag
       wm_announce "2 mins!"
       wait 60000
accum 9 trigger_if_equal 0 forward_flag one_min



}
trigger one_min
{
      wm_announce "1 min!"
       wait 30000
accum 9 trigger_if_equal 0 forward_flag thirty_sec
}
trigger thirty_sec
{
      wm_announce "30 sec!"
       wait 25000
  accum 9 trigger_if_equal 0 forward_flag five_sec
}
trigger five_sec
{
      wm_announce "5 sec!"
       wait 2000
  accum 9 trigger_if_equal 0 forward_flag three_sec
}
trigger three_sec
{
      wm_announce "3 sec!"
       wait 1000
  accum 9 trigger_if_equal 0 forward_flag two_sec
}
trigger two_sec
{
      wm_announce "2 sec!"
       wait 1000
  accum 9 trigger_if_equal 0 forward_flag one_sec
}
trigger one_sec
{
      wm_announce "1 sec!"
       wait 1000
  accum 9 trigger_if_equal 0 forward_flag axis_win
}
trigger axis_win
{
      wm_announce "Axis won!"
        wm_setwinner 0
	wm_endround
}



// INSERT CODE FOR ALLIES CAPTURE HERE --  should only state accum 9 set 1
trigger allies_capture // Touched by an Allies player
{
wm_announce  "Allies recaptured the flag!"
accum 9 set 1 // allies own the flag now
}

Hopefully that does what you want

Miki