Jump to content
Dominic22

Make a LABattalionChief script but make it for EMS?

Recommended Posts

Well this can be a little tricky depending on how its set up. If the BC and EMS Sup can both call for ALS Ambos, then theres no point in doing the command twice in 2 different scripts. I would suggest starting with a copy of the BC script and then only put additional medical vehicle calls in there, but aside from say the MCU I dont really see a need for calling other EMS vehicles that dont already have a command. In which case I would just add a Call MCU command to the BC script.

Link to comment
Share on other sites

Well this can be a little tricky depending on how its set up. If the BC and EMS Sup can both call for ALS Ambos, then theres no point in doing the command twice in 2 different scripts. I would suggest starting with a copy of the BC script and then only put additional medical vehicle calls in there, but aside from say the MCU I dont really see a need for calling other EMS vehicles that dont already have a command. In which case I would just add a Call MCU command to the BC script.

Well, I'm setting it up so that whenever I dispatch a vehicle via Battalion it will send companies in SCBA of course the medics wont be have SCBA's, I use my battalion chief to send vehicles to calls and I would prefer to have it so that if I use my EMS supervisor to dispatch then the companies respond in normal gear, but if I have my battalion call then they are in SCBA's but that can only be accomplished by advanced scripting the Battalion Chief script or just erasing the EMS part from the Battalion script and adding it into it's own EMS script.

Link to comment
Share on other sites

Well, I'm setting it up so that whenever I dispatch a vehicle via Battalion it will send companies in SCBA of course the medics wont be have SCBA's, I use my battalion chief to send vehicles to calls and I would prefer to have it so that if I use my EMS supervisor to dispatch then the companies respond in normal gear, but if I have my battalion call then they are in SCBA's but that can only be accomplished by advanced scripting the Battalion Chief script or just erasing the EMS part from the Battalion script and adding it into it's own EMS script.

First, if you are going to play with the scripts you should have at least an elementary knowledge of programming in general and C/C++ in particular. I can give you an idea of how to do it but if you have no working knowledge at all of programming this is going to be Greek to you and you are going to have a hard time with this.

You already have an if statement to determine what voice to play on dispatch. Should it be the voice of the battalion chief or of the EMS supervisor? That same line can be used before the CALL_CREW commands to choose which crew to dispatch.

Alternatively you can use math and one if statement so you don't have to duplicate all the CALL_CREW actions. The CALL_CREW lines use a number to determine which unit gets called. In my version of the Xplorer4x4 submod a plain FF_EMT is 3 while a FF_EMT_SCBA is 10. (If you are not using my version you will have to edit the LAFireStation script to set up numbers for the SCBA units.) Make an integer variable and set it to 0. If the caller is a battalion chief (determined using the if statement above) you would set the variable to 7. Each time you call an EMT, instead of using 3 you would use 3 + Variable. That way if the caller was a BC if would be the equivalent of 3 + 7 which is 10. If it was the EMS supervisor it would be 3 + 0 which is 3.

You could duplicate the entire file but that would actually be more complicated. For that to work you would have to rename all the commands in the EMS version, link those new commands with the right button graphics and assign them to the EMS Supervisor in the editor instead of the commands that are there now. That's not only a lot of work, that also leave a lot of room for mistakes that will be very hard to debug. I would stick with editing the script in one of the ways I suggested.

If this sounds too complicated then you either want to just leave things alone or study up on your C++ before trying it. Whatever you do, don't forget to backup the script files before you make any changes so you could always put the original back if things go wrong.

Good luck!

Link to comment
Share on other sites

First, if you are going to play with the scripts you should have at least an elementary knowledge of programming in general and C/C++ in particular. I can give you an idea of how to do it but if you have no working knowledge at all of programming this is going to be Greek to you and you are going to have a hard time with this.

You already have an if statement to determine what voice to play on dispatch. Should it be the voice of the battalion chief or of the EMS supervisor? That same line can be used before the CALL_CREW commands to choose which crew to dispatch.

Alternatively you can use math and one if statement so you don't have to duplicate all the CALL_CREW actions. The CALL_CREW lines use a number to determine which unit gets called. In my version of the Xplorer4x4 submod a plain FF_EMT is 3 while a FF_EMT_SCBA is 10. (If you are not using my version you will have to edit the LAFireStation script to set up numbers for the SCBA units.) Make an integer variable and set it to 0. If the caller is a battalion chief (determined using the if statement above) you would set the variable to 7. Each time you call an EMT, instead of using 3 you would use 3 + Variable. That way if the caller was a BC if would be the equivalent of 3 + 7 which is 10. If it was the EMS supervisor it would be 3 + 0 which is 3.

You could duplicate the entire file but that would actually be more complicated. For that to work you would have to rename all the commands in the EMS version, link those new commands with the right button graphics and assign them to the EMS Supervisor in the editor instead of the commands that are there now. That's not only a lot of work, that also leave a lot of room for mistakes that will be very hard to debug. I would stick with editing the script in one of the ways I suggested.

If this sounds too complicated then you either want to just leave things alone or study up on your C++ before trying it. Whatever you do, don't forget to backup the script files before you make any changes so you could always put the original back if things go wrong.

Good luck!

Thank you very much for taking your time to explain this to me. I have a little bit of knowledge on programming, but I'm the 'learn as I go' type of person. I appreciate your help as well as Xplorer's helps, thank you.

The only part that I am stuck on is the making a variable so I can have it pretty much say 'if 0 is calling ems then this is the crew that responds and if 7 is calling then this is the crew that responds' I'm just not sure about the how variable part, but the rest of what you are telling me I'm comprehending.

Link to comment
Share on other sites

You already have the following lines in several parts of the script:


if(StrCompare(Caller->GetPrototypeFileName(), OBJ_BATTALION_CHIEF) == 0)
Audio::PlaySample3D(SND_BATBLS, Caller->GetPosition());
else if(StrCompare(Caller->GetPrototypeFileName(), OBJ_EMS_CAPTAIN) == 0)
Audio::PlaySample3D(SND_EMSBLS, Caller->GetPosition());

The variable 'Caller' is a pointer to the object that triggered the script and tells you in this case whether the script was triggered by the BC or EMS. You can create an integer variable in the beginning of the function -


int CallCrewModifier;

then give it a value using the above if statement something like this.

if(StrCompare(Caller->GetPrototypeFileName(), OBJ_BATTALION_CHIEF) == 0)
CallCrewModifier = 7;
else
CallCrewModifier = 0;

When you call for a crew member for a fire truck your statement will look something like this:

v.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 3 + CallCrewModifier, false);

Of course, as I said before you first need to edit the LAFireStation script. The way I did it you should have the following lines in the script:


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_EMS_CAPTAIN, UNNAMED);
else if (ChildID == 9)
Person p = Game::CreatePerson(OBJ_DIVER, UNNAMED);
else if (ChildID == 10)
Person p = Game::CreatePerson(OBJ_EMT_SCBA, UNNAMED);
else if (ChildID == 11)
{
Person p = Game::CreatePerson(OBJ_PM_SCBA, UNNAMED);
p.SetEquipment(EQUIP_EMERGENCY_CASE);
}
else
return;

You might make yours a drop different since you aren't using medics in SCBA.

You also need to make sure you declare the constant OBJ_EMT_SCBA on top if that wasn't already done.

Good luck!

Link to comment
Share on other sites

Thank you very much for breaking that down for me. I have already did all of the edits that I need in the FS scripts.

Thank you.

EDIT: Okay, I must have done something wrong because when I request the vehicle that has the script applied to it, which is the Hazmat, then I only get 1 guy that gets into the vehicle, I even set it so that when bat. request it sends 4 hazmat and when ems request then it sends 4 medics, but it only sends 1 medic no what is requested. I don't know, I guess this is to big of a step for me.

Link to comment
Share on other sites

The numbers I gave you are only for EMT and EMT SCBA. The Hazmat truck has other rules applied to it as to who can and can't get in so it should probably be left alone. Try it with another fire engine and see if it works there. Once you have it working on an Engine you can start playing around with Hazmat but you will probably have to do a lot more complicated editing to get the Hazmat truck to work the way you have in mind.

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