Home   Help Search Login Register  

Author Topic: Death counter  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline Lykurgos

  • Members
  • *
  • Member of Decapitator
    • My ftp site (contains few mission etc...)
Death counter
« on: 15 Apr 2003, 16:28:21 »
I have made a mp mission. It is fun to play with my friends, but it is some sort of endless battle (unit respawn, vehicle respawn, ammo crates respawn, etc). I want to make a little sense in this mission by creating a death counter that counts all deaths by each side (EAST & WEST) and when certain amount of time has passed, the results will be shown and the team, that has less deaths, wins.

And the death stats will be also shown every 7 minutes.

Has anyone got an idea how this is done?  ???
You are right of course, to go alone would be crazy. You will be my driver.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Death counter
« Reply #1 on: 16 Apr 2003, 18:12:23 »
well you could use a trigger for every player using the "alive" statement, and have that trigger run a script which increments a variable everytime a player respawns

************************************************************

in the init.sqs type the following line

westcount = 0
public variable "Westcount"

***********************************************************************
then create the following trigger  in the editor

Text: EndGame
Type: End #1
Condition: EndGame
OnActivation: ForceEnd
************************************************************************
Then To set it up for west do the following

1) Name every player, W1, W2, W3 etc etc
and then for each player create the following REPEATING trigger

type:none
condition: alive w1    (Where w1 is a west player)
On activation: []exec "Westcount.sqs"


the trigger would then run something similar to the following

;;westcount.sqs

westcount = westcount +1
westcount publicvariable
?westcount == 10:EndGame=True
PublicVariable "EndGame"
exit

where 10 is the total number of respawns you want to allow for West, eg 9 deaths


to set it up for east, name all the players E1, E2, E3 etc etc ,
create a script called Eastcount.sqs
type the following into the init.sqs
eastcount=0
publicvariable "Eastcount"


hope this helps




basically what happens is
everytime an east or west player respawns, a script will be run which adds 1 to the publicvariables, east or westcount

when the score is, in this case 10, the mission will end

« Last Edit: 16 Apr 2003, 18:13:50 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Lykurgos

  • Members
  • *
  • Member of Decapitator
    • My ftp site (contains few mission etc...)
Re:Death counter
« Reply #2 on: 16 Apr 2003, 20:53:13 »
Thanks a lot, but how do I show the stats every 7 minutes and in the end.
I mean something like this:

titlecut ["STATS: \n West deaths: numberofdeaths \n East deaths: numberofdeaths","PLAIN DOWN"]
You are right of course, to go alone would be crazy. You will be my driver.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Death counter
« Reply #3 on: 18 Apr 2003, 01:43:55 »
~1 = wait 1 second

so wait 7 minutes is ~420

Type the following into the init.sqs

[]exec "Hintstatus,sqs"

and then create the following script

;;hintstatus.sqs
#Start
~420
_westkills = publicvariable "westcount"
_eastkills =  publicvariable "eastcount"
hint format["West have: %1 KIA's\nEast have  %2 KIA's",_westkills, _eastkills]
goto "start"



i may have the syntax slightly wrong here, i always get muddled up with quotation marks
Also u may just need to have the following script

;;hintstatus.sqs
#Start
~420
hint format["West have: %1 KIA's\nEast have  %2 KIA's",westcount, eastcount]
goto "start"



so every 7 minutes you would get the following message in the hintbox
(Added values for example)

West have 6 KIA's
East have 4 KIA's





If you wanted to use the Hintstatus to both display every 7 minutes and at the end.
You could remove the ~420 and simply create another script that ececutes the hintstatus script for you



eg Counter.sqs
#start
~420
[]exec "Hintstaus.sqs"
goto "Start"

and then have the hintstatus sqs have no wait period or a ~0.01 wait period and no loop

You could then have your mission ending trigger execute the hintstatus.sqs



one more tip
If you are going to run this map on a dedivcated server
at the start of the westcount and eastcount.sqs's place the following line

?!(local Server): exit
This would make only the server have control of the westcount and eastcount variables, and would stop clients creating a different value for the variables as is often the case


hope this helps
« Last Edit: 18 Apr 2003, 01:46:08 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Lykurgos

  • Members
  • *
  • Member of Decapitator
    • My ftp site (contains few mission etc...)
Re:Death counter
« Reply #4 on: 19 Apr 2003, 17:44:12 »
Right....
I did what you told and.... it worked!!!
But the counter started at 10 per side, because the team size per team was 10 and the counter activated at "alive" statement. So I fixed the problem by putting "not alive" instead of "alive". But thanks a lot anyway; I couldnÂ't do without your help.  ;)

My mission is almost ready, and itÂ's best mission that I have made so far. ThereÂ's still one * problem: The DoolittleÂ's vehicle respawn doesnÂ't work right!  >:(
You are right of course, to go alone would be crazy. You will be my driver.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Death counter
« Reply #5 on: 20 Apr 2003, 13:48:03 »
silly me forgetting about the first 10 spawns


well i would click on "Solve" for this one and start a fresh thread asking about doolitlles respawn script
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123