Jump to content
ShaneGreen

Firestation.script error

Recommended Posts

Hi all,

Have been working on some modifications to the Firestation.script to allow additional spawn points.

Unfortunately I am encountering a problem that I have been unable to solve so far, so I thought I might see if anyone else can locate the problem.

I have been looking at this script for so long now, I probably would not see it if it jumped up and waved at me.

When trying to load the freeplay I am receiving the following message;

(_LAFIRESTATION 901463): Error: Symbol Spawn is not defined in current scope.

when I select retry, I receive the following information

FILE: mod:/scripts/game/command/LAFireStation.script 901463 LINE: 1845

If any of you scripting gurus can see where I may have gone wrong - I would greatly appreciate your suggestions.

Look forward to hearing your thoughts

Thankyou all, take care

Shane

object DummyCallCrew : CommandScript
{
DummyCallCrew()
{
SetGroupID(DummyGroup);
}</P> <P> bool CheckGroupVisibility(GameObject *Caller)
{
return false;
}

bool CheckPossible(GameObject *Caller)
{
return false;
} </P> <P> void PushActions(GameObject *Caller, Actor *Target, int ChildID)
{
Vehicle v(Caller);
if(v.IsCollidingWithVirtualObject(VO_SQUAD01))
{
ActorList l1 = Game::GetActors(VO_SPAWN01);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();</P> <P> GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION);
for(int i=0; i < l2.GetNumObjects(); i++)
{
GameObject *obj = l2.GetObject(i);
if (!obj->IsSpecialLightEnabled())
{
obj->EnableSpecialLights(true);
obj->PushActionWait(ACTION_NEWLIST, 16.0f);
obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
Vector AlarmSnd = obj->GetPosition();
int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
obj->SetUserData(soundID);
obj->AttachSound(soundID);
}
}
}
else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))
{
ActorList l1 = Game::GetActors(VO_SPAWN03);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();</P> <P> GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);
for(int i=0; i < l2.GetNumObjects(); i++)
{
GameObject *obj = l2.GetObject(i);
if (!obj->IsSpecialLightEnabled())
{
obj->EnableSpecialLights(true);
obj->PushActionWait(ACTION_NEWLIST, 16.0f);
obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);
Vector AlarmSnd = obj->GetPosition();
int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);
obj->SetUserData(soundID);
obj->AttachSound(soundID);
}
}
}
else if(v.IsCollidingWithVirtualObject(VO_SQUAD01R))
{
ActorList l1 = Game::GetActors(VO_SPAWN01R);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}
else if(v.IsCollidingWithVirtualObject(VO_SQUAD02R))
{
ActorList l1 = Game::GetActors(VO_SPAWN02R);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}
else if(v.IsCollidingWithVirtualObject(VO_SQUADAMR))
{
ActorList l1 = Game::GetActors(VO_SPAWNAMR);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}
else if(v.IsCollidingWithVirtualObject(VO_SQUADPARK))
{
ActorList l1 = Game::GetActors(VO_SPAWNPARK);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}
else
{
ActorList l1 = Game::GetActors(VO_SPAWN02);
if(l1.GetNumActors() > 0)
Vector Spawn = l1.GetActor(0)->GetPosition();
}</P> <P> PersonList passengers = v.GetPassengers();
if (ChildID == 1)
{
Person p = Game::CreatePerson(OBJ_PM, UNNAMED);
p.SetEquipment(EQUIP_EMERGENCY_CASE);
}
else if (ChildID == 2)
Person p = Game::CreatePerson(OBJ_PM_STRETCHER, UNNAMED);
else if (ChildID == 3)
Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);
else if (ChildID == 4)
Person p = Game::CreatePerson(OBJ_CHIEF, UNNAMED);
else if (ChildID == 5)
Person p = Game::CreatePerson(OBJ_HAZMAT, UNNAMED);
else if (ChildID == 6)
Person p = Game::CreatePerson(OBJ_USARFF, UNNAMED);
else if (ChildID == 7)
Person p = Game::CreatePerson(OBJ_EMT_STRETCHER, UNNAMED);
else if (ChildID == 8)
Person p = Game::CreatePerson(OBJ_CAPTAIN, UNNAMED);
else if (ChildID == 9)
Person p = Game::CreatePerson(OBJ_EMS_CAPTAIN, UNNAMED);
else if (ChildID == 10)
Person p = Game::CreatePerson(OBJ_LAPD_OFFICER, UNNAMED);
else if (ChildID == 11)
Person p = Game::CreatePerson(OBJ_CHP_OFFICER, UNNAMED);
else if (ChildID == 12)
Person p = Game::CreatePerson(OBJ_NEGOTIATOR, UNNAMED);
else if (ChildID == 13)
Person p = Game::CreatePerson(OBJ_SCOUT, UNNAMED);
else if (ChildID == 14)
Person p = Game::CreatePerson(OBJ_SWAT_OFFICER, UNNAMED);
else if (ChildID == 15)
Person p = Game::CreatePerson(OBJ_BOMB_SQUAD, UNNAMED);
else
return;</P> <P> p.SetUpgradeLevel(3);
Game::FindFreePosition(&p, Spawn, 250); ** this is line 1845 mentioned in error message **
p.SetPosition(Spawn);
p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);
p.PushActionTurnTo(ACTION_APPEND, &v);
p.PushActionEnterCar(ACTION_APPEND, &v);
}
};

EDIT: Guess what ............ the problem jumped up and waved at me :sporty:

I am now getting a error on the LAFirestation.script that states that I have too many "}" ..... hmm

Link to comment
Share on other sites

   SetGroupID(DummyGroup);
}</P> <P> bool CheckGroupVisibility(GameObject *Caller)
{

What's up with the </P> and <p>? Scripting is not html.

Hi Hoppah,

Not sure what happened there. That is not in the script, it must have appeared when I added the script into the code tags for posting :nixweiss:

That problem has resolved, but I am now receiving an error message saying FireStation.script has too many "}".

I will upload the whole script if anyone has time for a look - that would be great.

LAFireStation.zip

Take care

Shane

Link to comment
Share on other sites

Well i checked it, and for what its worth, all your brackets are opened and closed.

What line does ti reference in the error?

Have you tried notepad2? I think this will help you find the problem easily.

Thanks for having a look.

The error is indicated in LINE 642, but it all looks fine to me. I have been using Notepad 2 but it is giving me nothing.

The error only occurs when I alarm Firestation 1 from control panel, it does not occur when alarming Firestation 2 from control panel.

I have been thinking that it might think there are too many entries under Firestation 1, so I might try moving some to Firestation 2 and see if anything changes.

Will keep you posted.

Take care

Shane

EDIT: Transferred the entries to Firestation 2 and the problem then occurred when Firestation 2 alarmed, not when Firestation 1 alarmed this time ..... hmm

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