Modding, Mission Design, and Coding > The FRED Workshop

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

<< < (3/5) > >>

General Battuta:
Changing the outermost 'true' to "has-arrived-delay <argument>" makes the entire event stop evaluating? Even though the ships are present at mission start?? I'm confused

General Battuta:
If I change the outermost "when" to "not is ship-stealthy <argument>", which should always return true:

The moment one of the ships in the argument list dies, the inner check (actually an is-ship-class, not in-mission) breaks for all ships of the same class.

So:


--- Code: ---When-argument (Battuta, Karajorma, Phantom Hoover)
—not is-ship-stealthy(argument)
—when
——is-class(argument) = Poster
——do-something(argument)
--- End code ---

This will break for all ships in the argument list the moment one of those ships is destroyed (which changes is-class to NAN_FOREVER).

Did I, uh, correctly execute the question?

General Battuta:

--- Quote from: General Battuta on November 29, 2020, 11:02:49 am ---Changing the outermost 'true' to "has-arrived-delay <argument>" makes the entire event stop evaluating? Even though the ships are present at mission start?? I'm confused

--- End quote ---

I'm guessing ships present at mission start haven't actually 'arrived'?

Further test, if I do


--- Code: ---When-argument (Battuta, Karajorma, Phantom Hoover)
—not is-disarmed-delay(argument)
—when
——is-class(argument) = Poster
——do-something(argument)
--- End code ---

If I destroy any of the ships in the argument list, the event breaks for all ships of the class. is-class is short circuiting to NAN_FOREVER for the whole argument list, I think.

Goober5000:
Short-circuiting is the correct behavior.  The when-argument sexp is designed to complete like any normal event once it finds itself in a state where it can be short-circuited.  If short-circuiting is not desired, then every-time should be used.

AdmiralRalwood:

--- Quote from: Goober5000 on November 29, 2020, 02:40:05 pm ---Short-circuiting is the correct behavior.  The when-argument sexp is designed to complete like any normal event once it finds itself in a state where it can be short-circuited.  If short-circuiting is not desired, then every-time should be used.

--- End quote ---
The when-argument isn't short-circuiting; the when inside the when-argument is short-circuiting.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version