Kill board


(stealth6) #1

Hello,
I am new to mapping and to this forum :D, but I hae a question

I am working on a kinda first/test map and was wondering is it possible to make a scoreboard that counts the amount of kills per team?

So
Axis: 00000
Allies: 00000

axis makes 1 kill

Axis: 00001
Allies: 00000

This scoreboard is just somewhere in the map


(kamikazee) #2

Not that I’m aware of. You could rather try FalckonET’s deathmatch gametype…


(Flippy) #3

I think you can count the number of respawns, which relates a tiny bit to the number of kills.
But keep in mind that a selfkill, player joining a team etc will also count as a kill then.

You can try connecting a target_script_trigger to the spawn entities and run a scriptblock which increases an accum value there.

You should then update the scoreboard, which is a bit tricky to do and too much to explain in a single post… Check out loffy’s CTF prefab map, or any other map that has a scoreboard how it’s done.


(stealth6) #4

Hmm… Sounds quite tricky might just leave that till another time, cause as I said I just started mapping so think I just try to get in some basic stuff first before I try anything advanced


(Flippy) #5

Good idea… :wink:

The trickiest part is writing the code that controls the score shown in the scoreboard.
Since ET map scripting offers only a very limited amount of Logic operators there is a load of hassle trying to do something that might have been very easy.

In all common script/coding languages you can use some sort of “If/Then/Else” statement to do for example:

If score = 3 Then scoreboard_axis = 3

This however is not available in ET scripting.

Another missing thing is the use of variables.
While in most coding this would have been obvious…:

scoreboard_axis = axis_score

… no such thing exists in ET.

For it to work you will need to write out all possible combinations of the scores. EG:
Allies: 0 , Axis: 0
Allies: 1, Axis: 0
etc…

You will need to create a seperate piece of code for each possible score. You will then need to trigger these seperate pieces depending on the value of an accum (some sort of limited variable):

accum 0 trigger_if_equal 0 game_manager axis_score_0
accum 0 trigger_if_equal 1 game_manager axis_score_1
etc...

Which does not only require a LOT of code but will also make things very messy and very hard to find bugs.


(stealth6) #6

ok came back on the idea, since my dynamic level idea went on hold :stuck_out_tongue:

was looking at the script in loffys_ctf_prefab map
ans if I do it liekt at I have to write the script 9999 tmes for axis and 9999 times for allies :open_mouth:

so is there not a way to say if globalaccum 2 reaches 10 then reset it and add 1 to globalaccum 3

so that when axis get 10 kills the first digit on the scoreboard goes back to zero, but the second jumps onto 1 so “10”

And also had another question:
How could I make a wall that you can only walk through in 1 direction, or that only 1 team can walk through it, but it stops all bullets

like a forcefield for instance

Here I tried it a bit, tell me if this might work, it should count up to around 99 now and then I don’t know lol, might flip or something.


game_manager
{
	spawn
	{
		globalaccum 1 set 0 // Counter. Allied score if higher than 1.
		globalaccum 2 set 0 // Counter. Axis score if higher than 1.
		globalaccum 3 set 0 // Counter. Allied score if higher than 10.
		globalaccum 4 set 0 // Counter. Axis score if higher than 10.
		globalaccum 5 set 0 // Counter. Allied score if higher than 100.
		globalaccum 6 set 0 // Counter. Axis score if higher than 100.
		globalaccum 7 set 0 // Counter. Allied score if higher than 1000.
		globalaccum 8 set 0 // Counter. Axis score if higher than 1000.
	}

	trigger allies_trigger
		{
		globalaccum 1 inc 1

		trigger game_manager doallistuff
		trigger game_manager alli_set_the_score 		//trigger allidigitower2 set
		wait 50
		}

	trigger axis_trigger
		{
		globalaccum 2 inc 1

		trigger game_manager doaxisstuff
		trigger game_manager axis_set_the_score // trigger axisdigitower2 set
		wait 50
		}

	trigger doallistuff
		{

		globalaccum 1 abort_if_not_equal 10 // Have the Allies really accumulated 10 points?
		trigger game_manager allies_set_the_score10
		trigger game_manager doallistuff2
		globalaccum 3 inc 1
		globalaccum 1 set 0
		wait 100
		}

	trigger doallistuff2
		{

		globalaccum 3 abort_if_not_equal 10 // Have the Allies really accumalated 100 points?
		trigger game_manager allies_set_the_score100
		trigger game_manager doallistuff3
		globalaccum 5 inc 1
		globalaccum 3 set 0
		wait 100
		}

	trigger doallistuff3
		{

		globalaccum 5 abort_if_not_equal 10 // Have the Allies really accumalated 100 points?
		trigger game_manager allies_set_the_score1000
		trigger game_manager doallistuff4
		globalaccum 7 inc 1
		globalaccum 5 set 0
		wait 100
		}

trigger alli_set_the_score
{
		trigger game_manager alli_set0
		trigger game_manager alli_set1
		trigger game_manager alli_set2
		trigger game_manager alli_set3
		trigger game_manager alli_set4
		trigger game_manager alli_set5
		trigger game_manager alli_set6
		trigger game_manager alli_set7
		trigger game_manager alli_set8
		trigger game_manager alli_set9
}

trigger alli_set0
	{
		globalaccum 1 abort_if_not_equal 0
		setstate alliscoresquare0 default // Show digit
		setstate alliscoresquare1 invisible // Hide digits
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set1
	{
		globalaccum 1 abort_if_not_equal 1
		setstate alliscoresquare1 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set2
	{
		globalaccum 1 abort_if_not_equal 2
		setstate alliscoresquare2 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set3
	{
		globalaccum 1 abort_if_not_equal 3
		setstate alliscoresquare3 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set4
	{
		globalaccum 1 abort_if_not_equal 4
		setstate alliscoresquare4 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set5
	{
		globalaccum 1 abort_if_not_equal 5
		setstate alliscoresquare5 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set6
	{
		globalaccum 1 abort_if_not_equal 6
		setstate alliscoresquare6 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set7
	{
		globalaccum 1 abort_if_not_equal 7
		setstate alliscoresquare7 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare8 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set8
	{
		globalaccum 1 abort_if_not_equal 8
		setstate alliscoresquare8 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare9 invisible
	}

trigger alli_set9
	{
		globalaccum 1 abort_if_not_equal 9
		setstate alliscoresquare9 default // Show digit
		setstate alliscoresquare0 invisible // Hide digits
		setstate alliscoresquare1 invisible
		setstate alliscoresquare2 invisible
		setstate alliscoresquare3 invisible
		setstate alliscoresquare4 invisible
		setstate alliscoresquare5 invisible
		setstate alliscoresquare6 invisible
		setstate alliscoresquare7 invisible
		setstate alliscoresquare8 invisible
	}

trigger alli_set_the_score10
{
		trigger game_manager alli_set00
		trigger game_manager alli_set10
		trigger game_manager alli_set20
		trigger game_manager alli_set30
		trigger game_manager alli_set40
		trigger game_manager alli_set50
		trigger game_manager alli_set60
		trigger game_manager alli_set70
		trigger game_manager alli_set80
		trigger game_manager alli_set90
}

trigger alli_set00
	{
		globalaccum 3 abort_if_not_equal 0
		setstate alliscoresquare00 default // Show digit
		setstate alliscoresquare10 invisible // Hide digits
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set10
	{
		globalaccum 3 abort_if_not_equal 1
		setstate alliscoresquare10 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set20
	{
		globalaccum 3 abort_if_not_equal 2
		setstate alliscoresquare20 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set30
	{
		globalaccum 3 abort_if_not_equal 3
		setstate alliscoresquare30 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set40
	{
		globalaccum 3 abort_if_not_equal 4
		setstate alliscoresquare40 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set50
	{
		globalaccum 3 abort_if_not_equal 5
		setstate alliscoresquare50 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set60
	{
		globalaccum 3 abort_if_not_equal 6
		setstate alliscoresquare60 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set70
	{
		globalaccum 3 abort_if_not_equal 7
		setstate alliscoresquare70 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare80 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set80
	{
		globalaccum 3 abort_if_not_equal 8
		setstate alliscoresquare80 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare90 invisible
	}

trigger alli_set90
	{
		globalaccum 3 abort_if_not_equal 9
		setstate alliscoresquare90 default // Show digit
		setstate alliscoresquare00 invisible // Hide digits
		setstate alliscoresquare10 invisible
		setstate alliscoresquare20 invisible
		setstate alliscoresquare30 invisible
		setstate alliscoresquare40 invisible
		setstate alliscoresquare50 invisible
		setstate alliscoresquare60 invisible
		setstate alliscoresquare70 invisible
		setstate alliscoresquare80 invisible
	}

// --- End allied counter ---

}

This is just the stuff for the counting, so no basic stuff…
in the gamemanager spawn I put more globals, but this is just to show my idea, so I only show up to 99

As for the trigger, I was thinking trigger_multiples in the door, so only 1 person can cross it at a time, and for every person that crosses it the counter counts 1.

yes then the problem of selfkilling, and people joining is there, but I’ll just write that on the score board :stuck_out_tongue:


(Flippy) #7

Do you know that you can only use 9 or 10 globalaccums in your script?
I see you using 8 already, and you say you’ve got a few more in the game_manager…


(stealth6) #8

I knew there was a limit, but didn’t know how many, but I have no more in the game manage apart from the ones here.

question was will it work?

Cause i don’t really feel like filling in 9999 points for allies 1 by one and then 9999 by axis :o

EDIT: BTW when I am making a frag map it justs consists of a few houses, objects to hide behind, so I don’t think I’ll need the globalaccums then, or am I wrong?


(S14Y3R) #9

how about instead of counting to 9999, just count to 1 or 2 hundred and have a huge trophy pop out of the ground, like 5 in total, but the team with 3 of 5 wins, or something simple :slight_smile:

for a one way walkthrough texture, you could use a single sided patch mesh. you can walk through the back, and not go back through, could be made transparent so you can see what’s coming out.

What gets called by the spawns in the script? Is it a specific line, like trigger player spawn_axis/allied, or, do the spawns activate the target_script_triggers run key? That would be a much better way of keeping count, instead of walking through a trigger_multiple(although that’d work too, just differently)


(stealth6) #10

[quote=“S14Y3R”]
how about instead of counting to 9999, just count to 1 or 2 hundred and have a huge trophy pop out of the ground, like 5 in total, but the team with 3 of 5 wins, or something simple :slight_smile:

for a one way walkthrough texture, you could use a single sided patch mesh. you can walk through the back, and not go back through, could be made transparent so you can see what’s coming out.

What gets called by the spawns in the script? Is it a specific line, like trigger player spawn_axis/allied, or, do the spawns activate the target_script_triggers run key? That would be a much better way of keeping count, instead of walking through a trigger_multiple(although that’d work too, just differently)[/quote]

thanks for the help, in the map I am making at the moment the aim of the game is to reach the top of the map, and then capture and hold a flag for X minutes.
So the kill board is just supplementary, and since 1 person can make a estimated guess of 200 kills (probably less), and there are lots of people in the server 9999 should cover it.

as for the target_script_trigger, I will try it, but I don’t exactlyknow how to do it, but it would indeed make it easier.

and will also try the mesh, although what I was looking for is that the axis spawn is behind a red window, to protect them, but from the point they pass it, they cant get back. and then a blue 1 for allies.

EDIT: the simple patch thingy worked! But it doesn’t stop bullets… maybe got a solution for this? I tried applying clip but that didn’t do the trick.

EDIT2: Maybe a alterentity of a clip brush that is activated are deactviated whensomebody jumps through