Author Topic: Special Hits/Explosion refactor build  (Read 1849 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Special Hits/Explosion refactor build
After noticing yet another bug in Mantis 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 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).
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]


Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Special Hits/Explosion refactor build
...pants on head ground retarded...

Fixed.  :)
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays