Home   Help Search Login Register  

Author Topic: HintC and Arrays  (Read 1109 times)

0 Members and 1 Guest are viewing this topic.

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
HintC and Arrays
« on: 18 Feb 2010, 18:22:27 »
How would I be able to HintC format etc. so that it displayed every unit in an array - or rather, their name in text - and their x and y co-ordinates.

I'm trying to create a system whereby I can determine all the units that have died over the course of the mission and the positions of those still alive.

 :dunno:
Snarling creature, lurking in the background, still writing in .sqs

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: HintC and Arrays
« Reply #1 on: 19 Feb 2010, 19:56:02 »
Not entirely sure how to approach your overall problem. But in response to your question, use a script like this. Place a trigger with name triggername, set to anybody present, and run the script with parameters:

Code: [Select]
[list triggername] exec "hintclist.sqs"
Made with care by RKurtzDmitriyev productions. No animal testing was used.  :P

Code: [Select]
_a = _this select 0

_c = 0

_n = 0

_d = ""

titleText ["Generating list...(this may take a moment)","plain"]

#loop

~0.1

_o = _a select _c

_s = format ["%1 \n %2\n", _o, [getpos _o select 0, getpos _o select 1]]

_d = _d + _s

_c = _c + 1

_n = _n + 1

? _n < 13 && (_c < count _a): goto "loop"

hintC format ["%1", _d]

? _c == count _a : titleText ["done","plain"]; exit

titleText ["Generating next page","plain"]

_d = ""

_n = 0

goto "loop"
« Last Edit: 19 Feb 2010, 19:57:55 by RKurtzDmitriyev »
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
Re: HintC and Arrays
« Reply #2 on: 14 Mar 2010, 23:33:12 »
Sorry to be a while in replying, and thx for the script.
I'm not sure how to use it but I'll figure that out some other time.

Thanks,
     Lone-Wolf  :cool2:
Snarling creature, lurking in the background, still writing in .sqs