Jump to content

Switched condition for AI to report when it takes damage/hits?


moespeeds

Recommended Posts

I'm building a helo escort mission, and I'd like the AI CH47s to report to the escort every time they take a hit, within reason. Meaning when they take a hit, I want them to report, then start a 20 sec timer that must expire before they can report another hit. This way they aren't continuously reporting if they come under heavy fire.

 

I setup a switched trigger where 'aircraft hit' would cause them to report, then turn off a flag

 

I then setup a switched condition where every 20 sec, I would turn the flag back on

 

If I use "continuous" or "switched" for these conditions, it just keeps reporting every 20 sec no matter what, for the whole mission. If I change it to once, they report once then stop. I tried conditions 'unit hits' and 'unit damaged' with the same results.

 

What am I doing wrong here?

 

TIA

Moe "Moespeeds" Colontonio

vVMA 231

http://www.vvma-231.com/

Looking for a serious US based Harrier Squadron? We are recruiting!

 

Link to comment
Share on other sites

They keep reporting because they have been hit, I'm guessing..it's not ON hit but rather that they have been hit. If you're a .lua inclined individual you could probably write an event handler that would take care of this for you.

 

If not, I'd try approaching this with a series of UNIT'S LIFE LESS THAN/UNIT'S LIFE MORE THAN triggers; with a narrow enough value band it should prevent multiple erroneous reports in rapid succession. If you find it's still a problem, you can incorporate your flag plan and the LESS THAN/MORE THAN conditions should prevent multiple instances of the trigger firing simultaneously.

Link to comment
Share on other sites

So in testing, it looks like this doesn't work either. I setup a series of triggers where the unit reports "taking fire" when it gets below 99%, 75%, 40%, and 20%. I put a time since flag of 1 min so they can't report multiple times in rapid succession. It seems that what happens is it saves up the report. So if a unit goes down to 50% with one hit, it will report immediately that it was hit for 99%, then a min later report again for the 75% even though it was not hit again.

Moe "Moespeeds" Colontonio

vVMA 231

http://www.vvma-231.com/

Looking for a serious US based Harrier Squadron? We are recruiting!

 

Link to comment
Share on other sites

As I said, you need to include a LIFE GREATER THAN and LIFE LESS THAN value so that there are mutually exclusive ranges of damage. This will prevent multiple instances of the trigger from filing simultaneously.

 

========================

1 ONCE (Unit 1 hit, NO EVENT)

--------

UNIT'S LIFE LESS THAN (Unit1, 100)

---------

FLAG INCREASE (1,1)

MESSAGE TO ALL ("Unit1 Hit",10)

========================

1 ONCE (Unit 1 80-90 Health, NO EVENT)

---------

UNIT'S LIFE LESS THAN (Unit1, 91)

UNIT'S LIFE MORE THAN (Unit1, 79)

TIME SINCE FLAG (1, 20)

---------

MESSAGE TO ALL ("Unit1 hit again",10)

FLAG INCREASE (1,1)

========================

1 ONCE (Unit 1 70-80 Health, NO EVENT)

---------

UNIT'S LIFE LESS THAN (Unit1, 81)

UNIT'S LIFE MORE THAN (Unit1, 69)

TIME SINCE FLAG (1, 20)

---------

MESSAGE TO ALL ("Unit1 hit again",10)

FLAG INCREASE (1,1)

 

 

 

The trigger only ever fires once because the unit's life will only be between those values once and the flag timer must complete.

If it takes sufficient damage to reach a life level less than one of the percentage triggers prior to the flag timer completing, it will bypass the trigger where the values were not met because not all conditions of the trigger were not met. Make sense?


Edited by feefifofum
Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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