Home   Help Search Login Register  

Author Topic: How do i do this.....  (Read 1504 times)

0 Members and 1 Guest are viewing this topic.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
How do i do this.....
« 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
« Last Edit: 31 Jul 2009, 11:47:18 by bedges »
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: How do i do this.....
« Reply #1 on: 27 Jul 2009, 00:16:03 »
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 ;)

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: How do i do this.....
« Reply #2 on: 30 Jul 2009, 12:30:16 »
Hey guys

I cant seem to be able to total up the number of kills the player has at the end of a mission  ???

Code: [Select]
_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
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Walter_E_Kurtz

  • Guest
Re: How do i do this.....
« Reply #3 on: 31 Jul 2009, 01:56:35 »
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 and your first solution.

Using the search term "kill counter" in the first place would have turned up Kendo's Casualty Reports.

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 line
Code: [Select]
titletext [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 command in the COMREF.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: How do i do this..... (SOLVED)
« Reply #4 on: 31 Jul 2009, 11:11:33 »
Thanx for the help guys  :D
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba