Home   Help Search Login Register  

Author Topic: Detecting if all units are destroyed how?  (Read 1491 times)

0 Members and 3 Guests are viewing this topic.

Bad Maniac

  • Guest
Detecting if all units are destroyed how?
« on: 20 Apr 2003, 02:44:46 »
Ok, I have this basic Co-Op mission idea, where I want to have a bunch of hangars, with empty scud trucks in, and the players of course have to go in and destroy them with satchel charges.

Since they will be EMPTY trucks, they can't be grouped. How can I detect if ALL the trucks have been destroyed? So that I can end the mission.

_hammy_

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #1 on: 20 Apr 2003, 03:57:21 »
1) Name all of your scuds
2) Place a game logic near every scud
3) in each of the gamelogic's init fields, type the following:
this moveindriver scud
4) group all of the scuds (or gamelogics?) together

and that should do it.  I know there is a easier way, but i forgot how to do it that way.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detecting if all units are destroyed how?
« Reply #2 on: 20 Apr 2003, 09:20:55 »
Name all the trucks.     Put this in the condition field of your end trigger

(not canMove scud1) and (not canMove scud2) etc
Plenty of reviewed ArmA missions for you to play

kingneb

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #3 on: 20 Apr 2003, 21:38:06 »
 ;D
1. Name all of your units in the "name" field for the unit properties.

2. Set up a trigger, you did not mention what the outcome of this detection is, but select it in the "type" list.

3.  In the "condition" field put not (alive "unitarray")

-If you don't know how to do unit arrays, then put (in the "condition" field) not (alive "unitname") and not (alive "unitname").  Keep using the "and" operator until you have set up tests for all of your units.  
-Be sure to omit the quotes when doing the actual thing, what I mean by the quotes is the unit name or array goes in there with out the quote marks.

Bad Maniac

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #4 on: 21 Apr 2003, 01:27:06 »
Right, Ill find out how to make a unit array, Ive seen it in either the faq or the tutorials. once I get it working I'll put it here as reference for others.  8)

Bad Maniac

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #5 on: 23 Apr 2003, 14:43:40 »
I cant find any info on how to set up a unit array, could someone please give me an example or point me to a tutorial, I cant find it on this site.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detecting if all units are destroyed how?
« Reply #6 on: 23 Apr 2003, 16:40:21 »
A unit array is just a list of units.   There are lots of ways of creating one, of which the easiest is just to write it.

[unit1, unit2]

is a unit array.    Don't get bogged down in arrays here, that is not the problem.    

However, if you have an array, you need to use command that take arrays.   For example, alive takes a unit, not an array.   So you would need to use the commands count or forEach.

In this case, given that the number of scuds can't be that many, forget arrays and just write out the list of units.   There is unlikely to be any advantage to using an array anyway.
Plenty of reviewed ArmA missions for you to play

Bad Maniac

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #7 on: 23 Apr 2003, 18:56:04 »
I tried:
not (alive scud_1) and not (alive scud_2) and not (alove scud_3);
it doesnt work.
expected unit is the error message.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Detecting if all units are destroyed how?
« Reply #8 on: 23 Apr 2003, 19:35:30 »
Does it work with one scud?

Check again for minor spelling errors etc
Plenty of reviewed ArmA missions for you to play

Bad Maniac

  • Guest
Re:Detecting if all units are destroyed how?
« Reply #9 on: 23 Apr 2003, 21:05:36 »
Or how 'bout I reboot and restart the game...
tried it with the exact same mission, un altered after a reboot, and it works fine... *sigh* Gotta love this game  ::)

Offline Captain Crunch

  • Members
  • *
Re:Detecting if all units are destroyed how?
« Reply #10 on: 23 Apr 2003, 21:48:48 »
Hi Bad Maniac!

   I just made a test and it was successful.

I put three empty scuds on the map and named them respectively Scud01, Scud02 and Scud03.

I created a trigger called deadscuds with "0" in both axis fields. In the "Ativation" field I put "None", in the "Type" field I put "Switch", in the "Condition" field I put:

not (alive Scud01) and not (alive Scud02) and not (alive Scud03)

and finaly, in the "On Activation" field I put:

v1=true

(If You wanna check if Your first trigger works, just type something in the "Effects"/ Tittles / Text of the trigger.

Then simply add a second trigger with:

v1


in the "Conditions" field and in the "Type" put "End#1" or whatever end number You wanna use.

This should work. Hope it helps!
Back to the forest!