Hello everyone. I'm currently working on a "small" update to my Northview mod among other things I created a precision parking script. First I want to give a huge shout out to Itchboy for helping me with a few road blocks and for some helpful tips. The script works great in my "Testing" mod which is essentially base game + a handful of my created scripts / content. When I transferred and implemented the script over to my Northview Mod (which is a glorified LA Submod), it works just fine...minus this one bug that I can't seem to find the cause for.
Here is the script in action in my testing mod:
Â
Â
Here is a video of the bug: (Ignore the audio...my co-author and I were in discord working on different tasks when this was hastily and angrily recorded by myself).
As you can see the vehicles rotate on their side when the parking marker is set a long distance away. If I keep the marker close to the vehicle, there is no bug. Itchy and myself are at a loss...so I'm punting it out to all of you for ideas on what to check or for ideas as to what the cause is. It's very odd because this doesn't seem to be a problem in my "Testing" Mod and only in my full mod. If I can't figure this out my workaround will be to limit the distance from the vehicle that the parking marker can be placed....but this is far from ideal.
For sure its the rotation of the vehicle that's causing this.Â
Here is the code for the actual parking of the vehicle:
object PrecisionPark_initiate:CommandScript{PrecisionPark_initiate(){SetIcon("initiate");}boolCheckPossible(GameObject*Caller){returntrue;}boolCheckTarget(GameObject*Caller,Actor*Target,int childID){returntrue;}voidPushActions(GameObject*Caller,Actor*Target,int childID){if( childID ==1)//Rotate to park{float r[9];GameObject obj(Target);
obj.GetRotation( r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);Caller->SetRotation( r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);//Caller->SetRotation( &obj ); //Meh...old way of doing it. Itchboy suggested the other setrotation methodCaller->PushActionExecuteCommand( ACTION_NEWLIST,"PrecisionPark_initiate",Target,2,false);//Cleanup}elseif( childID ==2)//Cleanup parking marker{GameObject obj(Target);
obj.PushActionDeleteOwner( ACTION_NEWLIST );}else//Parking Logic start{Vehicle v(&Game::GetActor(Caller->GetUserData()));//Our original vehicle we want to park//Lock Parking marker - Disable modification but allow cancelingCaller->RemoveCommand("PrecisionPark_leftward");Caller->RemoveCommand("PrecisionPark_forward");Caller->RemoveCommand("PrecisionPark_initiate");Caller->RemoveCommand("PrecisionPark_backward");Caller->RemoveCommand("PrecisionPark_rightward");Caller->RemoveCommand("PrecisionPark_move");Caller->RemoveCommand("PrecisionPark_rotClock");Caller->RemoveCommand("PrecisionPark_rotCounterClock");//Reselect our vehicleCaller->Deselect();
v.Select();//Visually show initializationCaller->ChangePrototype( PARKING_MARKER_WAIT );//Set Death Timer...truthfully this is a fallback incase traveling gets interrupted. It causes the marker to delete iteself after a small delay.Caller->PushActionWait( ACTION_NEWLIST,5.0f);Caller->PushActionDeleteOwner( ACTION_APPEND );//Initiate Move
v.PushActionMove( ACTION_NEWLIST,Caller->GetPosition());
v.PushActionExecuteCommand( ACTION_APPEND,"PrecisionPark_initiate",Caller,1,false);//Set Rotation
v.PushActionExecuteCommand( ACTION_APPEND,"PrecisionPark_initiate",Caller,2,false);//Cleanup}}};
Â
My best guess is that it has nothing to do with the code, since it works in the test mod...but has something to do with the models/prototypes of the vehicles, since both of the ones in the example are custom vehicles.
I appreciate any and all feedback. Thanks! http://www.emergency-planet.com/uploads/emoticons/default_grinsevil.gifÂ
Hello everyone. I'm currently working on a "small" update to my Northview mod among other things I created a precision parking script. First I want to give a huge shout out to Itchboy for helping me with a few road blocks and for some helpful tips. The script works great in my "Testing" mod which is essentially base game + a handful of my created scripts / content. When I transferred and implemented the script over to my Northview Mod (which is a glorified LA Submod), it works just fine...minus this one bug that I can't seem to find the cause for.
Here is the script in action in my testing mod:
Â
Â
Here is a video of the bug: (Ignore the audio...my co-author and I were in discord working on different tasks when this was hastily and angrily recorded by myself).
As you can see the vehicles rotate on their side when the parking marker is set a long distance away. If I keep the marker close to the vehicle, there is no bug. Itchy and myself are at a loss...so I'm punting it out to all of you for ideas on what to check or for ideas as to what the cause is. It's very odd because this doesn't seem to be a problem in my "Testing" Mod and only in my full mod. If I can't figure this out my workaround will be to limit the distance from the vehicle that the parking marker can be placed....but this is far from ideal.
For sure its the rotation of the vehicle that's causing this.Â
Here is the code for the actual parking of the vehicle:
Â
My best guess is that it has nothing to do with the code, since it works in the test mod...but has something to do with the models/prototypes of the vehicles, since both of the ones in the example are custom vehicles.
I appreciate any and all feedback. Thanks! http://www.emergency-planet.com/uploads/emoticons/default_grinsevil.gifÂ