Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: NeonShivan on October 23, 2014, 09:53:28 pm
-
For a mission I am attempting to replicate (to the best of my ability, which isn't much) the effects of ESM from the Ace Combat series in Freespace. Seeing as my skills as a mission designer are, mediocre at best I am having a bit of trouble getting it to properly work.
So far my idea was to try to get the events set up as:
If player gets within X range of (for sake of arguement we'll say "ESM Test") ESM Test, the ESM effects take hold.
and once the player exits the range, the effects are lifted.
And these would repeat every time the player enters and exits the field.
Problem is, what I've attempted to do was something quite silly:
(http://i.imgur.com/1g5IKAh.png)
While this is my current set up, initially the ESM Uplink event was set to "every-time" instead of "every-time-arguement"
When set to "every-time" with a trigger count, the event would constantly repeat despite exiting the range.
With this set up, the event would only trigger once due to "invalidate arguement" (Well, it was there... under the "ESM Uplink event")
Now to put an end to this wall of text: How would I go about replicating this effect properly using FRED.
-
I would need to actually see the trigger for both events in order to advise what is wrong with what you currently have. At the moment I can only see the any-of and <= SEXPs and not what is inside them.
That said, I can see some possible causes already. Why are you using every-time (or every-time-argument) for this one? Personally I'd use a when-argument and a trigger count. Set the length of the interval to the minimum time you want the ESM effect to last. Set the number of triggers to a very high number.
I've not played Ace Combat so I'd need to know what ESM is to offer more useful advice than that.
-
http://acecombat.wikia.com/wiki/Electronic_Support_Measures
How ESM works in a nutshell
(http://i.imgur.com/vCOMgdL.png)
Here's what inside the events
Originally "invalidate-argument" was under the first event, not the last one.
-
Why does the second event use when if the first one uses every-time-argument? What's the repeat count for the when event? If they don't match, you can see why the event to turn ESM off wouldn't trigger more than once. As soon as the mission starts (assuming the ship starts more than 4km from the ESM Test object) the last SEXP will trigger repeatedly until it runs out of triggers.
One better way to do this is to also set a variable and test for that as well as distance. Create a variable called "ESM Active" and set to 0 by default then make sure that it is set to 1 whenever the ESM is turned on.
when
- and
-- <
--- distance
---- Alpha 1
---- ESM Test
--- 4000
-- =
--- ESM_Active[0]
--- 0
- Modify_variable
-- ESM Test
-- 1
... All the turn on ESM stuff
when
- and
-- >=
--- distance
---- Alpha 1
---- ESM Test
--- 4000
-- =
--- ESM_Active[0]
--- 1
- Modify_variable
-- ESM Test
-- 0
... All the turn off ESM stuff
---
Give both events a high trigger count and suitably short interval time and that should work perfectly for you.
-
Thank you very much Karajorma this works perfectly.