Jump to content
JediHutch61

Scripting Help, Please

Recommended Posts

If you give some details i should be able to help you but I need to know exactly what your trying to do, and exactly what the problem is.

I took the map and scripts from Shane's mod and adjusted the units accordingly. Then I copied and pasted the PD and AMR parts of the Firestation script in to my FS script, did the same with firestation start script. Then tried to run it. I got and fixed the first error, then I got a second error that I can not find. I've attached my logfile. Thanks

Logfile.zip

Link to comment
Share on other sites

?(_LAFireStation8fc37): Error: Unexpected EOF G__exec_statement()

?(_LAFireStation8fc37): FILE:mod:/scripts/game/command/LAFireStation.script8fc37 LINE:2616

?(_LAFireStation8fc37): Advice: You may need to use +P or -p option

?Could not load script mod:/scripts/game/command/LAFireStation.script

?(_LAFireStation8fc37): Error: Symbol this_definitely_is_an_evil_workaround_4709_2303 is not defined in current scope

?(_LAFireStation8fc37): FILE: LINE:0

?(_LAFireStation8fc37): !!!Dictionary position rewound...

?(_LAFireStation8fc37): !!!Error recovered!!!

!WARNING: global listener object is still registered! Unregister listener before destroying object!

Post the Firestation script again(the updated one) or use something like Notepad2 to view the file. It will number each line so you can easily find line 2616.

Perhaps it would be better to use shanes scripts and simply comment out the parts you dont need(by comment out I mean do this: /* where you want to start skipping code and add */ where you want the game to start reading the script again.

Link to comment
Share on other sites

Post the Firestation script again(the updated one) or use something like Notepad2 to view the file. It will number each line so you can easily find line 2616.

Perhaps it would be better to use shanes scripts and simply comment out the parts you dont need(by comment out I mean do this: /* where you want to start skipping code and add */ where you want the game to start reading the script again.

The firestation script I posted was the only one I have made, no update. I just put in to the Notepad 2 as suggested and there is no line 2616.

Link to comment
Share on other sites

Ahh now were getting some where. First, sorry i misunderstood the earlier post. Secondly, ok in that case, open the file in notepad2 again. When you click a { or a } bracket it will light up red. You may need to look slowly and carefully but another red bracket will show up to. This shows you where the statement opens and closes. You either have an extra bracket, or your missing one. Let me know if that helps any.

Link to comment
Share on other sites

You got

if (v.GetVehicleType() == OBJ_EMS)
{
for(int i=0; i < gate08a.GetNumObjects(); i++)
{
GameObject *gate = gate08a.GetObject(i);
Actor *vogate = vogate08a.GetActor(i);
Vector GateSnd = gate->GetPosition();
if (gate->GetUserData() == 0)
{
gate->SetUserData(1);
gate->SetAnimation(ANI_OPEN);
vogate->SetVirtualObjectTerrain(VOSET_ROAD);
Audio::PlaySample3D(SND_GATE, GateSnd);
} else
{
gate->SetUserData(0);
gate->SetAnimation(ANI_CLOSE);
vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
Audio::PlaySample3D(SND_GATE, GateSnd);
}
}
}

When you need to have

if (StrCompare(v.GetPrototypeFileName(), OBJ_EMS) ==0)
{
for(int i=0; i < gate08a.GetNumObjects(); i++)
{
GameObject *gate = gate08a.GetObject(i);
Actor *vogate = vogate08a.GetActor(i);
Vector GateSnd = gate->GetPosition();
if (gate->GetUserData() == 0)
{
gate->SetUserData(1);
gate->SetAnimation(ANI_OPEN);
vogate->SetVirtualObjectTerrain(VOSET_ROAD);
Audio::PlaySample3D(SND_GATE, GateSnd);
} else
{
gate->SetUserData(0);
gate->SetAnimation(ANI_CLOSE);
vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);
Audio::PlaySample3D(SND_GATE, GateSnd);
}
}
}

I fixed it for you, see attachment

Link to comment
Share on other sites

Those are the end of the script, how ever there is no line 2616, the error has gone away but the game get loaded and atfer 3-5 min it drops to desk top. I have attached thelog file. Log2.zip

First, please attach the log file directly. Txt files are allowed so its much easier then having to extract a zip to get to the log file to help you. ;)

Secondly at a glance the log file isnt reporting script errors, and I have looked over Craigs script pretty extensively and cant find any missing brackets, but no promises! Occasionally I have problems like this after making changes, and I find it helps to run ccleaner, so that may be worth a shot.

Link to comment
Share on other sites

Guest Francis

When it gives an error on a line that doesn't exists, it's because a curly brace is missing somewhere so it cannot execute the code without looping all the time, which means it will crash so the game prevents it.

Link to comment
Share on other sites

Well I'm not getting an error any more. I followed 4x4's advica, and have run ccleaner 4 time and cleared up every thing it recommended, just tried both the icon and the game routes to launch the mod, and it failed. I got the normal power up for the game right to the black screen for loading the mod, then it collaspes. the game crashes to desk top. any ideas? Here is the log file, logfile.txt

Link to comment
Share on other sites

Make sure you run the cleaner and registry cleaner. I think the registry cleaner is the important thing because I notice an e4p file extension pop up.

Also, for the sake of testing, pop back in an unedited script for the one(s) you modified and check to see if the mod loads then.

Link to comment
Share on other sites

Make sure you run the cleaner and registry cleaner. I think the registry cleaner is the important thing because I notice an e4p file extension pop up.

Also, for the sake of testing, pop back in an unedited script for the one(s) you modified and check to see if the mod loads then.

Ok I got the game to run, after updating to v2.0.2, and redoing my scripts, to get Station 1 full no changes, Station 2 EMS supervisor, Engine 1, and HES. I gave up on the PD modding till I can get my game back together. Game loaded up from desktop and opens up normal til I got to the freeplay map.

I have zipped the log file, the firestation script, the firestationstart script and the tofirestation script as these are the only ones I changed. I also included a screen of the problem.

incident.zip

Link to comment
Share on other sites

Ok it looks to me like you altered the VO names in the editor and butchered them. It is the only reasonable explanation for whats going on here. Becuase for example you have:

ActorList l16 = Game::GetActors(VO_AMBULANCE04);
for(int i=0; i < l13.GetNumActors(); i++)
{
Vector Ambulance04 = l13.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_EMS, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Ambulance04);
m.SetRotation(gate8);
m.UpdatePlacement();
m.SetMaxPassengers(2);
m.SetMaxTransports(1);
m.SetSpeed(12.0f);
m.PushActionWait(ACTION_NEWLIST, 4.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 8, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);
}

Which is 100% correct. So the only explanation for this spawning in FS1 is you altered the VO location.

Plus you have this:

ActorList l10 = Game::GetActors(VO_LADDER);
for(int i=0; i < l9.GetNumActors(); i++)
{
Vector Ladder = l9.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_LADDER, UNNAMED); //NOTE: Change OBJ_LADDER to OBJ_TILLER to replace the tower with the tiller
m.EnableBlueLights(false);
m.SetPosition(Ladder);
m.SetRotation(gate3);
m.UpdatePlacement();
m.SetMaxPassengers(6);
m.SetSpeed(9.0f);
m.PushActionWait(ACTION_NEWLIST, 1.4f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 3, false);
}

This is the correct code for the ladder to spawn in its normal bay, but you managed to make it spawn behind the ambulance.

You seem to have your scripting right so there no other explanation. Start fresh but use these scripts with an unaltered map file freeplay.e4m or dfreeplay.e4m.

Link to comment
Share on other sites

Load the editor and make sure you have the file in the prototypes listed, and make sure its not missing the model file.

Also, it shouldnt be but check freeplaybase.xml or freeplaybase_d.xml for em4deluxe, and make sure its not disabled.

The files are all there and it is not disabled in the freeplaybase.xml

Link to comment
Share on other sites

Had a feeling you would say that..did you download the LA Mod before or after the recent forum problems? If it was after, then I would try clearing your cache and cookies and try again. If it still fails, then I suspect the file got corrupt during the crash/restore, and the only thing that will fix it is if Hoppah or some one can upload a new copy of the LA Mod to the server.

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