Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Lt Right behind you! on October 22, 2017, 01:37:35 pm

Title: Cancelling out an event that is already in action
Post by: Lt Right behind you! on October 22, 2017, 01:37:35 pm
Hello,
Long time freespace player, occasional FREDer and frequent viewer of this forum needs help, so much so i have finally joined to seek answers.

My question is about disabling an event that is currently active in my mission. I have made a red alert warning sign in gimp to use in my mission to add a bit of character, the event used to display it flashing is simple:

Red alert!
>when
>Intruder fires
>show-subtitle-image
RED ALERT
100
0
true
false
0
0
3000

With a repeat count of 9999, trigger count 9999 and interval time of 2. Makes it flash nicely but how can i disable it after the battle ends? I want the player to be able to press a button that cancels the red alert event, is this possible?

Thank you for reading.


Title: Re: Cancelling out an event that is already in action
Post by: Mito [PL] on October 22, 2017, 01:51:33 pm
Let me suggest: (dunno how to write it properly)

when
>and
>>not -> is-event-true (STAHP THE SUBTITLE)
>>is-event-true (Intruder fires)
do the proper stuff.
Title: Re: Cancelling out an event that is already in action
Post by: procdrone on October 22, 2017, 03:29:07 pm
MitoPL said it.

Add another variable there, like is event true ->stop red alert

and set the red alert event to trigger true when you press the button.

If you want to make it work multiple times, make the stop button change a variable you created to 0, and make red alert trigger when you set it to 1. (for example, when an enemy arrives)
Title: Re: Cancelling out an event that is already in action
Post by: karajorma on October 23, 2017, 07:53:58 am
BTW for what you're doing there is going to be no difference between a trigger count of 9999 and a repeat count of 9999, so there is no need to do both (In fact it's only ever worth doing both if the trigger count is less than the repeat count).