Modding, Mission Design, and Coding > The FRED Workshop

How do I invalidate arguments for ships that have left the mission?

<< < (2/5) > >>

AdmiralRalwood:
I'm more worried about the performance implications of flushing the entire tree every evaluation than I am about breaking backwards compatibility.

karajorma:
Give me a simple case where I can see this behaviour. I'm still kind of lost as to why it's an issue.

General Battuta:
Event repeating once every second (via high trigger count) that accepts a list of posters and, if they are in the mission, does something.


--- Code: ---When-argument (Battuta, Karajorma, Phantom Hoover)
—true
—when
——is-in-mission(argument) = true
——do-something(argument)
--- End code ---

If Battuta leaves, is-in-mission returns NAN_FOREVER (since Battuta is gone) and gets stuck there: it also returns NAN_FOREVER for Karajorma and Phantom Hoover even if they are still in the mission.

However, this works:


--- Code: ---When-argument (Battuta, Karajorma, Phantom Hoover)
—is-in-mission(argument) = true
—do-something(argument)
--- End code ---

Because the outermost 'when' gets 'flushed' (whatever this means, coder speak) when it moves to a new argument.


karajorma:
Just out of interest, what happens if you have


--- Code: ---When-argument (Battuta, Karajorma, Phantom Hoover)
—any-sexp-that-will-always-return-true(argument)
—when
——is-in-mission(argument) = true
——do-something(argument)

--- End code ---

Cause I suspect this might be a consequence of using an inner conditional when the outer one is doing nothing with the argument.

General Battuta:
Oh, interesting. I'll check...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version