Nexus Modding > Scripting
GetDockPoint not working?
Arparso:
--- Quote from: The Old Dragon ---What exactly are you defining with the E.ship variable here? The strikecraft or the mothership?
--- End quote ---
That's defined by the Arriving event: E.ship is the docking boat, E.location is the targetted capital ship. Of course, E.ship:dockTarget and E.location should be the same ship (they are in my case) and E.ship:dockPoint supposedly gives the index of the targetted docking point of the capital ship. Those values seem to be correct as I already had 8 fighters docking simultaneously and each reported a different index. But when feeding this index into the GetDockPoint command, I get the error about having given an invalid index. One of those "WTF?"-moments, it seems...
EndTraffic broken? I don't think so. I remember it having worked before, although the already active traffic will continue to fly to their destination. EndTraffic just stops any new shuttle launches. At least that's what I remember... haven't used it in quite a while.
The Old Dragon:
Done some experimenting and got a slightly different result.
By setting the 'index' value to zero, I got the a debug result of '(0,0,0)'. Not sure if it helps or exactly what this result means, but at least it isn't an error message.
As for the 'EndTraffic', I've not used it for a long time either, I just remember it not appearing to respond when I last did.
Arparso:
--- Quote from: The Old Dragon ---By setting the 'index' value to zero, I got the a debug result of '(0,0,0)'. Not sure if it helps or exactly what this result means, but at least it isn't an error message.
--- End quote ---
That's what I got, too, but it's hardly a valid value for one of the ship's docking points.
To elaborate further: you can get the total amount of docking points (including breaching points) using NumDockPoints(ship). This returns "18" for my shipclass. Now if I enter any index from 1 to 18 into the GetDockPoint(ship, index, outer) command, I'll get the error message about an invalid index. If I enter anything else like 0 or 5000, I'll get a result of 0. I also tried -999999, which surprisingly gives me SOME vector, but it's clearly nonsense and not an actual docking point... maybe it's in some way related to the real docking points, but I don't know how :(
Mularac:
I looked at all the missions written by Mithis, but couldn't find any reference to this command... perhaps it was never used, hence never tested and that's why it's bugged..
Arparso:
It is used... kinda... in universetacticssubroutinesmovie_camera.ini:
--- Code: ---// csonak dokkolasanak figyelese
// Launching, vagy Arriving eventbol erdemes meghiVNi
// (ha a csonak epp nem dokkol, nem tortenik semmi)
// E.ship - a hajo
// E.target - a celobjektum
// E.time - az odamozgas ideje
RULE event MovieCam_Docking
condition E.ship:docking>=2
:action
LocalEvent(MovieCam_StopAll, 0);
CamGoRound(0);
din := GetDockPoint(E.ship:docktarget, E.ship:dockpoint, 0);
dout := GetDockPoint(E.ship:docktarget, E.ship:dockpoint, 1);
dir := VNorm(vsub(dout,din));
pos := VAdd(dout, VMul(3*E.ship:radius,dir));
pos := VAdd(pos, VMul(2*E.ship:radius,VRandomOrth(dir)));
CamLocate(E.ship:docktarget,2,pos,0,0, E.ship:docktarget,2,din,0,0, 0, E.time);
:end
END
--- End code ---
That's more or less the same as my code, though, and a simple copy&paste test yielded the same results. This particular event (MovieCam_Docking) also isn't being used anywhere... guess they planned to use it at some point and later canned the idea. Or they used it once somewhere, when that command was still working as intended, but removed or rewrote that script afterwards before some other change broke the GetDockPoint command.
Damn, I really needed that to get the proper effect :(
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version