Replacing a vehicle in one of the fire stations
#161
Gepost 10 maart 2011 - 08:46
#162
Gepost 11 maart 2011 - 12:17
- 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.
#163
Gepost 11 maart 2011 - 05:01
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.
#164
Gepost 12 maart 2011 - 06:42
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);
}
}[/code]
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
#165
Gepost 13 maart 2011 - 10:28
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.
#166
Gepost 14 maart 2011 - 11:07
@ 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
#167
Gepost 17 maart 2011 - 02:56
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
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.
#168
Gepost 20 maart 2011 - 06:30
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.
#169
Gepost 20 maart 2011 - 11:52
#170
Gepost 21 maart 2011 - 12:26
#171
Gepost 21 maart 2011 - 04:08
@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.
#172
Gepost 21 maart 2011 - 07:58
#173
Gepost 21 maart 2011 - 09:52
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.
#174
Gepost 22 maart 2011 - 08:33
Wait, can't I just leave it, because the USAR is already in FS1.... or, at least in the base-mod.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.
#175
Gepost 22 maart 2011 - 09:52
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.
#176
Gepost 22 maart 2011 - 11:21
#177
Gepost 23 maart 2011 - 06:07
So, would it just be easier to put in the HAZMAT? If so, could it be done that way? I just want FS2 to kind of look like my Station down the street.
Ok, how bout this. In the tutorial I gave Chris earlier; follow that to replace the USAR with the HES. After doing that, try replacing the Hazmat with the USAR. Chris got it to work just from those directions I gave him so just give it a shot and tell me how it goes.
#178
Gepost 23 maart 2011 - 04:55
One of two things. First I want to personally thank you for all the work you do for people like me and others who wish to make changes to the mods but don't know how to do it. It is really appreciated.
Second. I have been having a problem trying to change out personnel in the trucks. I have read the what I am suppose to be looking for but seem to be lost.
Any chance you could give me a bit of help with this one?
Former Fire Fighter (2006-2011)
Squamish Fire Resuce
Hall one Company 41 (on call 24-7)
#179
Gepost 23 maart 2011 - 07:31
#180
Gepost 23 maart 2011 - 11:26
Hey Jsutton,
One of two things. First I want to personally thank you for all the work you do for people like me and others who wish to make changes to the mods but don't know how to do it. It is really appreciated.
Second. I have been having a problem trying to change out personnel in the trucks. I have read the what I am suppose to be looking for but seem to be lost.
Any chance you could give me a bit of help with this one?
In the LAFireStation and LAFireStationStart scripts, you will find this code under all units. It tells the game which personnel and how many will go to each unit when the alarm is sounded.
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);
This code is telling the game to send out 4 USARFF to the USAR. Now, if you want to just remove 2 of the FF so there are only 2 USARFF running out, all you have to do is delete the 4 bottom lines to look like this:
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 6, false); m.PushActionWait(ACTION_APPEND, 0.5f); m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 6, false);
If you want to add units to like 5 personnel running out then you will just have to do is copy the bottom 2 lines > hit enter > and paste the 2 lines so then you have 5 USARFF running out to the unit.
So now you know how to remove and add personnel, here is how you change personnel. The numbers in the first post show you what each number is such as 1 is paramedic and 2 is paramedic stretcher unit, and so on. That is what you replace the 6 with if you want a different personnel. If you want a FF Paramedic to run out, just simply delete the 6 and plug in a 1. Simple as that.