Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: karajorma on March 04, 2010, 04:27:12 am

Title: Special Hits/Explosion refactor build
Post by: karajorma on March 04, 2010, 04:27:12 am
After noticing yet another bug in Mantis (http://scp.indiegames.us/mantis/view.php?id=2010) to do with Special Explosions/Special Hits I flippantly asked if we could simply refactor the entire system into something that wasn't pants on head retarded.

The more I thought about it the more I liked it. The system the old code had was that Special hits/explosions values were saved into special SEXP variables, the index of this variable is then saved into the ship data. This means that simply setting one special explosion uses up 6 SEXP variables and attempting to set explosions/hits for more than one ship at a time is an exercise in frustration that might result in it working, it leaving useless block variables in the mission file, it failing to work completely except on the first ship in the mission file or it crashing FRED.

Refactoring the code should remove this annoyance and might make it possible to have SEXPs which change a ship's HP, shields or explosions while the mission is running.

Anyway, here's a build (http://fs2downloads.com/Misc-Downloads/Builds/BlockVariableRemovalBuild.7z) that does that.

Users of the FS2 builds should notice no difference whatsoever between this build and a corresponding trunk build without this feature. Users of FRED are strongly advised to back up any mission before loading them into these FRED builds. These builds WILL change the save format of any mission that uses special-hits or special-explosions and once they are changed there is no way to get that data back without a lot of notepad editing.

That said these builds do need testing to ensure that they do work so FREDders are strongly encouraged to do so now before these features hit trunk and are then found to have bugs in them.

NB, it's a minor change but the new Special-hits/explosions editors take their default values from the selected ship (i.e the green one) rather than the first marked ship (i.e the first green or yellow one in the mission file).
Title: Re: Special Hits/Explosion refactor build
Post by: chief1983 on March 04, 2010, 09:56:46 am
...pants on head ground retarded...

Fixed.  :)