OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gruntage on 26 Jul 2009, 23:34:40
-
Hey guys
Is it possible to count the number of kills the player has after a mission? and list them in 'titletext' format? :scratch:
Regards,
Gruntage
-
In the OFPEC spirit of pointing towards the answers without actually spelling them out (to promote learning), here's the pseudo-method:
- a trigger, covering the whole island, thislist
- an init.sqs command adding a killed eventhandler to each loon on a given side
- a global variable, changed by the eventhandler
- the titletext, utilising the format command
That should be enough to activate your Sherlock Holmes mode ;)
-
Hey guys
I cant seem to be able to total up the number of kills the player has at the end of a mission ???
_victima = _this select 0
_teammate = _this select 1
?_teammate != player:exit
kills = kills + 1
hint format ["%1 kill(s)!", kills]
exit
This script is called from an eventhandler in the init field of every enemy soldier. When the player kills an enemy a hint comes up telling the player how many kills he has.
But I cant seem to have the number of kills display at the end of the mission.
Plz can some1 help me :confused:
Thanx in advance
Gruntage
-
Unless you are desperate for a paddling from bedges, you shouldn't open three threads for the same question. This thread can be merged with your original question (http://www.ofpec.com/forum/index.php?topic=33838.0) and your first solution (http://www.ofpec.com/forum/index.php?topic=33850.0).
Using the search term "kill counter" in the first place would have turned up Kendo's Casualty Reports (http://www.ofpec.com/forum/index.php?topic=32417.0).
To have the number displayed, edit the 'End' trigger for the mission. Give it a timeout of a couple of seconds, eg. 3,3,3 and enter something like the following in the Activation linetitletext [format ["%1 kills", west_casualties], "plain", 1]Replace west-casualties with whatever variable you are using for the counting.
As suggested by bedges, you could have found an example of this use of the format (http://www.ofpec.com/COMREF/index.php?action=details&id=141&game=All) command in the COMREF.
-
Thanx for the help guys :D