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 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