OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: StonedSoldier on 26 May 2004, 15:21:04

Title: Team Score
Post by: StonedSoldier on 26 May 2004, 15:21:04
how would i go about making a script that would show the scores of all the men in my group, i would like it displayed in a hint box that looks like this,

Scores

Bobby Bruning : 3
James Pound : 1
Adam Shillingsburg : 0
Ryan Carriera : 6

thankx
Title: Re:Team Score
Post by: Dubieman on 26 May 2004, 18:40:04
Well I'd imagine that a score script for each guy is needed and then one titletext script that brings everything together.
Title: Re:Team Score
Post by: General Barron on 26 May 2004, 20:34:43
Use the format (http://www.ofpec.com/editors/comref.php?letter=F#format) command.

Example:

hint format ["Player score: %1", _playerScore]
Title: Re:Team Score
Post by: StonedSoldier on 26 May 2004, 22:10:38
thankx guys, i know how to use the format command, i was just wondering if there was a easy way to do what i want......i foresee me having to do a heck of a lot of scripting
Title: Re:Team Score
Post by: General Barron on 27 May 2004, 04:07:28
No, the only 'big scripting' you will have to do is the part where you give 'score' to the units in the group (you do know that the "score" command only works on players, right?). Otherwise, you just use the 'format' command, and the 'name' command, and you are all set, display-wise:

hint format["SCORES\n%1: %2\n%3: %4", name unit1, SCORE_1, name unit2, SCORE_2]

And so on. I don't see where the big deal is... ???
Title: Re:Team Score
Post by: StonedSoldier on 27 May 2004, 09:42:33
i had written the script slighty easier,

having one varible brought together to make a single string,

_score1 = format ["%1 %2", name man, score man]

i made it nice a pretty only to find that the score command only works for human players like you stated and CPU players,

do you know if there is a way to calculate a non-human players kills??  :gunman: