Jump to content

Recommended Posts

Ok, now I have stations in my map. But the problem now is, when i send them to the base, they often park backwards in the station. With the rear at the gate. But I want them with the front at the gate.

How can i fix this? I work with the scripts of the Vierheim modification

Link to comment
Share on other sites

Ok, now I have stations in my map. But the problem now is, when i send them to the base, they often park backwards in the station. With the rear at the gate. But I want them with the front at the gate.

How can i fix this? I work with the scripts of the Vierheim modification

It has to do with VO's (virtural objects) and the order the numbers are. I haven't had much experience with them so I can't help with fixing it but I know that it has to do with the VO's.

Link to comment
Share on other sites

I don't think this will work, because for my ladder truck it was already 0 and 1 in the front and 2 and 3 in the back. But he still parks not as it must be.

This is the go to station command script.

//////////////////////////////////////////////////////////////////////////////////////////////////////////

// Freeplay GoHome - Script v1.3 //

// ******************************************** //

// //

// 1.0| VCmdFPGoHome //

// | //

// 2.0| DUMMYFPGoHome //

// | | //

// | |- Zu parkende Einheiten sind durch Kommentarzeilen (//) in Bloecke unterteilt. //

// | | Jeder von ihnen kann entfernt werden, ohne dass das Skript unbrauchbar wird. //

// | | //

// | '- Die mit einem Stern (*) markierten Zeilen muessen angepasst werden. //

// | Mehrere Sterne bedeuten lediglich mehrere Anpassungen in einer Zeile. //

// | Dabei gilt: Zwei Sterne entsprechen zwei Anpassungen, und so weiter. //

// | //

// 2.1| DUMMYFPGoHomePersonal //

// | //

// |- Ausgangspunkte fuer das Fahrzeug-Personal sind durch Kommentarzeilen (//) in Bloecke //

// | unterteilt. Jeder von ihnen kann entfernt werden, ohne dass das Skript unbrauchbar //

// | wird. //

// | //

// '- Die mit einem Stern (*) markierten Zeilen muessen angepasst werden. //

// Mehrere Sterne bedeuten lediglich mehrere Anpassungen in einer Zeile. //

// Dabei gilt: Zwei Sterne entsprechen zwei Anpassungen, und so weiter. //

// //

// _____________________ //

// a-rescue und Magicman mŸssen in der Readme genannt werden & der Kommentar muss so bleiben. //

// Sonst freie Nutzung fŸr alle. //

//////////////////////////////////////////////////////////////////////////////////////////////////////////

const char IMG_ICON[] = "gohome"; // Name des Icons

const char IMG_CURSOR[] = "gohome"; // Name des Cursors

const char DUMMYGOHOME_V[] = "DUMMYFPGoHome2";

const char DUMMYGOHOME_P[] = "DUMMYFPGoHomePersonal2";

const char COMMANDABLE_TRUE[] = "DUMMYSetCommandableTrue";

const char COMMANDABLE_FALSE[] = "DUMMYSetCommandableFalse";

const char FREEFORALERT_TRUE[] = "DUMMYFPSetFreeForAlertTrue";

const char FREEFORALERT_FALSE[] = "DUMMYFPSetFreeForAlertFalse";

const char FREEFORALERT[] = "DUMMYFPIsFreeForAlert";

const char INBASE_TRUE[] = "DUMMYFPSetInBaseTrue";

const char INBASE_FALSE[] = "DUMMYFPSetInBaseFalse";

const char INBASE[] = "DUMMYFPIsInBase";

int DummyGroup = "90";

// 1.0

object VCmdFPGoHome2 : CommandScript

{

VCmdFPGoHome2()

{

SetIcon(IMG_ICON);

SetCursor(IMG_CURSOR);

SetValidTargets(ACTOR_VEHICLE);

SetRestrictions(RESTRICT_SELFEXECUTE);

SetPossibleCallers(ACTOR_VEHICLE);

SetGroupID(DummyGroup);

}

bool CheckGroupVisibility(GameObject *Caller)

{

/*Vehicle v(Caller);

PersonList pl = v.GetPassengers();

PersonList tl = v.GetTransports();

if (pl.GetNumPersons() > 0 && tl.GetNumPersons() == 0)

return true;

return false;*/

return true;

}

bool CheckPossible(GameObject *Caller)

{

if (!Caller->IsValid() || Caller->GetType() != ACTOR_VEHICLE)

return false;

Vehicle v(Caller);

PersonList pl = v.GetPassengers();

PersonList tl = v.GetTransports();

if (v.IsValid() && !v.IsDestroyed() /*&& pl.GetNumPersons() > 0*/ && tl.GetNumPersons() == 0)

{

return true;

}

return false;

}

bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID)

{

if (!Caller->IsValid() || !Target->IsValid() || Caller->GetID() != Target->GetID())

return false;

Vehicle v(Caller);

PersonList pl = v.GetPassengers();

PersonList tl = v.GetTransports();

if (v.IsValid() && !v.IsDestroyed() /*&& pl.GetNumPersons() > 0*/ && tl.GetNumPersons() == 0)

{

return true;

}

return false;

}

void PushActions(GameObject *Caller, Actor *Target, int childID)

{

Vehicle v(Caller);

if (v.IsBlueLightEnabled())

{

v.EnableBlueLights(false);

}

if (v.HasCommand("DUMMYHasSiren"))

{

Game::ExecuteCommand("DUMMYDisableSiren", &v, &v);

}

if (v.HasCommand("DUMMYHasAutoSiren"))

{

Game::ExecuteCommand("VCmdAutoSirenOff", &v, &v);

}

v.PushActionWait(ACTION_NEWLIST, 0.1);

v.PushActionExecuteCommand(ACTION_APPEND, DUMMYGOHOME_V , &v, 1, true);

}

};

// 2.0

object DUMMYFPGoHome2 : CommandScript

{

DUMMYFPGoHome2()

{

SetGroupID(DummyGroup);

}

bool CheckPossible(GameObject *Caller)

{

return true;

}

bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID)

{

return true;

}

void PushActions(GameObject *Caller, Actor *Target, int childID)

{

Vehicle v(Caller);

ActorList al;

Actor parkplatz;

Vector parkpos;

Vector anfahrpos;

Vector wendepos;

PersonList pl;

/////// gwtv /////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (v.HasName("snip")) // Fahrzeugname

{

al=Game::GetActors("snip_p"); // Name des virtuellen Objektes wo das Fahrzeug parken soll

anfahrpos = Vector (0,-300,0); // siehe parken.txt

wendepos = Vector (0,-600,0); // siehe parken.txt

}

else

/////// kdowv /////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (v.HasName("amb1")) // Fahrzeugname

{

al=Game::GetActors("amb1_p"); // Name des virtuellen Objektes wo das Fahrzeug parken soll

anfahrpos = Vector (0,-300,0); // siehe parken.txt

wendepos = Vector (0,-600,0); // siehe parken.txt

}

else

/////// lfv /////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (v.HasName("a1")) // Fahrzeugname

{

al=Game::GetActors("a1_p"); // Name des virtuellen Objektes wo das Fahrzeug parken soll

anfahrpos = Vector (0,-300,0); // siehe parken.txt

wendepos = Vector (0,-600,0); // siehe parken.txt

}

else

/////// dlkv /////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (v.HasName("l1")) // Fahrzeugname

{

al=Game::GetActors("l1_p"); // Name des virtuellen Objektes wo das Fahrzeug parken soll

anfahrpos = Vector (0,-300,0); // siehe parken.txt

wendepos = Vector (0,-600,0); // siehe parken.txt

}

else

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Weitere Fahrzeugblšcke hier einfŸgen

{

Mission::PlayHint("Fuer dieses Fahrzeug konnte kein Parkplatz gefunden werden! Code 1");

return;

}

if(al.GetNumActors() > 0)

{

parkplatz = *al.GetActor(0);

parkpos = parkplatz.GetPosition();

}

else

{

Mission::PlayHint("Fuer dieses Fahrzeug konnte kein Parkplatz gefunden werden! Code 2");

return;

}

bool vready = true;

if (v.GetNumPassengers() == 0)

{

vready = false;

}

pl = v.GetPassengers();

for(int i=0; i < pl.GetNumPersons(); i++)

{

if (pl.GetPerson(i)->GetLife() < pl.GetPerson(i)->GetMaxLife())

{

vready = false;

}

}

if (vready)

{

Game::ExecuteCommand(FREEFORALERT_TRUE, &v, &v);

}

Game::FindFreePosition(&v, parkpos);

v.PushActionmove(ACTION_NEWLIST, parkpos+anfahrpos);

v.PushActionTurnTo(ACTION_APPEND, parkpos+wendepos);

v.PushActionmove(ACTION_APPEND, parkpos);

v.PushActionExecuteCommand(ACTION_APPEND, INBASE_TRUE, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_FALSE, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, DUMMYGOHOME_P, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, "CloseGate", Caller, 1, true);

}

};

// 2.1

object DUMMYFPGoHomePersonal2 : CommandScript

{

DUMMYFPGoHomePersonal2()

{

SetGroupID(DummyGroup);

}

bool CheckPossible(GameObject *Caller)

{

return true;

}

bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID)

{

return true;

}

void PushActions(GameObject *Caller, Actor *Target, int childID)

{

Vehicle v(Caller);

PersonList pl = v.GetPassengers();

for(int i=0; i < pl.GetNumPersons(); i++)

{

Person p = pl.GetPerson(i);

v.RemovePassenger(&p);

p.PushActionDeleteOwner(ACTION_NEWLIST);

}

}

};

What do they mean with:

Game::FindFreePosition(&v, parkpos);

v.PushActionmove(ACTION_NEWLIST, parkpos+anfahrpos);

v.PushActionTurnTo(ACTION_APPEND, parkpos+wendepos);

v.PushActionmove(ACTION_APPEND, parkpos);

v.PushActionExecuteCommand(ACTION_APPEND, INBASE_TRUE, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, COMMANDABLE_FALSE, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, DUMMYGOHOME_P, &v, 1, true);

v.PushActionExecuteCommand(ACTION_APPEND, "CloseGate", Caller, 1, true);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...