'Must be attacked trigger' not always working

Any issues with the XWAU or X-Wing Alliance? Please let us know here!
Post Reply

'Must be attacked trigger' not always working

Blazingfirestorm
Cadet 1st Class
Posts: 213
Joined: Sat Dec 09, 2017 9:39 pm

Post by Blazingfirestorm » Tue Oct 12, 2021 9:07 pm

I don't know if this issue already has a topic open but what I've found is if the player attacks with lasers, dumb fire warheads or lock-on warheads the status of attacked is applied and when an A.I fires lasers or dumb hire warheads it is also applied, however it seems that the only thing that doesn't give a craft the status of attacked is when an a A.I locks-on and fires a warhead

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Wed Oct 13, 2021 7:25 am

I think TG designed it so it's only lasers that trigger that logic condition for a FG in the mission file. But if I'm wrong, sometimes game won't execute a condition because it's processing too many things concurrently and could miss it in the queue in lieu of more important events and logic statements. I have better luck with using this logic statement.... "At least one of FG Gold must be attacked or Never True". Or perhaps "100% of FG Gold must be at 75% shields" or Never True. I don't think A.I. craft dumbfire any warhead types, the mission files have them programmed to attack FG X or IFF etc. Only player can.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

Blazingfirestorm
Cadet 1st Class
Posts: 213
Joined: Sat Dec 09, 2017 9:39 pm

Post by Blazingfirestorm » Wed Oct 13, 2021 8:24 am

Unfortunately they is no conditions must be at 75% shields there is be at 75% hull.

Blazingfirestorm
Cadet 1st Class
Posts: 213
Joined: Sat Dec 09, 2017 9:39 pm

Post by Blazingfirestorm » Fri Oct 15, 2021 1:49 pm

Update: with the help of a discord user name random starfighter he was able to fix this with a hook and now the 'must be attack' trigger does work

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Oct 16, 2021 12:34 am

Nice.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

batuta
Cadet 1st Class
Posts: 155
Joined: Tue Oct 13, 2020 1:34 pm

Post by batuta » Sat Oct 16, 2021 11:04 am

hey could you tell me how to fix this and what hook is that please?

Random Starfighter
Cadet 3rd Class
Posts: 34
Joined: Tue Oct 13, 2020 12:14 am

Post by Random Starfighter » Sat Oct 16, 2021 6:43 pm

An explanation of what's happening:

Typically the "attacked" trigger statistic is updated whenever a projectile impacts something that is not already flagged as having been attacked. The problem is that when an AI craft pulls the trigger to fire a warhead, it preemptively flags the object as attacked. So when the warhead (or cannons) finally impact the target, it sees that it's already "attacked" and doesn't update the trigger statistic.

The solution is to remove the instruction responsible for flagging the attacked state when the warhead is fired, which allows the projectile impact to handle the trigger statistics as expected.

Here's the XwaExePatcher entry for it:

Code: Select all

  <Patch Name="Prevent AI warhead firing from blocking the 'attacked' trigger condition">
    <Item Offset="A76E2" From="C684198C01000001" To="9090909090909090" />
  </Patch>

Blazingfirestorm
Cadet 1st Class
Posts: 213
Joined: Sat Dec 09, 2017 9:39 pm

Post by Blazingfirestorm » Sat Oct 16, 2021 8:36 pm

Thanks Random

batuta
Cadet 1st Class
Posts: 155
Joined: Tue Oct 13, 2020 1:34 pm

Post by batuta » Sat Oct 16, 2021 11:00 pm

Yes, thank you very much.

Post Reply