Jump to content

Recommended Posts

Posted (edited)

Here's what I want to do...

Let's say I have 50 tanks in one group. I want to know when 80% of them have been destroyed... so when 40 are dead. I want to count them down using Triggers, where you would see a message like:

"A tank has been destroyed in the city. 1 dead, 39 more to go"       then,
"A tank has been destroyed in the city. 1 dead, 38 more to go"
"A tank has been destroyed in the city. 1 dead, 37 more to go"       etc.

Is this possible with Triggers?

 

Edited by Miccara
Posted

Played with this (I think I did it correctly), but can't work around the randomness of the kills to determine the correct message. I need an "if" kind of statement. Unless I'm missing your meaning... the message after each kill:

"A tank has been destroyed in the city. 1 dead, 39 more to go"       then,
"A tank has been destroyed in the city. 1 dead, 38 more to go"
"A tank has been destroyed in the city. 1 dead, 37 more to go"       etc.

Because the kills come in any order and I want to display the count left after each kill, I can't see how this can be done with Triggers alone.

Dang.

Posted (edited)
8 hours ago, Miccara said:

Because the kills come in any order and I want to display the count left after each kill, I can't see how this can be done with Triggers alone.

What do you mean by this statement?

Set the flag to decrement with each kill and use it with a switched condition trigger to output the number remaining.  Easiest way is to add a tiny bit of DOSCRIPT:

trigger.action.outText("A tank has been destroyed in the city.  1 dead "..numdeadflag.." more to go") -- where "numdeadflag" is whatever you've called the flag to count the number killed.

 

Depending on whether you have the tanks all in one group or separate groups you might need to play around and see what trigger you need to use to decrement the flag (set it to 40 at mission start).

Re-reading your message, looks like you're tying the MESSAGE to be triggered by the destroyed unit and since you don't know which is going to be #1 destroyed vs #20 destroyed you don't know which number to put in it.  Don't do it that way.  Tie the unit dying to trigger the number dead FLAG to decrement by 1 and then send the generic repeating message using the flag indicate number remaining.  You could include the message script above in each unit trigger if you want, but it will be cleaner if you make it a switched trigger on it's own that goes off each time the flag decrements.

If you can post the mission it would be easier to see what you're trying to do.

Edited by rob10
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...