Nexus Modding > Scripting
GetDockPoint not working?
Mularac:
Yep. Just tested. Worked great on a campaign mission.
EDIT: I also tested it on the regular modification game view, not the editor, and it worked great, too. Perhaps the error is in the editor, only. Also, odd enough, if you press "ignore" on the editor's error message the command will work great.
Arparso:
Wait, what? 8|
*testing* ... damn, works indeed. I should have looked closer at that MovieCam_Docking code to notice the coordinates being used as relative coordinates in relation to the ship's center. I somehow assumed those were absolute coordinates and thought the EFX popping up next to the center of the map being the bugged GetDockPoint command... but the EFX were just misplaced, because of me interpreting the coordinates wrongly... ;)
Now it works like a charm, at least in the full game... still gives errors in the editor, though.
--- Code: ---RULE event Arriving
:action
// get relative coordinates of targetted docking point
E.dock := GetDockPoint(E.ship:dockTarget, E.ship:dockPoint, 0);
// get rotational information about targetted ship
E.tran := XfRot(E.location:heading, E.location:pitch, E.location:bank);
// rotate relative coordinates of docking point and calculate absolute coordinates
E.pos := VAdd(VXform(E.dock, E.tran), E.ship:dockTarget:position);
// show warp effect
PlayEfx(42, E.ship:radius, pos, 0, 0);
:end
END
--- End code ---
I'm using this to simulate fighters warping in and out of the scene. Nexus doesn't support fighters without having a carrier to launch them from, but only the biggest ships in Freespace actually have hangars. I wanted to have fighter wings also accompany smaller ships like cruisers without their own hangar bay, so I'm abusing the docking/undocking mechanism to look like a warp-in/warp-out effect. Works like a charm, with the missing warp-out effect now finally in place. Thanks, Mularac! :)
... btw, anyone knows how to recognize, if we're in the editor or not just using script commands?
Mularac:
one thing dazzles me, how do you make the fighters appear from the warp or head to the warp position instead from/to the ship's hangar?
BTW: Excellent efx, it's the same as the one in Freespace! how did you do it? Efx and textures? or is it a mesh?
Arparso:
The Aeolus doesn't have a hangar bay, so I put the docking points in free space next to the ship's model. Right now there are 8 docking points, which allow at least two full squadrons to appear at once. Fighters appearing out of nowhere doesn't look right, though, so I use scripting to display an animated texture at the coordinates of the docking point (where the fighters appear or disappear). The texture contains the typical Freespace warp-in effect and is being displayed using a custom EFX and PARTICLE entry, which I insert in the scene using PlayEfx(#, size, x, y, z).
The rule for the warp-out is above, for the warp-in it's just one line of code:
--- Code: ---RULE event Launching
:action
PlayEfx(42, E.ship:radius, E.ship:position, 0, 0);
:end
END
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version