Modding, Mission Design, and Coding > Test Builds

SEXP Argument changes via mod.tbl

(1/4) > >>

karajorma:
Here's one that probably will only affect the more advanced FREDders amongst you. The big problem with the way the argument SEXPs work for many FREDders is that the inner and outer loops are the wrong way round. The game will execute each action SEXP for all the valid arguments first and then move on to the next one. Most users are expecting the exact opposite, All of the action SEXPs for each argument and then move on to the next argument.

This build uses a argument in the newly added mod.tbl to switch the loops around. Since this problem only affects the more advanced FREDders usually, here's a little test to show exactly what I mean.

When-argument
-any-of
--Ship 1
--Ship 2
--Ship 3
-true
-modify-variable
--StringVariableName
--<Argument>
-self-destruct
--StringVariableName

Which ship blows up?

Spoiler:Normal builds will blow up Ship 3 because they loop through the modify variable SEXP 3 times and then move on. This build will modify the variable to Ship 1, blow it up and then modify the variable to Ship 2 and then Ship 3.

http://fs2downloads.com/Misc-Downloads/Builds/Mod_Table_SEXP_Build.7z

EDIT : At the moment, mod.tbl only contains a couple of features but the basic idea is to make it the place for all those settings you set once for a mod and then never want to change again.

mjn.mixael:
Seems to work as expected.

Goober5000:
Oh well done.  This will come in handy.

...On second thought, this would be better as an additional sexp.  There are rare instances where one needs the current behavior, and Scroll contains a few of them.  Yet the mod.tbl behavior is preferred in most cases.  Since mod.tbl would affect all sexps in the game without exceptions, could you make a new sexp so that we could have one or the other as needs demand?

Not sure what the new sexp should be called.  For-argument might be a good candidate.

Fury:

--- Quote from: karajorma on January 11, 2012, 07:42:14 pm ---EDIT : At the moment, mod.tbl only contains a couple of features but the basic idea is to make it the place for all those settings you set once for a mod and then never want to change again.

--- End quote ---
Not in trunk yet apparently? Regardless, this has to be the best thing since porn.

karajorma:

--- Quote from: Goober5000 on January 26, 2012, 12:11:40 pm ---Oh well done.  This will come in handy.

...On second thought, this would be better as an additional sexp.  There are rare instances where one needs the current behavior, and Scroll contains a few of them.  Yet the mod.tbl behavior is preferred in most cases.  Since mod.tbl would affect all sexps in the game without exceptions, could you make a new sexp so that we could have one or the other as needs demand?

Not sure what the new sexp should be called.  For-argument might be a good candidate.

--- End quote ---

No, this really shouldn't be a SEXP. If you turn on the feature every single SEXP in the mission will suddenly start being processed the other way. It would be horribly confusing.

Basically this was designed the exactly the way it was so that a FREDder could set it once for a mod and then forget about it forever. Since it's just there to fix a design flaw but maintain backwards compatibility there's no reason it should be swapped around.

But what the **** are you doing that actually needs the old way round to work?

Navigation

[0] Message Index

[#] Next page

Go to full version