Jump to content
Guest Stukov

Need some help

Recommended Posts

Guest Stukov

I've been playing with some of the LA Mod scripts in order to set up a "sub station" in another part of the freeplay map. The issue I'm having is within the "ToFireStation" script by Hoppah, though I've heavily modified it for use at this sub station. At one point, I had it working except that once the truck returned to the sub station, it turned around and headed for the main station. I believe I fixed it, but now I get a "Parenthesis does not match" error and I can't figure it out. It gives my LINE 177 which is the closing brackets at the end of this block of code:

object DummyCheckParkedSub : CommandScript
{
DummyCheckParkedSub()
{
SetGroupID(DummyGroup);
}

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

void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
bool ParkinglotFound = false;

Vehicle v(Caller);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
{
GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
v.PushActionReturnToBase(ACTION_NEWLIST);
return;
} else
{
ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_ENGINE05);
v.AssignCommand(DUMMY_ENGINE);
}
}

if(ParkinglotFound)
{
if(l1.GetNumActors() > 0)
Vector Park = l1.GetActor(0)->GetPosition();
if (v.HasCommand(DUMMY_VCALLED))
v.RemoveCommand(DUMMY_VCALLED);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02)
{
v.PushActionWait(ACTION_APPEND, 10.0f);
v.PushActionMove(ACTION_APPEND, Park);
v.PushActionWait(ACTION_APPEND, 0.5f);
PersonList passengers = v.GetPassengers();
if (passengers.GetNumPersons() > 0)
v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_SUBSTATION, Caller, 0, false);
}
}
}
};

I figured since this doesn't seem to be specific to the code itself but rather a syntax error, someone could help? I've checked and double checked all the brackets and parenthesis, but I can't figure it out. And like I said, this code is credited to Hoppah and his LA Mod. I simply modified it for my personal use.

Link to comment
Share on other sites

I've been playing with some of the LA Mod scripts in order to set up a "sub station" in another part of the freeplay map. The issue I'm having is within the "ToFireStation" script by Hoppah, though I've heavily modified it for use at this sub station. At one point, I had it working except that once the truck returned to the sub station, it turned around and headed for the main station. I believe I fixed it, but now I get a "Parenthesis does not match" error and I can't figure it out. It gives my LINE 177 which is the closing brackets at the end of this block of code:


object DummyCheckParkedSub : CommandScript
{
DummyCheckParkedSub()
{
SetGroupID(DummyGroup);
}

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

void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
bool ParkinglotFound = false;

Vehicle v(Caller);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
{
GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
v.PushActionReturnToBase(ACTION_NEWLIST);
return;
} else
{
ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_ENGINE05);
v.AssignCommand(DUMMY_ENGINE);
}
}

if(ParkinglotFound)
{
if(l1.GetNumActors() > 0)
Vector Park = l1.GetActor(0)->GetPosition();
if (v.HasCommand(DUMMY_VCALLED))
v.RemoveCommand(DUMMY_VCALLED);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02)
{
v.PushActionWait(ACTION_APPEND, 10.0f);
v.PushActionMove(ACTION_APPEND, Park);
v.PushActionWait(ACTION_APPEND, 0.5f);
PersonList passengers = v.GetPassengers();
if (passengers.GetNumPersons() > 0)
v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_SUBSTATION, Caller, 0, false);
}
}
}
};

I figured since this doesn't seem to be specific to the code itself but rather a syntax error, someone could help? I've checked and double checked all the brackets and parenthesis, but I can't figure it out. And like I said, this code is credited to Hoppah and his LA Mod. I simply modified it for my personal use.

see if it do :)

object DummyCheckParkedSub : CommandScript
{
DummyCheckParkedSub()
{
SetGroupID(DummyGroup);
}

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

void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
bool ParkinglotFound = false;

Vehicle v(Caller);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)
{
GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
v.PushActionReturnToBase(ACTION_NEWLIST);
return;
}
else
{
ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_ENGINE05);
v.AssignCommand(DUMMY_ENGINE);
}
}

if(ParkinglotFound)
{
if(l1.GetNumActors() > 0)
Vector Park = l1.GetActor(0)->GetPosition();
if (v.HasCommand(DUMMY_VCALLED))
v.RemoveCommand(DUMMY_VCALLED);
if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02)
{
v.PushActionWait(ACTION_APPEND, 10.0f);
v.PushActionMove(ACTION_APPEND, Park);
v.PushActionWait(ACTION_APPEND, 0.5f);
PersonList passengers = v.GetPassengers();
if (passengers.GetNumPersons() > 0)
v.PushActionExecuteCommand(ACTION_APPEND, DUMMY_SUBSTATION, Caller, 0, false);
}
}
};

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...