Home   Help Search Login Register  

Author Topic: Count  (Read 560 times)

0 Members and 1 Guest are viewing this topic.

netta1234

  • Guest
Count
« on: 11 Apr 2004, 02:41:51 »
hey all i nead another script for my mission

its you must destroy 4 Tanks when you have destroyed 1 it will auto say 3 tanks left it sound a bit n00bish

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Count
« Reply #1 on: 11 Apr 2004, 16:31:38 »
Group the tanks like this in the leaders init field:

tankgroup = group this; tankgroupnumber = 4

And in a trigger type this:

cond: count units tankgroup<tankgroupnumber
on act: hint format ["%1 Tanks Left", count units tankgroup]; tankgroupnumber = tankgroupnumber - 1

Assuming you don't want the tanks in the same group, group the tanks with the trigger and replace the above on act field with:

on act: hint format ["%1 Tanks Left", count units thislist]; tankgroupnumber = tankgroupnumber - 1

Or something like that. My OFP editing skills are a bit rusty so it will probably not work(or there's an easier way)but you get the pic?

:beat: *Gets Shot* :beat:

Kammak

  • Guest
Re:Count
« Reply #2 on: 30 Apr 2004, 22:35:24 »
I think you would prefer the second part to be:


tankgroupnumber = count units tankgroup

or

tankgroupnumber=count units thislist


As you don't know how many tanks were actually killed.

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Count
« Reply #3 on: 01 May 2004, 18:46:44 »
Uh, yea, that would be better. When I wrote the old post I hadn't been editing for a few months. :)

:beat: *Gets Shot* :beat: