[PREFAB] Capture the Flag


(stealth6) #1

I remade my Capture the Flag prefab, it’s now a lot easier to use so let’s get some nice ctf maps going :smiley:

You can find lots of information in the ReadMe.txt

Basic features:

  • 2 flags red/blue (obviously)
  • 2 scoreboards, but easily duplicable
  • ‘Fake goals’ when triggered by the flag bearer the flag he is carrying is returned (useful for when a player falls into lava or an unreachable spot)

Download link:
http://www.mediafire.com/file/nzkmm2bmtzg/CTF_Prefab.zip

(mirrors welcomed)

Mirror Wolfmap.de:
http://www.wolfmap.de/details.php?file_id=3489

Now make some ctf maps!!! :stroggtapir:


(twt_thunder) #2

thanx, probably gonna need this in vc_village :smiley: :smiley:


(Cambodunum) #3

im searching for a counter up to 1000 … do you have any idea how i can solve this problem? … goldendunk and other mapscript couldnt help me much

ive just halted this “dream”
maybe you know a solution xD

(… it should counting kills for teamdeathmatch, ive already got the “count” working … but i would need a visual solution)

greetz Cambo


sry for being offtopic


(Zer0Cool) #4

imho it is easier to make numbermodels, which is easy to do with C’s modeltool(or take the ones from MLB map) and to use the “changemodel” command. Just in case somebody needs the limited remapshader for smth else…

m searching for a counter up to 1000 …

you could do a counter with over 200 digits if needed :stuck_out_tongue:
if nobody posts a solution i may do it mayby later.


(stealth6) #5

lol I’ve already done a counter to 1000, but i thought that’s a bit ridiculously high for ctf.
Anyway it’s really easy the code now just needs a third stage for the 100’s and it works…

edit: @ cambo it’s a nice idea and I’ve had it too, how did you solve the counting problem?? that’s one i’ve never solved.

Edit2:

script that goes up to 1000 you need to apply the texture alscore000 and axscore000 for the hundreds
Still uses remapshader so the easy scoreboard copying is still kept, not sure if it works flawlessly cause I didn’t feel like making 1000 caps lol!
but it didn’t give the overflow error so I think it’s alright (no major bugs at least)

side note: last time I used setstate, but I had only 1 scoreboard.

anyway script:


game_manager
{
	spawn
	{
		wait 200
		wm_axis_respawntime 1
		wm_allied_respawntime 1
		wm_set_round_timelimit 15
		wm_number_of_objectives 	2
		wm_set_defending_team 		0
						
		// If the round timer expires, the Axis have won, so set the current winning team
		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0

		wait 500

		// Objectives
		// 1: Allied Flag
		// 2: Axis Flag

		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0


		//SCOREBOARD

		//Set up scoreboard on AL: 00 / AX: 00

		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/alscore0"
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/alscore00"
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/axscore0"
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/axscore00"
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/alscore000"
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/axscore000"
		remapshaderflush


		alertentity allied_flag1	// reveal the flags to start with, setstate invisble and default
		alertentity axis_flag1	// should work from here on.

		accum 1 set 0		// allied "0-9"
		accum 2 set 0		// allied "10-90"
		accum 3 set 0		// axis "0-9"
		accum 4 set 0		// axis "10-90"
		accum 5 set 0		// allies "100-900"
		accum 6 set 0		// axis "100-900"
		//accum 7 set 0		// nothing
		//accum 8 set 0		// nothing
		//accum 9 set 0		// nothing
		globalaccum 0 set 0	// keeps the score, starts on 0, allies +1, axis -1


	}
	trigger allies_captd		// update allies captured, 999 flags for this test
	{
		globalaccum 0 inc 1 //allied +1

		accum 1 inc 1
		// allies score board stuff
		accum 1 trigger_if_equal 1 game_manager allies1
		accum 1 trigger_if_equal 2 game_manager allies2
		accum 1 trigger_if_equal 3 game_manager allies3
		accum 1 trigger_if_equal 4 game_manager allies4
		accum 1 trigger_if_equal 5 game_manager allies5
		accum 1 trigger_if_equal 6 game_manager allies6
		accum 1 trigger_if_equal 7 game_manager allies7
		accum 1 trigger_if_equal 8 game_manager allies8
		accum 1 trigger_if_equal 9 game_manager allies9
		accum 1 trigger_if_equal 10 game_manager alliesx
	}

	// Allies set
	trigger allies1
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger allies2
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score2"
		remapshaderflush
	}
	trigger allies3
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger allies4
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score4"
		remapshaderflush
	}
	trigger allies5
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger allies6
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger allies7
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger allies8
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger allies9
	{
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger alliesx
	{
		accum 1 inc -10
		accum 2 inc 1
		remapshader "textures/scoreboard/alscore0" "textures/scoreboard/alscore0"
		remapshaderflush
		accum 2 trigger_if_equal 1 game_manager allies10
		accum 2 trigger_if_equal 2 game_manager allies20
		accum 2 trigger_if_equal 3 game_manager allies30
		accum 2 trigger_if_equal 4 game_manager allies40
		accum 2 trigger_if_equal 5 game_manager allies50
		accum 2 trigger_if_equal 6 game_manager allies60
		accum 2 trigger_if_equal 7 game_manager allies70
		accum 2 trigger_if_equal 8 game_manager allies80
		accum 2 trigger_if_equal 9 game_manager allies90
		accum 2 trigger_if_equal 10 game_manager alliesxx
	}
	trigger allies10
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger allies20
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score2"
		remapshaderflush 
	}
	trigger allies30
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger allies40
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score4"
		remapshaderflush
	}
	trigger allies50
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger allies60
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger allies70
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger allies80
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger allies90
	{
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger alliesxx
	{
		accum 2 inc -10
		accum 5 inc 1
		remapshader "textures/scoreboard/alscore00" "textures/scoreboard/alscore00"
		remapshaderflush
		accum 5 trigger_if_equal 1 game_manager allies100
		accum 5 trigger_if_equal 2 game_manager allies200
		accum 5 trigger_if_equal 3 game_manager allies300
		accum 5 trigger_if_equal 4 game_manager allies400
		accum 5 trigger_if_equal 5 game_manager allies500
		accum 5 trigger_if_equal 6 game_manager allies600
		accum 5 trigger_if_equal 7 game_manager allies700
		accum 5 trigger_if_equal 8 game_manager allies800
		accum 5 trigger_if_equal 9 game_manager allies900
		accum 5 trigger_if_equal 10 game_manager allieswin
	}
	trigger allies100
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger allies200
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score2"
		remapshaderflush 
	}
	trigger allies300
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger allies400
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score4"
		remapshaderflush
	}
	trigger allies500
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger allies600
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger allies700
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger allies800
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger allies900
	{
		remapshader "textures/scoreboard/alscore000" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger allieswin
	{
		wm_setwinner 1
		wm_endround
	}

	trigger axis_captd		// update axis captured, 999 flags for this test ;)
	{
		globalaccum 0 inc -1 //axis -1

		accum 3 inc 1

		// axis score board stuff
		// as mentioned below, we do not set the final capture if its 100.
		accum 3 trigger_if_equal 1 game_manager axis1
		accum 3 trigger_if_equal 2 game_manager axis2
		accum 3 trigger_if_equal 3 game_manager axis3
		accum 3 trigger_if_equal 4 game_manager axis4
		accum 3 trigger_if_equal 5 game_manager axis5
		accum 3 trigger_if_equal 6 game_manager axis6
		accum 3 trigger_if_equal 7 game_manager axis7
		accum 3 trigger_if_equal 8 game_manager axis8
		accum 3 trigger_if_equal 9 game_manager axis9
		accum 3 trigger_if_equal 10 game_manager axisx
	}
	// axis set
	trigger axis1
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger axis2
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score2"
		remapshaderflush
	}
	trigger axis3
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger axis4
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score4"
		remapshaderflush 
	}
	trigger axis5
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger axis6
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger axis7
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger axis8
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger axis9
	{
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger axisx
	{
		accum 3 inc -10
		accum 4 inc 1
		remapshader "textures/scoreboard/axscore0" "textures/scoreboard/axscore0"
		remapshaderflush
		accum 4 trigger_if_equal 1 game_manager axis10
		accum 4 trigger_if_equal 2 game_manager axis20
		accum 4 trigger_if_equal 3 game_manager axis30
		accum 4 trigger_if_equal 4 game_manager axis40
		accum 4 trigger_if_equal 5 game_manager axis50
		accum 4 trigger_if_equal 6 game_manager axis60
		accum 4 trigger_if_equal 7 game_manager axis70
		accum 4 trigger_if_equal 8 game_manager axis80
		accum 4 trigger_if_equal 9 game_manager axis90
		accum 4 trigger_if_equal 10 game_manager axisxx
	}
	trigger axis10
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger axis20
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score2"
		remapshaderflush
	}
	trigger axis30
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger axis40
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score4"
		remapshaderflush
	}
	trigger axis50
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger axis60
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger axis70
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger axis80
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger axis90
	{
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger axisxx
	{
		accum 4 inc -10
		accum 6 inc 1
		remapshader "textures/scoreboard/axscore00" "textures/scoreboard/axscore00"
		remapshaderflush
		accum 6 trigger_if_equal 1 game_manager axis100
		accum 6 trigger_if_equal 2 game_manager axis200
		accum 6 trigger_if_equal 3 game_manager axis300
		accum 6 trigger_if_equal 4 game_manager axis400
		accum 6 trigger_if_equal 5 game_manager axis500
		accum 6 trigger_if_equal 6 game_manager axis600
		accum 6 trigger_if_equal 7 game_manager axis700
		accum 6 trigger_if_equal 8 game_manager axis800
		accum 6 trigger_if_equal 9 game_manager axis900
		accum 6 trigger_if_equal 10 game_manager axiswin
	}
	trigger axis100
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score1"
		remapshaderflush
	}
	trigger axis200
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score2"
		remapshaderflush
	}
	trigger axis300
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score3"
		remapshaderflush
	}
	trigger axis400
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score4"
		remapshaderflush
	}
	trigger axis500
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score5"
		remapshaderflush
	}
	trigger axis600
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score6"
		remapshaderflush
	}
	trigger axis700
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score7"
		remapshaderflush
	}
	trigger axis800
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score8"
		remapshaderflush
	}
	trigger axis900
	{
		remapshader "textures/scoreboard/axscore000" "textures/scoreboard/score9"
		remapshaderflush
	}
	trigger axiswin
	{
		wm_setwinner 0
		wm_endround
	}

	trigger timelimit_hit	// who got the most caps, or is it even?
	{
		wm_setwinner -1
		trigger game_manager parse_allies
		trigger game_manager parse_axis
		trigger game_manager parse_tie
		wait 250
	}
	
	// SCORE PARSE SCRIPT, TO SEE WHO IS AHEAD	
	// IF POSITIVE ALLIES WIN, IF NEGATIVE AXIS WIN, IF 0 DRAW

	trigger parse_allies
	{
		//ALLIES WIN! (POSITIVE SCORE)
		globalaccum 0 abort_if_less_than 1
		wm_setwinner 1
		wm_endround
	}

	trigger parse_axis
	{
		//AXIS WIN! (NEGATIVE SCORE)
		globalaccum 0 abort_if_greater_than -1
		wm_setwinner 0
		wm_endround
	}

	trigger parse_tie
	{
		//DRAW! (SCORE = 0)
		globalaccum 0 abort_if_not_equal 0
		wm_setwinner -1
		wm_endround
	}
}
//
// flag control as per madmaximus script...
//
allied_flag1
{
	trigger stolen	// axis stole a flag
	{
		setstate allied_flag1 invisible		// hide the team_CTF_blueflag entity
		setstate allies_cap_flag1 invisible		// hide the allies trigger_flagonly_multiple in case the allies

		wm_teamvoiceannounce 0 "ctf_blueflagtaken"
		wm_teamvoiceannounce 1 "ctf_blueflagtaken"
	
		wm_announce "^4Blue flag taken!"
	}							

	trigger returned	// flag was dropped and timed out or an allied player touched it
	{
		setstate allied_flag1 default			// axis lost the flag, so setstate the team_CTF_blueflag and
		setstate allies_cap_flag1 default		// their trigger_flagonly_multiple back.

		wm_teamvoiceannounce 0 "ctf_blueflagreturned"
		wm_teamvoiceannounce 1 "ctf_blueflagreturned"

		wm_announce "^4Blue flag returned!"
	}

	trigger dropped
	{
		wm_teamvoiceannounce 0 "ctf_blueflagdropped"
		wm_teamvoiceannounce 1 "ctf_blueflagdropped"
		wm_announce "^4Blue flag dropped!"
	}
}

axis_flag1
{
	trigger stolen	
	{
		setstate axis_flag1 invisible
		setstate axis_cap_flag1 invisible

		wm_teamvoiceannounce 0 "ctf_redflagtaken"
		wm_teamvoiceannounce 1 "ctf_redflagtaken"
		wm_announce "^1Red flag taken!"
	}

	trigger returned
	{
		setstate axis_flag1 default
		setstate axis_cap_flag1 default

		wm_teamvoiceannounce 0 "ctf_redflagreturned"
		wm_teamvoiceannounce 1 "ctf_redflagreturned"
		wm_announce "^1Red flag returned!"
	}

	trigger dropped
	{
		wm_teamvoiceannounce 0 "ctf_redflagdropped"
		wm_teamvoiceannounce 1 "ctf_redflagdropped"
		wm_announce "^1Red flag dropped!"
	}
}

allies_cap_flag1   // allies have transported the axis flag and made it back to their flagpole.

{
   	death
   	{
		setstate axis_flag1 default		//  flag comes back minus 1 count,
		setstate axis_cap_flag1 default	// trigger_flagonly_multiple back also.

		wm_teamvoiceannounce 0 "ctf_blueteamscores"
		wm_teamvoiceannounce 1 "ctf_blueteamscores"
		wm_announce "^4The Allies have Captured the Flag!!!"

      		trigger game_manager allies_captd  // go update the allies flag captured counter.
   	}
} 

axis_cap_flag1

{
   	death
   	{
		setstate allied_flag1 default
		setstate allies_cap_flag1 default

		wm_teamvoiceannounce 0 "ctf_redteamscores"
		wm_teamvoiceannounce 1 "ctf_redteamscores"
		wm_announce "^1The Axis have Captured the Flag!!!"

		trigger game_manager axis_captd
   	}
} 

// FAKE GOALS - to return flag when a player dies in an unreachable spot (ex: lava,...)
axflag_fakegoal
{
	death
	{
		setstate axis_flag1 default
		setstate axis_cap_flag1 default
		wm_teamvoiceannounce 0 "ctf_redflagreturned"
		wm_teamvoiceannounce 1 "ctf_redflagreturned"
		// and DONT update the score obviously!
		wm_announce "^1Red flag returned!"
	}
}
alflag_fakegoal
{
	death
	{
		setstate allied_flag1 default
		setstate allies_cap_flag1 default
		wm_teamvoiceannounce 0 "ctf_blueflagreturned"
		wm_teamvoiceannounce 1 "ctf_blueflagreturned"
		wm_announce "^4Blue flag returned!"
	}
}

Add this to the scoreboard.shader


textures/scoreboard/alscore000
{
	qer_editorimage textures/scoreboard/score0.tga
	surfaceparm nomarks
	{
		map textures/scoreboard/score0.tga
            rgbGen identity                
	}
}

textures/scoreboard/axscore000
{
	qer_editorimage textures/scoreboard/score0.tga
	surfaceparm nomarks
	{
		map textures/scoreboard/score0.tga
            rgbGen identity                
	}
}

edit4: maybe you could do one even up to 10000, but I think you can figure that out yourself + I think you will probably have too many remapshaders (if you don’t it will be cutting it close!)
too many remaps results in overflow.

edit5: lol I made myself interested if 10000 would work and… it does ROFL :smiley: and i think you can even go up to 100000 but I think i will leave that one to you.
if I understand it correctly for 10000 you need 17 remapshaders and the limit is 32, so a while to go yet :stuck_out_tongue:


(shagileo) #6

You’re teh best, stealth !
Thanks for sharing this


(Qualmi) #7

you got a counter to work ? let me see ? as far as i know kills cant be counted but if you got a solution then tell me.

and about the visual part. that would be very very very extremly complicated. you would probably need a thousand tga/jpg pictures to describe the actual state. it would be almost impossible to do this on a degree to thousand, cause all these remapshaders would need a pic.

but…i think there is someone who could tell you more. ive heard of a mod in progress which will solve this problem. maybe this one will tell some secrets here :slight_smile:

oh jea and there are new smileys in the forum yay. take this -> :armadillochase: :armadillochase:

:cool::cool:


(stealth6) #8

[QUOTE=Qualmi;206138]
and about the visual part. that would be very very very extremly complicated. you would probably need a thousand tga/jpg pictures to describe the actual state. it would be almost impossible to do this on a degree to thousand, cause all these remapshaders would need a pic.

but…i think there is someone who could tell you more. ive heard of a mod in progress which will solve this problem. maybe this one will tell some secrets here :)[/QUOTE]

lol have you actually read the thread?

tl;dr we already solved the scoreboard problem with 10 images and a shader, no need for a thousand pictures lol also if you did it in the way you described it would’t work due to the thing i also explained in this thread (max 32 remaps)


(Qualmi) #9

[QUOTE=stealth6;206146]lol have you actually read the thread?

tl;dr we already solved the scoreboard problem with 10 images and a shader, no need for a thousand pictures lol also if you did it in the way you described it would’t work due to the thing i also explained in this thread (max 32 remaps)[/QUOTE]

lol

actually am drunk XD

gonna reread that tomorrow.

edit: ah ok. you are talking about scoreboards located in the map. i was talking about hudscoreboards. i didnt look at the prefab before sorry. by judging now from the pic i think you mean non-hudscoreboards.


(Cambodunum) #10

ive already solved the counting via “spawns” … iirc Zero supported me … currently im using it in an unofficial version of my teamdeathmatch map “madbunker” … so i will take a look tomorrow if its possible (for me) to merge stealth’s script


game_manager

{
	spawn
	{
		//game rules
		wm_axis_respawntime 1
		wm_allied_respawntime 1
		wm_set_round_timelimit 15

		//wm_setwinner -1
		
		globalaccum 0 set 0
	
	}
		
		trigger timelimit_hit
		
	{
		trigger self findwinner
	}


	trigger findwinner
	
	{
		globalaccum 0 abort_if_greater_than 1
		wm_setwinner 1
		globalaccum 0 abort_if_greater_than -1
		wm_setwinner 0
	}
		
}

	axis_counter
	
{
	   trigger count
   	{
   	globalaccum 0 inc 1
   	printglobalaccum 0 
  	}
  	
}
	 
	allies_counter
	
{
   	trigger count_allies
   	{
  	 globalaccum 0 inc -1
  	 printglobalaccum 0 
 	}
 	
}

it wasnt possible fo rme to solve the “tie” problem … thats why ive used to set axis as winnerteam (especially to solve an empty server cycle)

greetz Cambo

(i know the code is written very ugly … so please dont blame me xD)


(Qualmi) #11

ok. sorry now for yesterday. i posted without reading exactly (script and didnt look at pic) and i was talking about different scoreboards.

for the counting of the deaths of every team the “spawn” is bit too less of information. afaik i can only think of 2 approaches:

one is to give the team_spawns a scriptname and if its active it would mean an activate event of that entity. but i dont know if that entity supports this event so it could fail. i can only think of this theoretically.

the other way is to somehow put trigger multiples at the spawns. these could count. but probably one could offset the count this way or even manipulate it. i dont know exactly, but madbunker got special spawns ? you must when you try the trigger method, try it with special prepared spawns. you must fly a corridor and inside the corridor is a trigger or sth. that would be the solution. i dont know if you made it that way, but i can think of it.

about the tie problem. once you got the counting to work than this really shouldnt be a problem anymore. your script is indeed very messy, but one can see that you have an allies counter decreasing by one, so i conclude you have an axis counter increasing the same size. both must be one accum. so where is the problem. parse your accum at the end and set the winner, then its solved.


(Qualmi) #12

ok. sorry now for yesterday. i posted without reading exactly (script and didnt look at pic) and i was talking about different scoreboards.

for the counting of the deaths of every team the “spawn” is bit too less of information. afaik i can only think of 2 approaches:

one is to give the team_spawns a scriptname and if its active it would mean an activate event of that entity. but i dont know if that entity supports this event so it could fail. i can only think of this theoretically.

the other way is to somehow put trigger multiples at the spawns. these could count. but probably one could offset the count this way or even manipulate it. i dont know exactly, but madbunker got special spawns ? you must when you try the trigger method, try it with special prepared spawns. you must fly a corridor and inside the corridor is a trigger or sth. that would be the solution. i dont know if you made it that way, but i can think of it.

about the tie problem. once you got the counting to work than this really shouldnt be a problem anymore. your script is indeed very messy, but one can see that you have an allies counter decreasing by one, so i conclude you have an axis counter increasing the same size. both must be one accum. so where is the problem. parse your accum at the end and set the winner, then its solved. you already did it actually. you only have to create som enew triggers somewhere (cause you use globals you can put them everywhere) and then trigger these at the end, would mean:

trigger findwinner
	
	{
		trigger trigger_somewhere trigger_parse_al
               trigger trigger_somewhere trigger_parse_ax
        }

       //==============

{

         trigger trigger_parse_al
         <condition>
	 wm_setwinner 1
}
         
{

         trigger trigger_parse_ax
         <condition>
	 wm_setwinner 1
}
        

i didnt want to apply your example, cause there are some mean things you could do wrong. so i did <condition> instead.


(Qualmi) #13

ok. sorry now for yesterday. i posted without reading exactly (script and didnt look at pic) and i was talking about different scoreboards.

for the counting of the deaths of every team the “spawn” is bit too less of information. afaik i can only think of 2 approaches:

one is to give the team_spawns a scriptname and if its active it would mean an activate event of that entity. but i dont know if that entity supports this event so it could fail. i can only think of this theoretically.

the other way is to somehow put trigger multiples at the spawns. you need special prepared spawns for this. i dont know if madbunker got such. you need a corridor or sth where ppl fly down through the trigger.

about the tie problem. what is your problem exactly. do you know the trick ? one can only guess if you understood it, but the tie problem got solved several times now. normally you shouldnt deserve a clear answer after posting that script. you need one accum to be exactly. you inc it when allies score, you decrease it when axis score. i dont know if you got it like this in your script. you really messed it up. its only half of it :rolleyes: so seeing how your accum works you should parse it at the end to set the winner.


(Qualmi) #14

ok. sorry now for yesterday. i posted without reading exactly (script and didnt look at pic) and i was talking about different scoreboards.

for the counting of the deaths of every team the “spawn” is bit too less of information. afaik i can only think of 2 approaches:

one is to give the team_spawns a scriptname and if its active it would mean an activate event of that entity. but i dont know if that entity supports this event so it could fail. i can only think of this theoretically.

the other way is to somehow put trigger multiples at the spawns. you need special prepared spawns for this. i dont know if madbunker got such. you need a corridor or sth where ppl fly down through the trigger.

about the tie problem. what is your problem exactly. do you know the trick ? one can only guess if you understood it, but the tie problem got solved several times now. normally you shouldnt deserve a clear answer after posting that script. you need one accum to be exactly. you inc it when allies score, you decrease it when axis score. i dont know if you got it like this in your script. you really messed it up. its only half of it :rolleyes: so seeing how your accum works you should parse it at the end to set the winner. you can also set a tie this way by aborting your accum.


(stealth6) #15

to solve the tie problem just let the teams draw lol :wink:
it’s a possibility in ET, just not used very often.
This is the code from my script:


	trigger timelimit_hit	// who got the most caps, or is it even?
	{
		wm_setwinner -1
		trigger game_manager parse_allies
		trigger game_manager parse_axis
		trigger game_manager parse_tie
		wait 250
	}
	
	// SCORE PARSE SCRIPT, TO SEE WHO IS AHEAD	
	// IF POSITIVE ALLIES WIN, IF NEGATIVE AXIS WIN, IF 0 DRAW

	trigger parse_allies
	{
		//ALLIES WIN! (POSITIVE SCORE)
		globalaccum 0 abort_if_less_than 1
		wm_setwinner 1
		wm_endround
	}

	trigger parse_axis
	{
		//AXIS WIN! (NEGATIVE SCORE)
		globalaccum 0 abort_if_greater_than -1
		wm_setwinner 0
		wm_endround
	}

	trigger parse_tie
	{
		//DRAW! (SCORE = 0)
		globalaccum 0 abort_if_not_equal 0
		wm_setwinner -1
		wm_endround
	}

And could you tell us how you are counting the kills or spawns now?? :smiley: lol I am really interested to know and if I know I can probably easily combine it with this script and release it as a prefab.

and you say that counting respawns isn’t a very good idea, but in the 1v1 ladder isn’t that the rules? least deaths wins? also selfkills count so then it makes sense. The only thing left then that effects the count is people changing team or joining the game, but I think this doesn’t really matter since both teams will have this problem and this will only effect the score by 5% I think


(Qualmi) #16

i found i third and probably best solution. beside that cambo probably solved it with method 2 i posted above. but he surely will inform us about that.

for now what i tried still needs to be tested alot, but i think you can adjust all upcoming, possible problems and it will give you perfect result. this way you dont need to prepare the spawns, you increase an accum when spawning directly. i hope you can use this:

make a spawn, make a targetscript trigger. link the spawn to the script_trigger and give the script_trigger a scriptname and a target. this way everytime someone spawns the script gets reached. there are some things you need to test, for example i only tried this with ONE spawn and ONE target_script_trigger. maybe there are problems with more. also a problem is that if you spawn the script gets executed twice, when you get killed it only get executed once. probably is problematic. maybe you do a wait and then when the whole team spawned you set the accum to 0 and start counting.

as i said. this must be adjusted to your needs, but thats the basic idea. pretty simple actually.


(Cambodunum) #17

sry … im busy gtg to my office now … but here’s your answer:

btw … i didnt want to get a tie … cuz its annoying me if the map doesnt end if noone is on the server … on my first version ive just set one team as winner (just for fun fraggin) … then ive managed (with zero’s help) that one team can win by counting “deaths” …

cya later
greetz Cambo


(Qualmi) #18

cool. thats the same way i proposed above XD nicely done actually if i think about it :slight_smile:

@tie: afaik the map ends with the script stealth posted above. the fact that the map doesnt end is because you have to set a winner in game_manager spawn, when the map starts. thats the precondition actually. i dont know why its like that, but it seems to be needed.


(ischbinz) #19

i realiced a counter long time ago with script movers - rotating cylinders with numbers
it was a countdown not a really counter - but it worked well -
if you want i can search it…


(-SSF-Sage) #20

wm_setwinner -1 can only end a round if wm_endround is executed. Otherwise it will continue. Also you need to wm_setwinner 0 or 1 in the spawn or otherwise trigger timelimit_hit won’t get executed. As it was mentioned above. So yes stealth’s script works.

That wait in the timelimit_hit can cause problems (script halts and doesn’t finish), and it doesn’t really help anyway.