As the dude says, some new ■■■■ has come to light man. I’ve searched the forums and I don’t see this information previously discussed.
I was doing a mass search of the extracted bigs to refresh my memory on some stuff, as I often do while modding, when I noticed something odd in hgn_shipyard
setTargetBox(NewShipType, 0, -0.1,-0.7, -0.9, 0.55, 0.5, 0.82) setTargetBox(NewShipType, 1, -0.9,-0.001, -0.9, 0.005, 0.6, -0.55)
Now I had assumed that setTargetBox as just syntactic sugar for the old targetRandomPoint values, and that setting them direct still worked. Testing that idea doesn’t seem to have panned out for me. Further I had assumed that the second parameter for this function was an bool, seeing this I started to suspect it was an index. And that has some exciting implications.
I mocked up the boxes described there in wings and it somewhat describes the main body and engine block of the shipyard, which made me pretty confident of my guess.
We can have multiple targetboxes on the same model now. I tested it, it works. Ships even seem to pick the nearest box for their targeting, which is great for huge ships.
All the ions are attacking one ship that bears four boxes, very small ones at the forward corners of the ship’s bounding box. The ion cannons quite merrily attack their nearest one, and many start firing way earlier than a preceding test when I only had two target boxes.
Any mod with ships that don’t fill out their bounding box very well and have complex shapes that aren’t well handled by a single target box should really look into this, I think it has the potential to really smooth out some rough combat cases. Fulcrum definitely has a lot of ships that can benefit from this development.
My experimentation strongly suggests that the parameters are as follows
setTargetBox(ship, iIndex, fXmin, fYmin, fZmin, fXmax, fYmax, fZmax)
with the dimensions ranging from -1 to 1 proportional to the bounding box of the collision mesh, as with the old settings.
The game will only permit eight target boxes and ignore any past that point. Should be sufficient for most ships out there.
Also if you’ve got ship files still using the old settings instead of setTargetBox() I don’t think they work anymore.
Now I’ve got to go fix up some ship files…