BSDocking for the plugin
-
BSDocking
right its about there but im stuck at a bit
i seem to have a ploblem with
LaunchPosHook for some reason i cant quit find it
its not puting you next to the docking ship
so i need a bit help
thing is it will be some thing silly i know it is
so a fresh pair of eyes might helpthe rest of the code seems to work fine
oh and warning this aint for beginers lol it is complicated
thats why it got me lolbit of a edit here
if you look at PlayerLaunch //carrier not docked
it returning the docking base coords
when you launch soo the problem must be in
LaunchPosHook -
I’m gonna try this later. In early January, I started trying a similar project, but never managed to figure out how to force a player to launch.
-
i updated the link didnt notice HkIEngine::LaunchPosHook
but i still dont see no call to it in the logs
its like its totaly egnoring it
basicly once thats fixed it should be all working
just a matter of cleaning it up -
Can someone please explain the purpose of LaunchPosHook to me? Thanks.
-
basicly when you undock it position you next to the docking ship insted of the base when you undock
its only used when the docking ship is in the same system as the player undockingtry docking on the docking ship jump a few systems then undock
it isent used then HkBeamInSys is used insted -
Sorry, but that explains how part of your plugin works, not LaunchPosHook.
-
thats what it dose simple all ready explained
basicly pub::SpaceObj::GetLocation(iTargetShip, g_Vlaunch, g_Mlaunch);
gets the docking ships coords
which i tested its geting the correct coords
then once it got them when you undock it usesnamespace HkIEngine { EXPORT bool __stdcall LaunchPosHook(uint iSpaceID, struct CEqObj &p1, Vector &p2, Matrix &p3, int iDock) { if(g_bInPlayerLaunch) { p2 = g_Vlaunch; p3 = g_Mlaunch; } p1.launch_pos(p2,p3,iDock); returncode = SKIPPLUGINS_NOFUNCTIONCALL; // we handled the command, return immediatly } }
p2 and p3 is the position in space when you undock
but for some reason it aint geting called
g_Vlaunch and g_Mlaunch defo have the correct position
i tested that to make sure you can test that doing this
PrintUserCmdText(iClientID, L"x %f",g_Vlaunch.x);
PrintUserCmdText(iClientID, L"y %f",g_Vlaunch.y);
PrintUserCmdText(iClientID, L"z %f",g_Vlaunch.z); -
PrintUserCmdText(iClientID, L"x %f",g_Vlaunch.x);
PrintUserCmdText(iClientID, L"y %f",g_Vlaunch.y);
PrintUserCmdText(iClientID, L"z %f",g_Vlaunch.z);I don’t really understand how that code would work, seeing as it relies on iClientID which LaunchPosHook does not tell you?
-
//carrier not docked
look for thatPrintUserCmdText(iClientID, L"x %f",g_Vlaunch.x);
PrintUserCmdText(iClientID, L"y %f",g_Vlaunch.y);
PrintUserCmdText(iClientID, L"z %f",g_Vlaunch.z);
Server.PlayerLaunch(iShip, iClientID);that is calling the launch process and g_Vlaunch
at that point is loaded with the coords
it should then call LaunchPosHook
basicly it should be called auto in the Server.PlayerLaunch(iShip, iClientID);basicly on load up wee need to replace the original with owers
like i say it aint geting called so its failing -
How is that relevant to my question?
Maybe my understanding of C++ isn’t good enough, but I don’t see iClientID, g_Vlaunch or g_Mlaunch defined anywhere in that block of code you posted in this thread. -
look right at the start you see it up there
Vector g_Vlaunch;
Matrix g_Mlaunch; -
namespace HkIEngine { EXPORT bool __stdcall LaunchPosHook(uint iSpaceID, struct CEqObj &p1, Vector &p2, Matrix &p3, int iDock) { if(g_bInPlayerLaunch) { p2 = g_Vlaunch; p3 = g_Mlaunch; } p1.launch_pos(p2,p3,iDock); returncode = SKIPPLUGINS_NOFUNCTIONCALL; // we handled the command, return immediatly } } ```Sorry, but I could not find it.
-
its used universal by all the functions
if it wasent defined it woudent compile simple
if you stick it in a function it is only used by that
and cant be used ealse wheremaby you want to take a look at 88flak its m0tah code
-
i think kosacid want to mean that this variable are in the GLOBAL DECLARATION section of the code, so you can call it in all the functions.
-
You declared iClientID globally?
ಠ_ಠ
Edit: Well, I found g_iClientID, but not iClientID used for PrintUserCmdText.
-
Don’t know if he do it, it’s just a suggestion, i havn’t look at the code^^
-
thing is i can patch it to use HkBeamInSys
but i want to keep the code original
dont want to mess around with it -
found a error
p_PI->mapHooks.insert(pair<string, int=“”>(“HkIEngine::LaunchPos”, 0));and
EXPORT bool __stdcall LaunchPos(uint iSpaceID, struct CEqObj &p1, Vector &p2, Matrix &p3, int iDock)
still not working though
also updated the link</string,>
-
@ =Alex=
i built that one for you lol think thats what your looking for
redownload and try that
6/19