Home   Help Search Login Register  

Author Topic: creating statistic at the end of mission  (Read 2252 times)

0 Members and 1 Guest are viewing this topic.

juxie

  • Guest
creating statistic at the end of mission
« on: 19 Nov 2004, 23:29:06 »
I have a Firing Range mission in which one soldier will run and shoot target board.
This target board is my own object.
At the end of mission I want to show how many target boards shot by player in the debriefing - statistic.
I notice now is that the game actually keep tracks on its own of how many soldiers is killed.

So how can I do that? Is it possible to make the statistic?

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:creating statistic at the end of mission
« Reply #1 on: 20 Nov 2004, 01:14:59 »
Yup! It sure is. The best way to do it would be with eventhandlers. Check the online com ref here for more info.

Basically, you can set it up so that every time one of these objects is killed/destroyed, a script or line of code is run. In your case, that line of code could just add to a counter of how many have been killed. You could do that by putting this in the init field of each target:

this addeventhandler ["killed", {HIT_TARGS = HIT_TARGS + 1}]

Then in your init.sqs, start the variable HIT_TARGS out at zero:

HIT_TARGS = 0
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:creating statistic at the end of mission
« Reply #2 on: 20 Nov 2004, 02:35:13 »
How do you then show the varible in the debrief, i think is part of the question?  ;)

"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:creating statistic at the end of mission
« Reply #3 on: 20 Nov 2004, 06:49:37 »
Make the targetboard as soldier/game logic, not as static object...
Should not be hard if the targetboard is your own made 'AddOn', just some config changes...

Of course, making the board as an enemy soldier would be preferrable because  'killing' a board of your own side results in ngative score... ::)

But this is just a theory, no guarantees, blah blah blah... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:creating statistic at the end of mission
« Reply #4 on: 20 Nov 2004, 20:47:19 »
How do you then show the varible in the debrief, i think is part of the question?  ;)

Ah! I see. :P I was thinking he was going to display the results in his own custom dialog/cutscene at the end. Didn't realize he was talking about the standard debreif screen.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:creating statistic at the end of mission
« Reply #5 on: 21 Nov 2004, 01:05:39 »
It's all right, GB. It happens to the best of us  ;) :P

yes, I think there was a forum related to this topic, and I think the answer was that:
No, you cannot. But I could be wrong.

some ask LCD  ;D

-Tyger
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:creating statistic at the end of mission
« Reply #6 on: 21 Nov 2004, 09:33:13 »
lol i hear ma name :D

the answer is very simple

u dont mess with what OFP displays in the debreifing unless or makin some mod or somin :P

but u can make it apear b4 that... im sure theres a script 4 that in the mission depot, and i remember i made some modifications 4 it... not sure if its on ma comp tho  :-X

LCD OUT

P.S

Lol @ general barons sig.... "Vampires/Undead pack beta Play Realistic Combat Patrol."
« Last Edit: 21 Nov 2004, 09:40:09 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

bored_onion

  • Guest
Re:creating statistic at the end of mission
« Reply #7 on: 21 Nov 2004, 17:36:58 »
in theory couldnt you create 6 different types of endings depending on what youve done in the missions?
e.g.
end1=3targets destroyed
debrief=well done, you destroyed 3 targets!

its fairly limited but it would add a little bit of versatility...

bored_onion

  • Guest
Re:creating statistic at the end of mission
« Reply #8 on: 21 Nov 2004, 17:40:10 »
a sudden flash of inspiration...

you could do hide and reveal objectives according to how many you have destroyed so it might start:

Destroy targets (0 destroyed)

then you destroy one, so it hides that objective and replaces it with:

Destroy targets (1 destroyed)

and so on


once again i acknowledge its limitations and its still not a statistic per say but better than nothing

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:creating statistic at the end of mission
« Reply #9 on: 21 Nov 2004, 22:27:24 »
declears bored_onision as genius ;D ;)

go and script that ;D

nah seriusly nice idea :thumbsup: i think if theres less than 30 targets it can b nice ting 2 do

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:creating statistic at the end of mission
« Reply #10 on: 22 Nov 2004, 16:30:50 »
hmm, nice idea. Yes, and you wouldn't need the debrief stats.  :D
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:creating statistic at the end of mission
« Reply #11 on: 22 Nov 2004, 20:53:34 »
Or you could use AddRating and Rating : if you addrate 10000 for each target down, you can have quite a fair idea of the minscore, avgscore and maxscore in your description.ext, and you can run a little script at the end of the mishun checking the player's rating, and assign variables according to the range of the score, e.g. :

Code: [Select]
? rating player <50000 && rating player <60000 : end3=true
etc.

AvalanCh3

  • Guest
Re:creating statistic at the end of mission
« Reply #12 on: 23 Nov 2004, 01:52:00 »
thanks for the answer however still i cannot get them to work then i define my object as human, the whole addon just simply disappear. anyone know what happen?

AvalanCh3

  • Guest
Re:creating statistic at the end of mission
« Reply #13 on: 23 Nov 2004, 02:07:20 »
Yup! It sure is. The best way to do it would be with eventhandlers. Check the online com ref here for more info.

Basically, you can set it up so that every time one of these objects is killed/destroyed, a script or line of code is run. In your case, that line of code could just add to a counter of how many have been killed. You could do that by putting this in the init field of each target:

this addeventhandler ["killed", {HIT_TARGS = HIT_TARGS + 1}]

Then in your init.sqs, start the variable HIT_TARGS out at zero:

HIT_TARGS = 0

strangely i tried this method but i didn't work
dummy addeventhandler ["bulleye", {HIT_TARGS = HIT_TARGS + dummyhit}]

dummy is my object
dummyhit is a gobal variable define in my game as integer to track the score.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:creating statistic at the end of mission
« Reply #14 on: 23 Nov 2004, 02:13:24 »
 ::)

There is no EH "bulleye".    Hit the Ed Depot to find the list of EHs that actually exist.

Never[/i] attempt to use a command until you fully understand it.     Copying a forum answer and changing one thing is a quick and easy route to frustration and/or disaster.
Plenty of reviewed ArmA missions for you to play

AvalanCh3

  • Guest
Re:creating statistic at the end of mission
« Reply #15 on: 23 Nov 2004, 09:57:19 »
Eventhandler is trigger when target is hit however in my case i change "killed" to "bulleye"

i understand that he is trying to use the "killed" event to increase the score satistic however it didn't work in my game.

Offline KTottE

  • Former Staff
  • ****
Re:creating statistic at the end of mission
« Reply #16 on: 23 Nov 2004, 10:46:06 »
That's the whole point, there is no eventHandler "bulleye".

ComRef: EventHandlers
More information
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"