Home   Help Search Login Register  

Author Topic: Count units & format  (Read 646 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
Count units & format
« on: 14 Jan 2003, 18:26:01 »
Hi,

I wanna make a status report in a hint or Titletext format.
It informs the player how many causalities they have at the the moment Later I will try it in a dialog, But that's not for now, it looks advanced stuff, those dialogs... :P

The players group (1inf) are with 8 men so I have a trigger activated by radio Alpha (repeated) with

Hint format ["You've lost %1 men", 8 - count units 1inf]

That works great, but when objective 1 is achieved four guys will join the group and than there's a problem with that 8, it have to change to 12. I need a newcount...
I don't want to make a new radiocommand for a the newcount, I want Radio Alpha updated with 12 men in stead of 8, is that possible? I need a script?



Another prob is: I also have a tankdivision (three M1A1, group is named Mechs)

When I use hint format ["We got %1 tanks left, 3 - count units Mechs] the trigger counts the crew (9) and not the tanks. How can I count my tanks in group Mechs?

I tried to be clever and try to use : count units Mechs / 3
...divided by 3 cause there are always 3 crewmembers each tank... The result was 2.6666 tanks and not 3 ???

Why?? ???

Please help!! :-\

maybe it's important, maybe not... just for info ...I use Bremmer's AI_control script. BTW great script Bremmer! ;D












Search or search or search before you ask.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Count units & format
« Reply #1 on: 14 Jan 2003, 19:18:23 »
For the counting of men, use this syntax instead:

hint format["You lost %1 men", "!alive _x" count units 1inf]

that will count the number of not alive (i.e dead ;D) units in the group 1inf. And it will update as necessary.

As to the counting of tanks, well...hm. I've never tried that actually, and I haven't got OFP with me either. But, I'll get back to you later if no-one else figures it out. Maybe try using the command "countType" together with "Tank" somehow...hm. Oh well.

As to the 2.6666, the answer is probably that one of the crewmembers had died (8/3=2.66666). ;D  ::)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Blanco

  • Former Staff
  • ****
Re:Count units & format
« Reply #2 on: 14 Jan 2003, 19:56:18 »
THX for the quick reply Wolfrug!

Ok, I will try it with that syntax, It looks good! ;D

I guess you're right about the 2.666 thing, Maybe I divide the total units of inf1 (8) by 3 in stead of the tanks (9)
It was late and I was tired... ;)

About the tanks :

I already tried "tank" countype but the quotes returns errors..

I need a combination of

Count units Mech and "tank" counttype...but how?

Any1?



« Last Edit: 14 Jan 2003, 20:09:21 by Blanco »
Search or search or search before you ask.

Offline Blanco

  • Former Staff
  • ****
Re:Count units & format
« Reply #3 on: 15 Jan 2003, 20:58:28 »
srry m8, but   hint format["You lost %1 men","!alive _x" count units 1inf],  does not work...

Return is always 0. Even when my group loose some men... :-\

1inf is the groupname (1inf = group this) and not commander's name. is that the prob maybe?
But when I name it,it won't work either cause when he dies...

hint format["You lost %1 men","!alive _x" count units Leader 1inf]

Is that possible?
and how can I count my tanks and not the crew?



« Last Edit: 15 Jan 2003, 21:11:30 by Blanco »
Search or search or search before you ask.

Offline Blanco

  • Former Staff
  • ****
Re:Count units & format
« Reply #4 on: 17 Jan 2003, 22:52:30 »
euh, still need some help here... :-\
Search or search or search before you ask.