Home   Help Search Login Register  

Author Topic: Unit Status Wrong  (Read 970 times)

0 Members and 1 Guest are viewing this topic.

Offline Kronzky

  • Members
  • *
    • My OFP/VBS Scripts/Missions/Addons
Unit Status Wrong
« on: 02 Sep 2003, 22:44:39 »
During the startup scene of my mission I am going through a loop to constantly reset the damage of my units to zero, so the player arrives with a complete group (there is some enemy fire going on during that time).

Everything works fine (everybody arrives intact), except that the status of some of the units show them as injured  (red icon). If I ask them to report their status via the command menu, the visible status is reset to the proper color, and all they report will be their location.

I don't know if there's a proper way of avoiding this problem, but if not I'm wondering if I could just have them all issue a report status via script, so that is visible status would be corrected. (I'd do it in acctime 4, so I'd be quiet).

So - basically what I'm looking for is a scriptable alternative to hitting All - Report - Status.

Or, of course, a way of avoiding this dilemma in the first place...

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Unit Status Wrong
« Reply #1 on: 03 Sep 2003, 00:22:48 »
try unjoining them and then rejoining them.

So if your group is named "group1" you could do these lines.

Code: [Select]
enableradio false
~1
_units = units group1
_leader = leader group1
{[_x] join grpnull} foreach _units
{[_x] join _leader} foreach _units
enableradio true

...this might not work at all, but give it a shot.
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.

Offline Kronzky

  • Members
  • *
    • My OFP/VBS Scripts/Missions/Addons
Re:Unit Status Wrong
« Reply #2 on: 03 Sep 2003, 03:20:15 »
...this might not work at all, but give it a shot.

Hey - Great idea!
However did you come up with that?!

I had to modify it a little bit, to suppress some messages, and to make it a bit faster. (It seems that using an array instead of a foreach for the join command is a bit faster.)
This is what I ended up using, and it did exactly what I needed (If you are moving at the time it kicks in, you will see a brief time acceleration, but I guess that's the lesser evil - rather than having the wrong health status show up.)

Code: [Select]
setaccTime 4.0
_units = units one0
[one1,one2,one3,one4,one5,one6,one7,one8,one9] join grpnull
~1
[one1,one2,one3,one4,one5,one6,one7,one8,one9] join one0
~10
setaccTime 1.0
(one0 is the leader; and one1-one9 are the group members.)

Offline toadlife

  • OFPEC Old Skool
  • Former Staff
  • ****
  • Official OFP Editing Center Toad
    • toadlife.net
Re:Unit Status Wrong
« Reply #3 on: 03 Sep 2003, 03:31:16 »

Glad it worked.

BTW...

_units = units one0   <---you dont need this line
[one1,one2,one3,one4,one5,one6,one7,one8,one9] join grpnull
~1
[one1,one2,one3,one4,one5,one6,one7,one8,one9] join one0
~10
setaccTime 1.0
"Whenever you want information on the 'net, don't ask a question; just post a wrong answer." -- Cancer Omega.