Count Down for flag.


(Tyrlop) #1

hey SD, im wondering how to make countdown thing, so i looked into the daybreak map script today, but all looked so complicated, later i searched for it here but found nothing, so i post here: my map, got a flag that right now when it gets captured by and axis, the axis teams win after some seconds, but if the allies takes the flag before that seconds the axis still wins.

so i wanted to make such countdown as u got on ur map indaybreak…
i dont got much clues how to make it … but here is my script right now :

game_manager // Start game_manager section
{
	spawn
	{
		wm_set_round_timelimit 30
		wm_axis_respawntime 3
		wm_allied_respawntime 5
		wm_set_defending_team 1
		wm_setwinner 1
	} // End spawn

}  // End game_manager section


castle_flag
{
   spawn
	{
		accum 1 set 2 // Who owns flag: 0-Axis, 1-Allied, 2-Nobody (1 = 0)
	}

trigger allied_capture
	{
		accum 1 abort_if_equal 1
		accum 1 trigger_if_equal 0 castle_flag allied_reclaim
		accum 1 set 1
		wm_announce "Humans got the Flag!"
		setstate castle_wobj default
	}

trigger allied_reclaim
	{
		alertentity castle_wobj // Switch command map marker
	}

trigger axis_capture // Touched by an axis player
	{
		accum 1 abort_if_equal 0 // do Allies own flag?
		accum 1 set 0 // Axis own the flag
		wm_announce "The Zombies Captured the Flag!"
		setstate castle_wobj default
		alertentity castle_wobj
		wm_setwinner 0
		wait 9000
		wm_endround
	}
}

hope ill get a answer or a link or something :slight_smile:


(-SSF-Sage) #2

It works now with a fast look like if you axis capture, it waits 9 seconds, and end the game axis winning. I’m not sure what are you willing to achieve, don’t know the map you are speaking of. Do you want it to announce countdown, like game ending in 9,8,7…? It would go like for example:

wm_announce “blablablabaallalalal”
wait 1000
wm_announce “8”
wait 1000
wm_announce “7”
wait 1000
wm_announce “6”
wait 1000

wm_setwinner 0
wm_endround

and so on.


(Tyrlop) #3

ok thank but, but if allies now take the flag before the countdown is finnish? do the countdown stops? thats one of the hard things…


(kamikazee) #4

It’s pretty logical that the allies can’t win. The axis_capture routine is started, waits, then finishes the game. There is no check present to see if the axis still got the flag.

If you don’t want a countdown but want to stick to the current script, try this:

    trigger allied_capture
    {
        accum 1 abort_if_equal 1 // Do we have the flag already?
        accum 1 trigger_if_equal 0 castle_flag allied_reclaim
        wm_setwinner 1 // Allies should win!
        accum 1 set 1
        wm_announce "Humans got the Flag!"
        setstate castle_wobj default
    }
    trigger allied_reclaim
    {
        alertentity castle_wobj // Switch command map marker
    } 
    trigger axis_capture // Touched by an axis player
    {
        accum 1 abort_if_equal 0 // do Allies own flag?
        accum 1 set 0 // Axis own the flag
        wm_announce "The Zombies Captured the Flag!"
        setstate castle_wobj default
        alertentity castle_wobj
        wm_setwinner 0
        wait 9000
        // Do axis still own the flag after these 9 seconds?
        accum 1 abort_if_not_equal 0
        wm_endround
    }

(89blitz) #5

not 100% sure but it could go like this…

castle_flag 
{ 
   spawn 
   { 
      accum 1 set 2 // Who owns flag: 0-Axis, 1-Allied, 2-Nobody (1 = 0) 
   } 

trigger allied_capture 
   { 
      accum 1 abort_if_equal 1 
      accum 1 trigger_if_equal 0 castle_flag allied_reclaim 
      accum 1 set 1 
      wm_announce "Humans got the Flag!" 
     
} 

trigger allied_reclaim 
   { 
      alertentity castle_wobj // Switch command map marker 
   } 

trigger axis_capture // Touched by an axis player 
   { 
      accum 1 abort_if_equal 0 // do Allies own flag? 
      accum 1 set 0 // Axis own the flag 
      wm_announce "The Zombies Captured the Flag!" 
      setstate castle_wobj default 
      alertentity castle_wobj 
      wait 1000
      wm_announce "10"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "9"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "8"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "7"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "6"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "5"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "4"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "3"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "2"
      accum 1 abort_if_equal 0
      wait 1000
      wm_announce "1"
      accum 1 abort_if_equal 0
      wait 2000
      wm_setwinner 1
      wm_endround
   } 


}

EDIT fixed sorry about lil mistake i made :roll:
EDIT well since you told me allies defending i just fixed the script :smiley:


(kamikazee) #6

That’s the kewl way to do it, weren’t it for the fact you forgot wm_setwinner. :roll:


(-SSF-Sage) #7

Yeah that would be a harder one, and require a nice script, I won’t write it for you, but could give you some possible tips. Note I’ve never done anything like this so don’t wait for too much. But here is something I would try:

Globalaccum 1 set 0 //on game_managers spawn
Globalaccum 2 set 0 //on game_managers spawn

globalaccum 1 set 1 //to the allied_captured
trigger game_manager reset //to allied_cap

Then you could make the countdown to it’s own trigger and make the axis capture activate it or something.

globalaccum 1 set 0 //axis capture

trigger game_manager check //between waits

game_manager
{

trigger check
{
globalaccum 1 abort_if_equal 1
globalaccum 2 inc 1
trigger game_manager end_check
}

end_check
{
globalaccum 2 abort_if_less_than 9 //or 10 :S try it… :smiley:
//end game stuff…
}

trigger reset
{
globalaccum 2 set 0
}
}

And so on.

Here is something to get you started. I know this will need tweaking etc. won’t work like this, but as I said I won’t make the script for you. But anyway I would start with something like this.

Edit lol what a mess… :smiley:


(Tyrlop) #8

NICE didnt knew so much will help me on so little time… thanks every body!
ill update soon… blitz is helping me personaly now! :evil: