Jump to content
jsutton

ToFireStation script question for additional vehicle in Fire Station 1

Recommended Posts

I modified the Fire Station Scripts where the USAR replaces the Hazmat and HES replaces USAR (just the way I prefer) and I was wanting to make a additional VO in the editor to add another HES to station 1 and that's when I noticed usar02 virtual object. So, I modified the scripts to allow for that to happen but I can't seem to get it to work the way I want to. I had several errors in FireStation and FireStationStart which I fixed it I think but I can't seem to figure out the ToFireStation script. Would anyone be willing to modify it so when I want to send another HES to the fire station, I can have 2 of them in there? If not, would anyone tell me how to do it and I already tried basing it off the Engine 2 code and no luck but numerous errors.

Ok, small update. Tried to call HES out of Fire Station 1 and it wouldn't move so I sent some officers over there to blow it up and sent tow truck out to haul it away and what do ya know, a new one was already there and it is functional. So I am having some scripting problems all the way around I guess. Will it be hard to fix this mess?

I tried uploading the script for ya all to check out but it says I don't have permission to upload the file? Never had that problem.

Link to comment
Share on other sites

put them in a zip and upload them to http://rapidshare.com/index.html

then post the link in here.

I would be happy to look into this, with just a little time and patience. Could you also post some screens of what happens and what you want it to look like?

You can also PM me if you like.

Here is the link to the files:

http://rapidshare.co...963/Scripts.rar

Picture:

http://tinypic.com/r/2hwgvo5/7

Link to comment
Share on other sites

Ok, in the LAfireStation script, you need to add this

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

again, but the VO should be VO_USAR2 (unless you have changed the named of the vurtual object in editor)

Also in LAFireStationStart script, you added the second HES, but the vurtual object is the same as the other one, i think you need to change it to VO_USAR2

In the LAReturnToFIreStation script,

                    ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_USAR);
ActorList l2 = Game::GetActors(VO_USAR02);

Should be:

                    ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_USAR);
ActorList l2 = Game::GetActors(VO_TURNTO2);

And below that,

                    ActorList l1 = Game::GetActors(VO_USAR);
ActorList l2 = Game::GetActors(VO_TURNTO2);
ParkinglotFound = true;

should be

          ActorList l1 = Game::GetActors(VO_USAR2);
ActorList l2 = Game::GetActors(VO_TURNTO2);
ParkinglotFound = true;

That was just a quick glance, if you confused have a look at the code for the engines, its very similar to what you want to achieve. i think your just getting your virtual objects confused!

Link to comment
Share on other sites

LAFireStation script:

I actually added it as a new game object list #19 I think at the bottom of the script. USAR is #7 and USAR02 is #19. Whoops, wrong script. I see what you mean and I will try to fix that. I tried to go off Engine 2 code but when I copied it and made the changes to the code, I got tons of errors and as I fixed one another came up and I couldn't fix the final error so I just copied the original USAR code back. I'll see what I can do on updating that.

Update: So I added this to the end after Engine 4 (virtual object behind Engine 2) and here is the code:

  GameObjectList l12;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l12, ACTOR_VEHICLE);
if(l12.GetNumObjects() > 0)
{
Vehicle m = l12.GetObject(0);
PersonList passengers = m.GetPassengers();
if (passengers.GetNumPersons() == 0)
{
m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 1, false);
m.PushActionWait(ACTION_APPEND, 0.5f);
m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);
}
}
}
}
if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2

Did I do this wrong? It gives me a error on line 433 which line 433 is the Control Panel 2 code. I got a syntax error and that's the line it told me to fix. So I did something wrong here and hopefully someone can tell me.

LAFireStationStart script:

I'll take a look at it and make the changes to it and see if that works. That may be what my spawning problem is.

LAToFireSation script:

I made the changes. Hope that fixed it.

Everything you mentioned is what I thought but I don't know how to do the virtual object stuff yet. Eventually I want to learn how to make addition virtual objects on map for units to spawn and return to but that will be extensive work. Also, I been following the Engine 2 script because Engine 1 has all the if FS1 is closer go there or if FS2 is closer go there stuff and it makes me all confused.

Link to comment
Share on other sites

I don't know how you got the code to paste right when you made the codes but I can't get mine to do that. My } are all spaced out after I made the list. I can't look at my scripts right now but I know that I have them all spaced out.

Link to comment
Share on other sites

you put this line in at the top of the 4 scripts??

const char VO_USAR2[]                = "fs_usar02";

Think so, I will double check.

the LAFireStationStart script was - const char VO_USAR02[] -"fs_usar02"; so I changed it from hyphen to equal sign and we'll see what it does.

Update:

So that minor mistake I had made the HES finally spawn in the second Virtual Object, I can successfully take the HES squads out of the fire station but then the problem returning to the fire station becomes a problem. I have a problem in the Fire Station and To Fire Station scripts I am guessing. So I will go through them and see if I made a mistake somewhere. This is becoming a pain, hopefully it gets solved and works.

Update #2:

Found another minor mistake in the FireStation script. The HES spawns in both virtual objects but they do not return to station right. One of them backs into the parking spot while the other one goes through the back. So I just need to fix the To Fire Station script and I think it should work.

Link to comment
Share on other sites

Hey all... I'm having some problems with the to fire station script and I figured this would be the perfect topic to bring back to life... So i've added 2 Light Equipment Trucks to FS 1.. the first one was easy all i had to do was add the ToFireStation Command to the LET in the editor and then just change the file name... but for the SECOND LET it works fine up until it has to go back to the fire station... It spawns and everything but even tho i've added the extra code for it in the ToFireStation Script for the second LET, it still just says that there is no room at the fire station and it will return to base... someone please help!!

NOTE: Here is the file link. The LET is simply taking USAR's place so just look for USAR and USAR2 because those are the LETs

ToFireStation script: http://www.megaupload.com/?d=J8Z5F5ZW

Let me know if you would like to take a look at the LAFireStation script or the LAFireStationStart script, although both are working just fine.

Link to comment
Share on other sites

so I can't just use the same prototype?? like if OBJ_USAR = "mod:Prototypes/Vehicles/02 LA Fire Department/light_equipment_truck.e4p"

I couldn't use OBJ_USAR for multiple Virtual Objects? If I understand what you mean i should have it something like where VO_USAR uses OBJ_USAR and VO_USAR2 should use something like OBJ_USAR2???

and of course VO_USAR = "fs_usar" and VO_USAR2 = "fs_usar02"

Link to comment
Share on other sites

so I can't just use the same prototype?? like if OBJ_USAR = "mod:Prototypes/Vehicles/02 LA Fire Department/light_equipment_truck.e4p"

I couldn't use OBJ_USAR for multiple Virtual Objects? If I understand what you mean i should have it something like where VO_USAR uses OBJ_USAR and VO_USAR2 should use something like OBJ_USAR2???

and of course VO_USAR = "fs_usar" and VO_USAR2 = "fs_usar02"

Thank you for not making a new topic. Yes, you can do that, I did the same thing but with the HES. It was a pain and I am still not finished with my script but I got them to return to station without any errors or problems.

You shouldn't have to make a second OBJ_USAR but you do need to make a second virtual object line. Just below the fs_usar line, you need to add this:

const char VO_USAR02[]    	= "fs_usar02";

Link to comment
Share on other sites

Really?? hmm thats strange because that's usually what I do is just add

const char VO_USAR2[] = "fs_usar02"

but it still tells me that there is no space.. I am going to try creating the second OBJ and seeing what happens but also If you could share your script with me that would be awesome and post what you changed and how u did it so that I may pass on the information to my modding partner.

**UPDATE**

Well I tried the second OBJ approach and had a LITTLE more success but not quite.. Before, the first LET would return to the station but stop in the SECOND LET's place and the personnel would get out... this time the first LET returned to where it should normally be, but the second LET got the "this vehicle doesn't belong in the fire station" message. I am going to wait until I can view your script and hear from you what you did step by step before I continue. If you're willing to share that information with me of course.

Link to comment
Share on other sites

My LAToFireStation isn't complete yet but it is functional they just don't return to the fire station like the engines do. My units return to station with one of them pulls in from the front and the other pulls in from the back. I tried fixing it with no luck but below you will find out what you need to do to make it functional. Make sure you back up your current script before you do this just in case. This is done int he LAToFireStation script.

One mistake here: const char VO_USAR2[] = "fs_usar02" - You need to change VO_USAR2 to VO_USAR02

Find the first USAR code (Just below the Battalion) and replace it with this:


else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
{
bool Possible = false;

GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_USAR, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() == 0 && !Possible)
Possible = true;

GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() == 0 && !Possible)
Possible = true;

if (Possible)
{
ActorList l1 = Game::GetActors(VO_FP2);
ActorList l2 = Game::GetActors(VO_TURNTO2);
}
}

Then scroll down to the next USAR code and replace it with this:


else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
{
GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_USAR, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOFIRESTATION, Caller, 0, false);
return;
} else
{
ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_USAR);
ActorList l2 = Game::GetActors(VO_TURNTO2);
}
} else
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
ActorList l1 = Game::GetActors(VO_USAR);
ActorList l5 = Game::GetActors(VO_USAR02);
Vector Move = l5.GetActor(0)->GetPosition();
l4.GetObject(0)->PushActionMove(ACTION_NEWLIST, Move, true);
} else
ActorList l1 = Game::GetActors(VO_USAR02);
ActorList l2 = Game::GetActors(VO_TURNTO2);
ParkinglotFound = true;
}
}

If you find a error or make it work like the engines, let me know and we will get it fixed.

Link to comment
Share on other sites

Even closer success this time thank you very much. One of the reasons that mine wasn't working is because I wasn't touching the SECOND usar code lol under Dummy CheckParked or whatever lol. But there is a slight problem. Rather than one going in the front and one through the back, they both try to go to the back, one gets in, stops in the second USAR's place, and the personnel get out, but the second one tries to go through the back as well, and the back door opens but the first USAR just sit's there, and the second USAR can't get in and they just sit there. Any suggestions?

Link to comment
Share on other sites

Even closer success this time thank you very much. One of the reasons that mine wasn't working is because I wasn't touching the SECOND usar code lol under Dummy CheckParked or whatever lol. But there is a slight problem. Rather than one going in the front and one through the back, they both try to go to the back, one gets in, stops in the second USAR's place, and the personnel get out, but the second one tries to go through the back as well, and the back door opens but the first USAR just sit's there, and the second USAR can't get in and they just sit there. Any suggestions?

Alright, I fixed it and it now returns to station just like the engines. I made a couple mistakes and I finally found them. Copy my code and paste it over the SECOND USAR code. The first USAR code is fine.

   else if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)
{
GameObjectList l3;
Game::CollectObstaclesOnVirtualObject(VO_USAR, l3, ACTOR_VEHICLE);
if(l3.GetNumObjects() > 0)
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
v.PushActionExecuteCommand(ACTION_NEWLIST, CMD_TOFIRESTATION, Caller, 0, false);
return;
} else
{
ParkinglotFound = true;
ActorList l1 = Game::GetActors(VO_USAR02);
ActorList l2 = Game::GetActors(VO_TURNTO2);
}
} else
{
GameObjectList l4;
Game::CollectObstaclesOnVirtualObject(VO_USAR02, l4, ACTOR_VEHICLE);
if(l4.GetNumObjects() > 0)
{
ActorList l1 = Game::GetActors(VO_USAR02);
ActorList l5 = Game::GetActors(VO_USAR);
Vector Move = l5.GetActor(0)->GetPosition();
l4.GetObject(0)->PushActionMove(ACTION_NEWLIST, Move, true);
} else
ActorList l1 = Game::GetActors(VO_USAR);
ActorList l2 = Game::GetActors(VO_TURNTO2);
ParkinglotFound = true;
}
}

Link to comment
Share on other sites

I am having a very similar problem. I made a new freeplay map and I use the LAFirestation and all the vo's are the same as the original LAMod for now. I just thought I would use this to see if it would work on my map. My problem is that the personnel is spawning and the vehicles are all spawning in the right spots but all facing the wrong direction and when I take them out of the firestation and have them return to the firestation they stop at the back door and the back door will not open and they do not enter. The fire chief and other vehicles that park in the back of the station return to their spots but they will not park on the vo Bat Chiefs spot they stop and park in the Bat Chief 2 spot which is in front. What am I doing wrong?

Link to comment
Share on other sites

I am having a very similar problem. I made a new freeplay map and I use the LAFirestation and all the vo's are the same as the original LAMod for now. I just thought I would use this to see if it would work on my map. My problem is that the personnel is spawning and the vehicles are all spawning in the right spots but all facing the wrong direction and when I take them out of the firestation and have them return to the firestation they stop at the back door and the back door will not open and they do not enter. The fire chief and other vehicles that park in the back of the station return to their spots but they will not park on the vo Bat Chiefs spot they stop and park in the Bat Chief 2 spot which is in front. What am I doing wrong?

Upload your LAToFireStation script into a zip file and upload it on here so we can take a look at it and maybe get it functional.

Well, your second problem is a easy fix but your first problem I'm not positive on. I have my ideas but I'll wait for the script. In my opinion, when you send the units back to station and the garage doors don't open is because the station is all backwards (the gates and virtual objects).

Did you turn the station around in your map or is it in the same position?

Link to comment
Share on other sites

Here is the zipped file you asked for. Please let me know if it worked for you. I left the station in the same position and have not touched it.

Ok thanks. I downloaded it and will quickly fix your second problem.

Update:

Alright, your second problem should be fixed. I'm hoping someone can solve your first problem because I'm not exactly sure. I'll do my best though to find a solution.

LAToFireStation.zip

Link to comment
Share on other sites

I know your script is working as I got the tiller trailer back so thank you very much, but I downloaded it and it is still doing the same thing.

So now I have a couple problems/questions for you.

How hard would it be to remove the tiller to put a 2nd ladder in as I do have 2 different v3o models, textures and protypes for trucks. The one that is in the LA game and ladder 461. I have looked at least 10 times now for an extra VO that is making all the vehicles park backwards. I added the 2 ARM Ambulances to the hospital they are parking the exact same way I even tried changing the VO gate turn to, to a different VO gate to vo gate 10 and I edited the script so that all the ambulances and vehicles that park in the firestation would use that same turn to and then I placed that vo turn to the edge of the map and it did not work. I am using the campaign map and I am pretty much at the point of starting over on the map or choosing a different map. Is there a different map that I should be using or could use? Every vehicle I put on this map all park the same way they do now which is backwards, no matter where their vo is. Is there any kind of hidden values on this map that is making these vehicles park like this?

Link to comment
Share on other sites

I know your script is working as I got the tiller trailer back so thank you very much, but I downloaded it and it is still doing the same thing.

So now I have a couple problems/questions for you.

How hard would it be to remove the tiller to put a 2nd ladder in as I do have 2 different v3o models, textures and protypes for trucks. The one that is in the LA game and ladder 461. I have looked at least 10 times now for an extra VO that is making all the vehicles park backwards. I added the 2 ARM Ambulances to the hospital they are parking the exact same way I even tried changing the VO gate turn to, to a different VO gate to vo gate 10 and I edited the script so that all the ambulances and vehicles that park in the firestation would use that same turn to and then I placed that vo turn to the edge of the map and it did not work. I am using the campaign map and I am pretty much at the point of starting over on the map or choosing a different map. Is there a different map that I should be using or could use? Every vehicle I put on this map all park the same way they do now which is backwards, no matter where their vo is. Is there any kind of hidden values on this map that is making these vehicles park like this?

So you have modeled a new ladder truck and want to add another ladder to the game, correct? If so, Hoppah's tutorial: http://www.emergency-planet.com/index.php?option=com_content&task=view&id=110&Itemid=35

So let me get this right, you have edited the campaign map to be a freeplay map? Did you rotate your station when you placed it on the map? There isn't a extra VO that is causing the vehicles to park backwards. I don't think an extra VO will cause that. It's your rotation in your script that may be the problem. Lol, well, it's going to be a lot more complicating fixing your scripts because you changed all the turn to's and gates. Did you make a backup of your script before you made all these changes?

Link to comment
Share on other sites

I did not change any Vo names or positions. They are copied from the LAmod game. My firestation is in the exact same position just on a different map. The reason I am using the campaign map is because I do not have any other maps to use. I made a back up of my script. I did make those VO changes listed above but it did not work so I changed them back.

Link to comment
Share on other sites

I did not change any Vo names or positions. They are copied from the LAmod game. My firestation is in the exact same position just on a different map. The reason I am using the campaign map is because I do not have any other maps to use. I made a back up of my script. I did make those VO changes listed above but it did not work so I changed them back.

Well these VO changes in this topic are from us wanting to add a second engine in the fire station not for the problem your having. To be honest with ya, I think you should make a new topic describing your problem because it's kinda unrelated with adding another vehicle and I think a lot more people will assist you (more than me at least). When you do, make sure you upload your LAFireStation, LAFireStationStart, LAToFireStation scripts and if you could a couple pictures with the engines facing backwards and batallion in the second VO. Most of us on here use fraps to take screenshots.

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