Jump to content
Hoppah

Replacing a vehicle in one of the fire stations

Recommended Posts

Okay, but should I re-install the mod/game?

Nope, no need to do that. Just a minor script issue. When I give you the new scripts, just delete the other 2 I gave you and just copy the new ones in there.

Link to comment
Share on other sites

I have no idea where to start learning.

i want to put mass casualty in FS1 to replace USAR and put HAZMAT in FS1 to replace Tiller How could i do this please??

Ok, here is a tutorial on how to edit the fire station in the LA Mod. The following scripts needed to be edited: LAFireStation, LAFireStationStart, LAToFireStation. You will find these in the LA Mod > Scripts > Game > Command.You may use Notepad but I like using Notepad 2 instead. When finding lines, just go to Find and type in for instance "Hazmat" or "USAR", etc. so you can quickly find the files you need to change.

To replace a single vehicle with another vehicle. In this case, we are going to replace the Hazmat truck with the USAR. JUST A TUTORIAL. So if you want to switch out something else, then just replace the hazmat or usar words to something different (ex: uSAR to HES etc.)

** Deleted due to I don't anyone copying and pasting these codes** I need to be more specific on what you need to change.

Link to comment
Share on other sites

Ok so I have successfully replace the hazmat truck with the brush truck. looking through this post, i can't seem to find a successful way to put the "go back to station" command on the brush truck. the above post has help a lot, but i am still unsure how to do this. thanks.

Go into the editor and load the mod. When it is done loading, a window will appear in the right hand side that should say Prototypes. In that window, click vehicles tab then scroll down to Brush Truck 8 or something like that and click edit. From the new window that pops up go to "Edit Commands or Commands or something like that". Once again, a new window will appear. In that window you will see on the left all available commands and on the right, the commands it currently has. So what you want to do is scroll down on the left side until you find vcmdtofirestation or something along that line and click on it. After that, you will click on the arrow pointing towards the right to allow the command to be added to the brush truck. After that, just click ok and then exit out of the editor ( It should autosave ). Load the mod and see if it's there and works.

Hope I didn't confuse you or anything. If I did, I could just quickly do something like this ... Go into Editor > Load Mod > In Protoypes window, click on vehicles tab > etc. .... if that is much easier to understand.

Link to comment
Share on other sites

Not trying to rush you or anything, but did you forget about me? :D

Nope, your files are right here on my desktop ready to be checked but I've just had no time to mess with them just yet. I was going to tonight but unexpected plans dragged me away from it. I'll try to get to it as soon as possible.

Link to comment
Share on other sites

I successfully added the "return to station" command to the brush truck. I also did some other things.

- Firefighter/EMT & Fire Chief can redirect traffic

- Fire Chief Buggy, Ambulance 1, and 2 can now redirect traffic (something that the ambulances I drive can do).

That's it for now. So because of your instructions, I got messing around with the vehicle traits in the editor. I noticed you can set the number of transports and passengers. Well I changed the transport value from one to two on ambulance 1 and 2. But when I went to go test in game, it didn't seem to work. Also, I wanted to see if I can make the unmarked patrol car carry transports (like the rest of the police vehicles). Like above, I changed the value in the editor, but no results in game.

Any suggestions?

Thanks.

Shark.

Link to comment
Share on other sites

I successfully added the "return to station" command to the brush truck. I also did some other things.

- Firefighter/EMT & Fire Chief can redirect traffic

- Fire Chief Buggy, Ambulance 1, and 2 can now redirect traffic (something that the ambulances I drive can do).

That's it for now. So because of your instructions, I got messing around with the vehicle traits in the editor. I noticed you can set the number of transports and passengers. Well I changed the transport value from one to two on ambulance 1 and 2. But when I went to go test in game, it didn't seem to work. Also, I wanted to see if I can make the unmarked patrol car carry transports (like the rest of the police vehicles). Like above, I changed the value in the editor, but no results in game.

Any suggestions?

Thanks.

Shark.

I think you have to do that in the unit scripts. Go to the LA Mod Folder > Units > Department > Find the unit you want to change and open folder > open the unit xml and you will see like transports / staffing there. Just add the number of transports you want to add.

Kinda going off topic with this but since its a simple question, I answered it. Next time if you would, try to do some searching for other topics like what you want to ask and see if you can find a answer for your question or make a post in that topic so other people will find it much easier.

Link to comment
Share on other sites

Ok, here is a tutorial on how to edit the fire station in the LA Mod. The following scripts needed to be edited: LAFireStation, LAFireStationStart, LAToFireStation. You will find these in the LA Mod > Scripts > Game > Command.You may use Notepad but I like using Notepad 2 instead. When finding lines, just go to Find and type in for instance "Hazmat" or "USAR", etc. so you can quickly find the files you need to change.

To replace a single vehicle with another vehicle. In this case, we are going to replace the Hazmat truck with the USAR. JUST A TUTORIAL. So if you want to switch out something else, then just replace the hazmat or usar words to something different (ex: uSAR to HES etc.)

LAFireStation.script

1. Open your LAFireStation script.

2. Find this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";

3. Replace it with this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";

4. Find this line (Once):

GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Vehicle m = l4.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
}
}

5. Replace with this (Once):

GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Vehicle m = l4.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);
}
}

LAFireStationStart.script

1. Open your LAFireStationStart script.

2. Find this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";

3. Replace it with this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";

4. Find this line (Once):

ActorList l15 = Game::GetActors(VO_HAZMAT);
for(int i=0; i < l15.GetNumActors(); i++)
{
Vector Hazmat = l15.GetActor(0)->GetPosition();
Vehicle m = Game::CreateVehicle(OBJ_HAZMATSQUAD, UNNAMED);
m.EnableBlueLights(false);
m.SetPosition(Hazmat);
m.SetRotation(gate6);
m.UpdatePlacement();
m.SetMaxPassengers(4);
m.SetMaxTransports(2);
m.SetSpeed(8.0f);
m.PushActionWait(ACTION_NEWLIST, 1.0f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 1.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
}
}

5. Replace with this (Once):

GameObjectList l4;

Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);

if(l4.GetNumObjects() > 0)

{

Vehicle m = l4.GetObject(0);

PersonList passengers = m.GetPassengers();

if (passengers.GetNumPersons() == 0)

{

m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false);

m.PushActionWait(ACTION_APPEND, 0.5f);

m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);

m.PushActionWait(ACTION_APPEND, 0.5f);

m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);

}

}

LAToFireStation

1. Open your LAFireStation script.

2. Find this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/hazmat_squad.e4p";

3. Replace it with this line:

const char OBJ_HAZMATSQUAD[] = "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";

4. Find this line (Once):

else if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0)
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
v.PushActionReturnToBase(ACTION_NEWLIST);
return;
} else
{
ActorList l1 = Game::GetActors(VO_FP6);
ActorList l2 = Game::GetActors(VO_TURNTO6);
}
}

5. Replace with this (Once):

else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Mission::PlayHint(HINT_NOSPACE);
v.PushActionReturnToBase(ACTION_NEWLIST);
return;
} else
{
ActorList l1 = Game::GetActors(VO_FP6);
ActorList l2 = Game::GetActors(VO_TURNTO6);
}
}

My code does not match the code your asking me to replace for example you said

. Replace with this (Once):

GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_HAZMAT, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
Vehicle m = l4.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);
}
}

but on my code game object 14 isnt HAZMAT mine is ENGINE04

GameObjectList l14;

Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l14, ACTOR_VEHICLE);

if(l14.GetNumObjects() > 0)

{

Vehicle m = l14.GetObject(0);

PersonList passengers = m.GetPassengers();

if (passengers.GetNumPersons() == 0)

{

COULD SOMEBODY PLEASE DO THE NECESSARY CHANGED TO THE SCRIPTS IF I SEND MY SCRIPTS WILL BE GREATLY APPRECIATED :)

Link to comment
Share on other sites

Okay! ;)

My code does not match the code your asking me to replace for example you said

COULD SOMEBODY PLEASE DO THE NECESSARY CHANGED TO THE SCRIPTS IF I SEND MY SCRIPTS WILL BE GREATLY APPRECIATED :)

@ JimmyTheKid, I will check it out tomorrow or Tuesday. I had plans working on it this weekend but my computer motherboard crashed on me and I just put my old one in today to last until my new one comes mid-week. I've got things to get done but it shouldn't take long to fix your problem.

@Chris, I will tell you what lines to change. It's not that difficult. I think those codes were for someone specific and I didn't realize that when I posted.

Please don't quote long posts with all the codes on it. It's not necessary. Secondly, please don't post in all CAPS.

Link to comment
Share on other sites

@ JimmyTheKid, I will check it out tomorrow or Tuesday. I had plans working on it this weekend but my computer motherboard crashed on me and I just put my old one in today to last until my new one comes mid-week. I've got things to get done but it shouldn't take long to fix your problem.

@Chris, I will tell you what lines to change. It's not that difficult. I think those codes were for someone specific and I didn't realize that when I posted.

Please don't quote long posts with all the codes on it. It's not necessary. Secondly, please don't post in all CAPS.

Thank you and :sorrysign:

Link to comment
Share on other sites

Okay! ;)

Alright, I have been through your scripts and I don't know the problem. If you would, put your firestationstart script in a zip also and upload that because I need that to test the scripts and see what exactly does. I will be able to work on your scripts at least tomorrow night.

Thank you and :sorrysign:

I'll make you a short tutorial tomorrow night since I'll have a little bit of time to work on Jimmy's script and i can help you some too.

Link to comment
Share on other sites

Okay! ;)

Hey Jimmy,

What do you want the USAR replaced with? I replaced the Hazmat to the USAR but I do not know what you want the USAR in FS1 to be.

@ Chris

If this line is not in each script with the rest of the units, then you will need to add this:

const char OBJ_HES[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_equipment_squad.e4p";

To find each line in the scripts, just use find and type USAR. After editing the line, hit find again to make sure there are no more lines you need to change. Do not change any "VO" .. (ex: vo_usar).

In LAFireStation:

Find this line:

if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)

Change to this:

if(StrCompare(v.GetPrototypeFileName(), OBJ_HES) == 0)

** 3 times **

In LAFireStationStart:

Find this line:

Vehicle m = Game::CreateVehicle(OBJ_USAR, UNNAMED);

Change to this:

Vehicle m = Game::CreateVehicle(OBJ_HES, UNNAMED);

** 1 time **

In LAToFireStation:

Find this line:

else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)

Change to this:

else if(StrCompare(v.GetPrototypeFileName(), OBJ_HES) == 0)

** 2 times **

After doing this, go into editor > load mod > add the "tofirestation" command to the heavy equipment squad.

If you want to change the Hazmat to USAR then just replace the USAR with HAZMAT and HES with USAR if that makes sense.

Link to comment
Share on other sites

@jsutton that is perfect it worked fine just one last question how do i swap the tiller in fs1 for the mass casualty unit? thank you very much :)

Add this line to the top with rest of units - const char OBJ_MCU[] = "mod:Prototypes/Vehicles/02 LA Fire Department/mass_casuality_unit.e4p";

Erase this line after the ladder line

|| StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)

and just follow the same thing I showed you earlier replacing the OBJ_LADDER to OBJ_MCU.

I would upload the scripts, but I am visiting family out of town, and I will upload asap.. Hopefully next Friday! :)

I added USAR to FS2 and all I need to know is what you want the USAR replaced with in the FS1. I have the LA Mod 2.0 scripts already.

Link to comment
Share on other sites

I guess USAR because i don't really need the HAZMAT on-map.

That's going to require some more scripting. Follow the tutorial I gave chris to show how to make the basic edits on how to replace hazmat with the USAR. I'll make the short script real quick tonight to show you how to do it.That will be much easier for me than typing out everything, it will get confusing.

Link to comment
Share on other sites

That's going to require some more scripting. Follow the tutorial I gave chris to show how to make the basic edits on how to replace hazmat with the USAR. I'll make the short script real quick tonight to show you how to do it.That will be much easier for me than typing out everything, it will get confusing.

Wait, can't I just leave it, because the USAR is already in FS1.... or, at least in the base-mod.

Link to comment
Share on other sites

Wait, can't I just leave it, because the USAR is already in FS1.... or, at least in the base-mod.

Yes, if you keep in FS1 then you won't have it in FS2 unless you do the extra script work.If you put the USAR in both stations, Its set up will be like Engine 1. Engine 1 will return to FS1 or FS2 depending on which is closer and if it's VO is taken or not, it will be the same with USAR, if FS2 is closer, it will go to FS2 unless of course it is taken, then it knows to go to FS1.

So that being said, USAR will need to have the extra script work done if you want to put one in each station. If you don't do the extra script work like Engine 1 is done, it will not return to station, return to only FS1or it might give you a error. Yes, I know they have different VO's but the USAR squad is not changed in any way, they both have the same return to function.

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