Jump to content

timmiej93

Members
  • Posts

    207
  • Joined

  • Last visited

Posts posted by timmiej93

  1. After trying Emergency 5 for a bit, with the Wuppertal mod, I still find myself drifting back to playing EM4, even though EM4 is clearly showing its age. Looking at video production and mods, I'd also say that EM4 is still pretty popular amongst modders and players.

    To me, EM5 just feels slow. The horrible fading from standstill to moving and vice versa takes any speed out of the game, not being able to quickly go back to an emergency scene after you've completed it, the mouse controls being weird (not being able to tilt the camera without holding an additional button, and tilt changing with zoom? Come on). Sure, EM5 has plenty of advantages: It loads about a hundred times faster than EM4, it looks better, fire is way more realistic, and I'm sure it has better modding options, but it still feels limited.

    Personally, I'd much prefer the next Emergency title to just be a modernization of EM4. Make sure it can use multiple cores, make it 64 bit, make it able to handle wide and ultrawide monitors, and just speed it up in general. I wouldn't even mind if the graphics and UI remained the way they are. If they would make sure that EM4 mods are still compatible, I think they'd sell a copy to pretty much anyone who still plays EM4.

    Maybe I'm just being nostalgic, or maybe the newer EM titles are just a bit sub-par, or maybe EM4 really just is better. What are your opinions?

  2. Alright, I finally got around to doing an experiment, after a lot of irritation. Here's the testing and the results:

    Calling function:
    		blabla...
    		Caller->PushActionExecuteCommand(ACTION_NEWLIST, "TimTest", NULL, 0, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 19, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 20, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 21, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 22, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 23, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 24, false);
    	}	
    };
    
    object TimTest : CommandScript
    {
    	TimTest() {}
    	bool CheckPossible() { return true; }
    	bool CheckTarget() { return true; }
    
    	void PushActions(GameObject *Caller, Actor *Target, int childID) {
    
    		System::Log("childID %i", childID);
    
    		if (childID != 0) {
    			return;
    		}
    
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 1, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 2, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 3, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 4, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 5, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 6, false);
    		Caller->PushActionExecuteCommand(ACTION_INSERT, "TimTest", NULL, 7, false);
    		Caller->PushActionExecuteCommand(ACTION_INSERT, "TimTest", NULL, 8, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 9, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 10, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 11, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 12, false);
    		Caller->PushActionExecuteCommand(ACTION_INSERTBEFORELAST, "TimTest", NULL, 13, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 14, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 15, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 16, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 17, false);
    		Caller->PushActionExecuteCommand(ACTION_APPEND, "TimTest", NULL, 18, false);
    	}
    };
    
    Results in log:
    
    !childID 0
    !childID 8
    !childID 7
    !childID 19
    !childID 20
    !childID 21
    !childID 22
    !childID 23
    !childID 24
    !childID 1
    !childID 2
    !childID 3
    !childID 4
    !childID 5
    !childID 6
    !childID 9
    !childID 10
    !childID 11
    !childID 13
    !childID 12
    !childID 14
    !childID 15
    !childID 16
    !childID 17
    !childID 18

     

    My conclusions from this test:

    • Any PushAction... that's INSIDE another function called by PushActionExecuteCommand gets executed AFTER EVERYTHING from the calling function has been executed, as demonstrated by the numbers 0 > 19 > 20 > 21 > 22 > 23 > 24 before going to 1.
    • Using ACTION_NEWLIST inside the second function (TimTest in this case) DOES cancel all queued commands from the calling function. For example, for the PushActionExecuteCommand with ChildID 1, if that had ACTION_NEWLIST instead of ACTION_APPEND, ChildID 8, 7, 19, 20, 21, 22, 23 and 24 do NOT print.
    • Using ACTION_INSERT inserts the command IMMEDIATELY after the PushActionExecuteCommand that called the function you're now in. Using ACTION_INSERT again will do the same, thus pushing the previously inserted item down one spot, as demonstrated by ChildID 0 > 8 > 7.

    Hopefully this can prevent some frustration among scripters. If you have any questions about my testing, feel free to ask.

     

  3. So let's be honest, the "PushAction..." system used by EM4 isn't great, but it's what we've got, so I'd like to understand it a bit better.

     I think most scripters know what ACTION_NEWLIST and ACTION_APPEND do. ACTION_INSERTAFTERFIRST, ACTION_INSERTBEFORELAST and ACTION_REPLACEFIRST are self-explanatory, but what does ACTION_INSERT do? Where does the command get inserted? Has anyone ever figured this out?

  4. I'm trying to make some changes to the Bieberfelde 2020 mod (for personal use only, just trying to make the mod more to my personal liking), but I'm having issues with getting all 'PushActionXXX' calls to execute properly.

    This is the code I've got:

    void PushActions(GameObject *Caller, Actor *Target, int childID) {
        Vehicle myVehicle(VehicleList(Caller->GetName()).GetVehicle(0));
        	int myVehicleID = myVehicle.GetID();
        	PersonList myCrew(myVehicle.GetName());
    		System::Log("Start loop");
    		for (int i=myCrew.GetNumPersons()-1; i > -1; i--)
    		{
    			Person *person = myCrew.GetPerson(i);
    			person.PushActionWait(ACTION_NEWLIST, 0.1f);
    			person.PushActionLeaveCar(ACTION_APPEND, &myVehicle);
    			Mission::PlayHint("1");
    			person.PushActionExecuteCommand(ACTION_APPEND, "GetFirehose", &myVehicle, 0, false);
    			Mission::PlayHint("2");
    			person.PushActionWait(ACTION_APPEND, 1.0f);
    			person.PushActionExecuteCommand(ACTION_APPEND, "AttachFireHose", Target, 0, false);
    			Mission::PlayHint("3");
    			person.PushActionWait(ACTION_APPEND, 1.0f);
    			person->PushActionExecuteCommand(ACTION_APPEND, "attachfirehose_wv", &myVehicle, 0, false);
    			Mission::PlayHint("4");

    For clarity: I'm trying to have the GruppenFuhrer (squad leader?) give a command for creating a water supply. This is done by clicking on the hydrant (Target) with the GF. It then finds a person from his vehicle that's "available", tells him to grab a hose, connect to the hydrant, and then connect to the vehicle. 

    The person getting out works fine, and so does getting the firehose. However, with the first "AttachFireHose", things get a bit weird. Despite the fact that I'm calling the exact same function that you would if you connect a firehose to the hydrant manually1, whenever I call the function here, the firefighter attaches a hose to the first attachpoint, even if there's already a hose attached to it. When connecting a firehose to the hydrant manually1, the firefighter does select a free attachpoint. Could this have something to do with pointers? As far as I know2, the Target variable in the snippet above is a reference (so not a copy) to the hydrant, so that should be fine?

    Now, like I said before, "AttachFireHose" is weird, but it works. "attachfirehose_wv" however, doesn't execute at all. I've put some log entries and PlayHints3 in the code, so I can debug it. I've done this in the snippet above, and in all 3 functions that are called in the snippet above.
    So as expected, when I click a hydrant with the GF, 1, 2, 3 and 4 pop up pretty much instantly, and the FF gets out and grabs a hose. As soon as the FF starts walking towards the hydrant, the number 5 is displayed. However, the number 6 is never displayed, appearing as if the attachfirehose_wv function is never called. I've displayed how numbers 5 and 6 are located inside their respective functions below.

    // AttachFireHose
    void PushActions(GameObject *Caller, Actor *Target, int childID) {
    	System::Log("5");
    	Mission::PlayHint("5");
    
    	// Rest of the code for this function
    }
    
    // attachfirehose_wv
    void PushActions(GameObject *Caller, Actor *Target, int childID) {
    	System::Log("6");
    	Mission::PlayHint("6");
    
    	// Rest of the code for this function
    }

     

    So basically, I'm at a complete loss. If these functions were simple, I'd just copy their code over into the new function (I know, you shouldn't do that, but if it works and the proper way doesn't 🤷‍♂️), but these functions are pretty large, and call upon other functions as well.

    Does anyone have any tips or tricks I can try? Any tips regarding speeding up the testing of code would be nice as well, Bieberfelde is a great mod, but having to sit through that loading time just because you mistyped something, or are trying out a different pointer thingy is not that great.

     

    Footnotes:
    1: Selecting firefighter with hose, clicking hydrant
    2: My C++ skills aren't that great, especially with things like pointers etc., that aren't common in other languages
    3: System::Log(""); and Mission::PlayHint("");, displaying numbers, so I can trace in which order (if at all) the code executes.

  5. I already started modding for this one. Make models and such. My sojrces tell me it can handle upwards of 15k polys on a vehicle and scripting is still in c+ but there is a script editor in the main editor. And you can test it in the editor before you load the game

    That would be HUGE... We can get so much more work done now :3. I remember playing a cards game on my phone when I was modding for EM4, while the game (and mod) was loading, so I could test my changes. Can't wait!

  6. Well, this is it.

    There are 4 script files in the zip file:

     

    LAFireStation.script

    LAFireStationStart.script

    ToPoliceStation.script

    move.script

     

    All 4 are based on the LA Mod.

    BE WARNED: These script should not be simply copied over to your scripts folder. They are simply examples and guides on how to edit your own scripts. (This goes for the two firestation scripts and the move script). 

     

    You DO have to copy over the ToPoliceStation script, but first you DO have to edit it.

    These changes are all explained with comments inside the scripts.

     

    Credits go to Hoppah for making the LA Mod and enabling us to continue modding with it.

    Also much thanks to ItchBoy for helping me out and sending me some examples.

    Finally, thanks to everyone who replied to my many topics.

     

    To conclude it: Thanks for all the support, good luck on editing your scripts, and if you've got any questions: let me know.

     

    PS. I'm sorry if the comments are a bit vague, I assumed that whoever tries this does know quite a bit about scripting.

     

    Good luck guys!

    Tutorial.zip

  7. Well I guess I have no choice..

     

    I've created below script to test if the MD array works, but when adding this to a control panel or a vehicle, it causes the game to freeze after a few seconds, without any error.

    In my eyes this script should work, but maybe one of you sees a flaw in it.

     

    const char *TestPool [2][2];object Test : CommandScript{	Test()	{	}	bool CheckPossible(GameObject *Caller)	{		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int childID)	{		TestPool[0][0] = 0;		TestPool[0][1] = 1;		TestPool[1][0] = 2;		TestPool[1][1] = 3;		if(TestPool[0][0] = 0)			Mission::PlayHint "0,0 = 0";			System::Log "0,0 = 0";		if(TestPool[0][1] = 1)			Mission::PlayHint "0,1 = 1";			System::Log "0,1 = 1";		if(TestPool[1][0] = 2)			Mission::PlayHint "1,0 = 2";			System::Log "1,0 = 2";		if(TestPool[1][1] = 3)			Mission::PlayHint "1,1 = 3";			System::Log "1,1 = 3";	}}; 

  8. Yeah I've been thinking about something like that, but look at it like this:

    You've got 10 parking spaces. 9 are occupied.

    The chance that last parking spot number gets hit in the random number generation, is about 10%. That would mean the script would run approx 10 times before it can park. I don't know about you, but that sounds like a lot of memory usage to me, especially in EM4. I'm just about to set up a small test with a multidimensional array. Let's see how that works out.

  9. Hey guys,

     

    I'm trying to come up with a scripting method to have a script park cars randomly on a set number of parking spaces.

    Now this isn't the hard part. The hard part, is making sure the script understands when a parking space is filled. This is quite easy when there is a set parking order, since you can go down the list. When going random, it gets had.

    I've been able to think of one way to do it, but it requires ridiculous amount of code:

     

    Script out all possible options: Something like: if parking spot 3, 5 and 7 are occupied, park in one of these (with a list of spots 1, 2, 4, 8, 9 and 10 or something).

    This should be done for every single option then, and that does not appeal to me one bit.

     

    Does anyone know a different way to do this?

    Could it be possible to use an array with two columns, with column 1 being the data you need, and column 2 containing a 0 or a 1, depending if a car is parked on that spot.

     

    Tim

  10. I think I get it, but could you explain to me why that's used in below bit of code?

    p.SetUpgradeLevel(3);Game::FindFreePosition(&p, Spawn, 250);p.SetPosition(Spawn);p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);p.PushActionTurnTo(ACTION_APPEND, &v);p.PushActionEnterCar(ACTION_APPEND, &v);

    Entire script if you need it:

    //******************************************************************************************// #Version 1.5#//// 		Includes: All command for the fire station.////	- VcmdAlarm//	- VcmdRoof//	- VcmdGarageDoorsUp//	- VcmdGarageDoorsDown//	- VcmdCallEMT//	- VcmdCallEMTSCBA//	- VcmdCallEMTStretcher//	- VcmdCallPM//	- VcmdCallPMSCBA//	- VcmdCallPMStretcher//	- VcmdCallDiver//	- VcmdCallHazmat//	- VcmdCallUSARFF//	- VcmdEmptyFireStation//	- DummyDisableAlarm//	- DummyCallCrew//	- DummyGates//	- VcmdAutoStaffOn//	- VcmdAutoStaffOff//	- VcmdRepairVehicles////		Script by Hoppah//		//		Usage of this script in other mods is NOT allowed without permission of Hoppah////******************************************************************************************const char NAME_FIRESTATION[]			= "fire_station";const char NAME_FIRESTATION_ROOF[]		= "fire_station_roof";const char NAME_FIRESTATION2[]			= "fire_station2";const char NAME_FIRESTATION2_ROOF[]		= "fire_station2_roof";const char NAME_CONTROLPANEL[]			= "fire_station_controlpanel";const char NAME_CONTROLPANEL2[]			= "fire_station_controlpanel2";const char OBJ_BATTALION[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/battalion_chief_vehicle.e4p";const char OBJ_AMBULANCE01[]		= "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance01.e4p";const char OBJ_AMBULANCE02[]		= "mod:Prototypes/Vehicles/01 LA Ambulance/ambulance02.e4p";const char OBJ_USAR[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/usar_squad.e4p";const char OBJ_LADDER[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/aerial_ladder.e4p";const char OBJ_TILLER[]				= "mod:Prototypes/Vehicles/02 LA Fire Department/tiller_cabin.e4p";const char OBJ_ENGINE01[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine1.e4p";const char OBJ_ENGINE02[]			= "mod:Prototypes/Vehicles/02 LA Fire Department/fire_engine2.e4p";const char OBJ_HAZMATSQUAD[]		= "mod:Prototypes/Vehicles/02 LA Fire Department/heavy_rescue_crane.e4p";const char OBJ_CHIEF[]				= "mod:Prototypes/Persons/02 LA Fire Department/battalion_chief.e4p";const char OBJ_EMT[]				= "mod:Prototypes/Persons/02 LA Fire Department/ff_emt.e4p";const char OBJ_EMT_SCBA[]			= "mod:Prototypes/Persons/02 LA Fire Department/ff_emt_scba.e4p";const char OBJ_EMT_STRETCHER[]		= "mod:Prototypes/Persons/02 LA Fire Department/ff_emt_stretcher.e4p";const char OBJ_PM[]					= "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic.e4p";const char OBJ_PM_SCBA[]			= "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic_scba.e4p";const char OBJ_PM_STRETCHER[]		= "mod:Prototypes/Persons/01 LA Ambulance/ff_paramedic_stretcher.e4p";const char OBJ_HAZMAT[]				= "mod:Prototypes/Persons/02 LA Fire Department/ff_hazmat.e4p";const char OBJ_USARFF[]				= "mod:Prototypes/Persons/02 LA Fire Department/usar_ff.e4p";const char OBJ_DIVER[]				= "mod:Prototypes/Persons/02 LA Fire Department/ff_diver.e4p";const char OBJ_ENGINEER[]			= "mod:Prototypes/Persons/04 LA Tec/engineer.e4p";const char NAME_GATE01A[]			= "fs_gate01a";const char NAME_GATE02A[]			= "fs_gate02a";const char NAME_GATE03A[]			= "fs_gate03a";const char NAME_GATE04A[]			= "fs_gate04a";const char NAME_GATE05A[]			= "fs_gate05a";const char NAME_GATE06A[]			= "fs_gate06a";const char NAME_GATE07A[]			= "fs_gate07a";const char NAME_GATE08A[]			= "fs_gate08a";const char NAME_GATE01B[]			= "fs_gate01b";const char NAME_GATE02B[]			= "fs_gate02b";const char NAME_GATE03B[]			= "fs_gate03b";const char NAME_GATE04B[]			= "fs_gate04b";const char NAME_GATE05B[]			= "fs_gate05b";const char NAME_GATE06B[]			= "fs_gate06b";const char NAME_GATE07B[]			= "fs_gate07b";const char NAME_GATE08B[]			= "fs_gate08b";const char VO_GATE01A[]				= "fs_vogate01a";const char VO_GATE02A[]				= "fs_vogate02a";const char VO_GATE03A[]				= "fs_vogate03a";const char VO_GATE04A[]				= "fs_vogate04a";const char VO_GATE05A[]				= "fs_vogate05a";const char VO_GATE06A[]				= "fs_vogate06a";const char VO_GATE07A[]				= "fs_vogate07a";const char VO_GATE08A[]				= "fs_vogate08a";const char VO_GATE01B[]				= "fs_vogate01b";const char VO_GATE02B[]				= "fs_vogate02b";const char VO_GATE03B[]				= "fs_vogate03b";const char VO_GATE04B[]				= "fs_vogate04b";const char VO_GATE05B[]				= "fs_vogate05b";const char VO_GATE06B[]				= "fs_vogate06b";const char VO_GATE07B[]				= "fs_vogate07b";const char VO_GATE08B[]				= "fs_vogate08b";const char DUMMY_GATES[]			= "DummyGates";const char DUMMY_ALARM[]			= "DummyDisableAlarm";const char DUMMY_CALLCREW[]			= "DummyCallCrew";const char DUMMY_VCALLED[]			= "DummyVehicleCalled";const char VO_BATTALION[]			= "fs_battalion";const char VO_AMBULANCE01[]			= "fs_ambulance01";const char VO_AMBULANCE02[]			= "fs_ambulance02";const char VO_AMBULANCE03[]			= "fs_ambulance03";const char VO_AMBULANCE04[]			= "fs_ambulance04";const char VO_USAR[]				= "fs_usar";const char VO_LADDER[]				= "fs_ladder";const char VO_ENGINE01[]			= "fs_engine01";const char VO_ENGINE02[]			= "fs_engine02";const char VO_ENGINE03[]			= "fs_engine03";const char VO_ENGINE04[]			= "fs_engine04";const char VO_ENGINE05[]			= "fs_engine05";const char VO_HAZMAT[]				= "fs_hazmat";const char VO_SPAWN01[]				= "fs_spawn01";const char VO_SPAWN02[]				= "fs_spawn02";const char VO_SPAWN03[]				= "fs_spawn03";const char VO_MOVETO01[]			= "fs_moveto01";const char VO_MOVETO02[]			= "fs_moveto02";const char VO_SQUAD01[]				= "fs_squad01";const char VO_SQUAD02[]				= "fs_squad02";const char SND_ALARM[]				= "mod:Audio/FX/Misc/fire_alarm.wav";const char SND_GATE[]				= "mod:Audio/FX/Misc/fire_gate.wav";const char ANI_CLOSE[]				= "close";const char ANI_OPEN[]				= "open";const char VOSET_ROAD[]				= "Freely Accessible";const char VOSET_BARRICADE[]		= "Barricade";const char UNNAMED[]				= "Unnamed";const char HINT_NO_REPAIR[] 		= "There are no vehicles to repair!";const char HINT_REPAIRED[] 			= "All vehicles repaired!";int PRICE_REPAIR 					= 1000;int DummyGroup = 20;//******************************************************************************************// Police Station//******************************************************************************************const char NAME_CONTROLPANEL3[]				= "police_station_controlpanel";const char NAME_POLICESTATION[]				= "police_station";const char OBJ_CRUISER01[]					= "mod:Prototypes/Vehicles/03 LA Police/cv_lapd.e4p";const char OBJ_CRUISER02[]					= "mod:Prototypes/Vehicles/03 LA Police/dodge_charger_lapd.e4p";const char OBJ_CRUISER03[]					= "mod:Prototypes/Vehicles/03 LA Police/cv_chp.e4p";const char OBJ_CRUISER04[]					= "mod:Prototypes/Vehicles/03 LA Police/dodge_charger_chp.e4p";const char OBJ_VAN[]						= "mod:Prototypes/Vehicles/03 LA Police/lasd_van.e4p";const char OBJ_SUV[]						= "mod:Prototypes/Vehicles/03 LA Police/suv_lapd.e4p";const char OBJ_MOTOR[]						= "mod:Prototypes/Vehicles/03 LA Police/motorcycle_lapd.e4p";const char OBJ_DEPUTY[]						= "mod:Prototypes/Persons/03 LA Police/lasd_officer.e4p";const char OBJ_CHP[]						= "mod:Prototypes/Persons/03 LA Police/chp_officer.e4p";const char OBJ_OFFICER[]					= "mod:Prototypes/Persons/03 LA Police/lapd_officer_m.e4p";const char VO_FRONT01[]						= "policestation_park01";const char VO_FRONT02[]						= "policestation_park02";const char VO_FRONT03[]						= "policestation_park03";const char VO_BACK01[]						= "policestation_park04";const char VO_BACK02[]						= "policestation_park05";const char VO_BACK03[]						= "policestation_park06";const char VO_BACK04[]						= "policestation_park07";const char VO_DONUT01[]						= "policestation_donut01";const char VO_DONUT02[]						= "policestation_donut02";const char VO_SPAWN_FRONT[]					= "policestation_spawn";const char VO_SPAWN_BACK[]					= "spawn_police1";const char VO_SPAWN_DONUT[]					= "policestation_spawn2";const char VO_MOVETO_FRONT[]				= "policestation_moveto1";const char VO_MOVETO_BACK[]					= "spawn_police1r";const char VO_MOVETO_DONUT[]				= "policestation_moveto2";const char VO_SQUAD01_PD[]					= "police_squad01";const char VO_SQUAD02_PD[]					= "police_squad02";const char VO_SQUAD03_PD[]					= "police_squad03";//******************************************************************************************// Tech Station//******************************************************************************************const char NAME_CONTROLPANEL4[]			= "tech_station_controlpanel";const char NAME_TECHSTATION[]			= "tech_station";const char NAME_TECHSTATION_ROOF[]		= "tech_station_roof";const char OBJ_TECVAN[]					= "mod:Prototypes/Vehicles/04 LA Tec/engineer_vehicle.e4p";const char OBJ_ROLLBACK[]				= "mod:Prototypes/Vehicles/04 LA Tec/rollback.e4p";const char OBJ_ROLLBACK2[]				= "mod:Prototypes/Vehicles/04 LA Tec/tow_truck.e4p";const char VO_SPAWN_TT[]				= "TT_spawn";const char VO_SPAWN2_TT[]				= "TT_spawn2";const char VO_MOVETO_TT[]				= "TT_moveto";const char VO_PARK01[]					= "TT_park01";const char VO_PARK02[]					= "TT_park02";const char VO_PARK03[]					= "TT_park03";const char VO_PARK04[]					= "TT_park04";const char VO_PARK05[]					= "TT_park05";const char VO_PARK06[]					= "TT_park06";const char VO_PARK07[]					= "TT_park07";const char VO_PARK01_TT[]				= "TT_park01_tt";const char VO_PARK02_TT[]				= "TT_park02_tt";const char VO_PARK03_TT[]				= "TT_park03_tt";const char VO_PARK04_TT[]				= "TT_park04_tt";const char VO_PARK05_TT[]				= "TT_park05_tt";const char VO_PARK06_TT[]				= "TT_park06_tt";const char VO_PARK07_TT[]				= "TT_park07_tt";const char VO_DROPOFF1[]				= "TT_dropoff01";const char VO_DROPOFF2[]				= "TT_dropoff02";const char VO_DROPOFF1_TT[]				= "TT_dropoff01_tt";const char VO_DROPOFF2_TT[]				= "TT_dropoff02_tt";	const char NAME_GATE01T[]				= "TT_gate01";const char NAME_GATE02T[]				= "TT_gate02";const char NAME_GATE03T[]				= "TT_gate03";const char VO_GATE01T[]					= "TT_vogate01";const char VO_GATE02T[]					= "TT_vogate02";const char VO_GATE03T[]					= "TT_vogate03";const char VO_SQUAD01_TT[]				= "TT_squad01";//******************************************************************************************object VcmdAlarm : CommandScript{	VcmdAlarm()	{		SetCursor("alarm");		SetIcon("alarm");		SetPriority(200);	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			Caller->AssignCommand(DUMMY_ALARM);			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);			Caller->PushActionWait(ACTION_APPEND, 13.0f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(true);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}			GameObjectList l2; 			Game::CollectObstaclesOnVirtualObject(VO_BATTALION, l2, ACTOR_VEHICLE);			if(l2.GetNumObjects() > 0)			{				Vehicle m = l2.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 4, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);				}			}			GameObjectList l3; 			Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE01, l3, ACTOR_VEHICLE);			if(l3.GetNumObjects() > 0)			{				Vehicle m = l3.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l4; 			Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE02, l4, ACTOR_VEHICLE);			if(l4.GetNumObjects() > 0)			{				Vehicle m = l4.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l5; 			Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE03, l5, ACTOR_VEHICLE);			if(l5.GetNumObjects() > 0)			{				Vehicle m = l5.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l6; 			Game::CollectObstaclesOnVirtualObject(VO_LADDER, l6, ACTOR_VEHICLE);			if(l6.GetNumObjects() > 0)			{				Vehicle m = l6.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);				}			}			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, 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);				}			}			GameObjectList l8; 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE01, l8, ACTOR_VEHICLE);			if(l8.GetNumObjects() > 0)			{				Vehicle m = l8.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_ENGINE01) == 0)					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l9; 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE02, l9, ACTOR_VEHICLE);			if(l9.GetNumObjects() > 0)			{				Vehicle m = l9.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_ENGINE01) == 0)					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l10; 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE03, l10, ACTOR_VEHICLE);			if(l10.GetNumObjects() > 0)			{				Vehicle m = l10.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_ENGINE01) == 0)					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l11; 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE04, l11, ACTOR_VEHICLE);			if(l11.GetNumObjects() > 0)			{				Vehicle m = l11.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_ENGINE01) == 0)					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionWait(ACTION_NEWLIST, 2.0f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, 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		{			Caller->AssignCommand(DUMMY_ALARM);			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);			Caller->PushActionWait(ACTION_APPEND, 14.0f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);			GameObjectList l1 = Game::GetGameObjects(NAME_POLICESTATION);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(false);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}			GameObjectList l2; 			Game::CollectObstaclesOnVirtualObject(VO_AMBULANCE04, l2, ACTOR_VEHICLE);			if(l2.GetNumObjects() > 0)			{				Vehicle m = l2.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					if(StrCompare(m.GetPrototypeFileName(), OBJ_AMBULANCE01) == 0)					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					} else					{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 2, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					}				}			}			GameObjectList l3; 			Game::CollectObstaclesOnVirtualObject(VO_ENGINE05, l3, ACTOR_VEHICLE);			if(l3.GetNumObjects() > 0)			{				Vehicle m = l3.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 2.0f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);				}			}			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, 1, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 1, false);				}			}		}//******************************************************************************************// Police Station//******************************************************************************************		if(Caller->HasName(NAME_CONTROLPANEL3)) //= police station		{			Caller->AssignCommand(DUMMY_ALARM);			Caller->PushActionWait(ACTION_APPEND, 15.0f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);			GameObjectList l1 = Game::GetGameObjects(NAME_POLICESTATION);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(false);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}			GameObjectList l2; 			Game::CollectObstaclesOnVirtualObject(VO_BACK01, l2, ACTOR_VEHICLE);			if(l2.GetNumObjects() > 0)			{				Vehicle m = l2.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 12, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 12, false);				}			}			GameObjectList l3; 			Game::CollectObstaclesOnVirtualObject(VO_BACK02, l3, ACTOR_VEHICLE);			if(l3.GetNumObjects() > 0)			{				Vehicle m = l3.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 12, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 12, false);				}			}			GameObjectList l4; 			Game::CollectObstaclesOnVirtualObject(VO_BACK03, l4, ACTOR_VEHICLE);			if(l4.GetNumObjects() > 0)			{				Vehicle m = l4.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 13, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);				}			}			GameObjectList l5; 			Game::CollectObstaclesOnVirtualObject(VO_BACK04, l5, ACTOR_VEHICLE);			if(l5.GetNumObjects() > 0)			{				Vehicle m = l5.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 11, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 11, false);				}			}			GameObjectList l6; 			Game::CollectObstaclesOnVirtualObject(VO_DONUT01, l6, ACTOR_VEHICLE);			if(l6.GetNumObjects() > 0)			{				Vehicle m = l6.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);				}			}			GameObjectList l7; 			Game::CollectObstaclesOnVirtualObject(VO_DONUT02, l7, ACTOR_VEHICLE);			if(l7.GetNumObjects() > 0)			{				Vehicle m = l7.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{					m.PushActionWait(ACTION_NEWLIST, 1.4f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);					m.PushActionWait(ACTION_APPEND, 0.5f);					m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 13, false);				}			}		}//******************************************************************************************// Tech Station//******************************************************************************************		if(Caller->HasName(NAME_CONTROLPANEL4)) //= tech station		{			Caller->PushActionWait(ACTION_NEWLIST, 1.5f);			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 11, false);			GameObjectList l2; 			Game::CollectObstaclesOnVirtualObject(VO_PARK01, l2, ACTOR_VEHICLE);			if(l2.GetNumObjects() > 0)			{				Vehicle m = l2.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 21, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 21, false);				}			}			GameObjectList l3; 			Game::CollectObstaclesOnVirtualObject(VO_PARK02, l3, ACTOR_VEHICLE);			if(l3.GetNumObjects() > 0)			{				Vehicle m = l3.GetObject(0);				PersonList passengers = m.GetPassengers();				if (passengers.GetNumPersons() == 0)				{						m.PushActionExecuteCommand(ACTION_NEWLIST, DUMMY_CALLCREW, Caller, 21, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 21, false);				}			}			GameObjectList l4; 			Game::CollectObstaclesOnVirtualObject(VO_PARK03, 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, 21, false);						m.PushActionWait(ACTION_APPEND, 0.5f);						m.PushActionExecuteCommand(ACTION_APPEND, DUMMY_CALLCREW, Caller, 21, false);				}			}		}//******************************************************************************************	}};object VcmdRoof : CommandScript{	VcmdRoof()	{		SetCursor("roof");		SetIcon("roof");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION_ROOF);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if(obj->GetUserData() == 0)				{					obj->Hide(); 					obj->SetUserData(1);				} else				{					obj->Show(); 					obj->SetUserData(0);				} 			}		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2_ROOF);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if(obj->GetUserData() == 0)				{					obj->Hide(); 					obj->SetUserData(1);				} else				{					obj->Show(); 					obj->SetUserData(0);				} 			}		}		if(Caller->HasName(NAME_CONTROLPANEL4)) //= tech station		{			GameObjectList l1 = Game::GetGameObjects(NAME_TECHSTATION_ROOF);			for(int i=0; i < l1.GetNumObjects(); i++)			{				GameObject *obj = l1.GetObject(i);				if(obj->GetUserData() == 0)				{					obj->Hide(); 					obj->SetUserData(1);				} else				{					obj->Show(); 					obj->SetUserData(0);				} 			}		}	}};object VcmdGarageDoorsUp : CommandScript{	VcmdGarageDoorsUp()	{		SetCursor("garagedoorup");		SetIcon("garagedoorup");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 1, false);		else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 3, false);		else if(Caller->HasName(NAME_CONTROLPANEL4)) //= tech station 			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 11, false);		else			Mission::Playhint("Which garage doors should open then?");		return;	}};object VcmdGarageDoorsDown : CommandScript{	VcmdGarageDoorsDown()	{		SetCursor("garagedoordown");		SetIcon("garagedoordown");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 2, false);		else if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 4, false);		else if(Caller->HasName(NAME_CONTROLPANEL4)) //= tech station 			Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_GATES, Caller, 12, false);		else			Mission::Playhint("Which garage doors should close then?");		return;	}};object VcmdCallEMT : CommandScript{	VcmdCallEMT()	{		SetCursor("alarm");		SetIcon("callemt");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_EMT, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallEMTSCBA : CommandScript{	VcmdCallEMTSCBA()	{		SetCursor("alarm");		SetIcon("callemtscba");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_EMT_SCBA, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallEMTStretcher : CommandScript{	VcmdCallEMTStretcher()	{		SetCursor("alarm");		SetIcon("callemtstretcher");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_EMT_STRETCHER, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			//p.SetAutoHealDistance(0.1f);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallPM : CommandScript{	VcmdCallPM()	{		SetCursor("alarm");		SetIcon("callpm");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_PM, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.SetEquipment(EQUIP_EMERGENCY_CASE);			//p.SetAutoHealDistance(1000.f);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallPMSCBA : CommandScript{	VcmdCallPMSCBA()	{		SetCursor("alarm");		SetIcon("callpmscba");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_PM_SCBA, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			//p.SetEquipment(EQUIP_EMERGENCY_CASE);			//p.SetAutoHealDistance(0.1f);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallPMStretcher : CommandScript{	VcmdCallPMStretcher()	{		SetCursor("alarm");		SetIcon("callpmstretcher");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();						Person p = Game::CreatePerson(OBJ_PM_STRETCHER, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			//p.SetAutoHealDistance(0.1f);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallDiver : CommandScript{	VcmdCallDiver()	{		SetCursor("alarm");		SetIcon("calldiver");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();						Person p = Game::CreatePerson(OBJ_DIVER, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallHazmat : CommandScript{	VcmdCallHazmat()	{		SetCursor("alarm");		SetIcon("callhazmat");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();						Person p = Game::CreatePerson(OBJ_HAZMAT, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallUSARFF : CommandScript{	VcmdCallUSARFF()	{		SetCursor("alarm");		SetIcon("callusar");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			ActorList l2 = Game::GetActors(VO_MOVETO01);		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			ActorList l2 = Game::GetActors(VO_MOVETO02);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();						Person p = Game::CreatePerson(OBJ_USARFF, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};//******************************************************************************************// Police Station//******************************************************************************************object VcmdCallDeputy : CommandScript{	VcmdCallDeputy()	{		SetCursor("calldeputy");		SetIcon("calldeputy");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL3)) //= policestation		{			ActorList l1 = Game::GetActors(VO_SPAWN_FRONT);			ActorList l2 = Game::GetActors(VO_MOVETO_FRONT);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_DEPUTY, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallCHP : CommandScript{	VcmdCallCHP()	{		SetCursor("callchp");		SetIcon("callchp");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL3)) //= policestation		{			ActorList l1 = Game::GetActors(VO_SPAWN_FRONT);			ActorList l2 = Game::GetActors(VO_MOVETO_FRONT);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_CHP, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};object VcmdCallOfficer : CommandScript{	VcmdCallOfficer()	{		SetCursor("callofficer");		SetIcon("callofficer");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL3)) //= policestation		{			ActorList l1 = Game::GetActors(VO_SPAWN_FRONT);			ActorList l2 = Game::GetActors(VO_MOVETO_FRONT);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l1.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_OFFICER, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}		}};//******************************************************************************************// Tech Station//******************************************************************************************object VcmdCallEngineer : CommandScript{	VcmdCallEngineer()	{		SetCursor("callengineer");		SetIcon("callengineer");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL4)) //= tech station		{//			ActorList l1 = Game::GetActors(VO_SPAWN_TT);			ActorList l2 = Game::GetActors(VO_MOVETO_TT);			ActorList l3 = Game::GetActors(VO_SPAWN2_TT);		}		if(l1.GetNumActors() > 0)			Vector Spawn = l3.GetActor(0)->GetPosition();		else			Vector Spawn = l3.GetActor(0)->GetPosition();		if(l2.GetNumActors() > 0)			Vector MoveTo = l2.GetActor(0)->GetPosition();				Person p = Game::CreatePerson(OBJ_ENGINEER, UNNAMED);		if (Game::FindFreePosition(&p, Spawn))		{			p.SetUpgradeLevel(3);			Game::FindFreePosition(&p, Spawn);			p.SetPosition(Spawn);			p.PushActionMove(ACTION_NEWLIST, MoveTo);		}	}};//******************************************************************************************object VcmdEmptyFireStation : CommandScript{	VcmdEmptyFireStation()	{		SetIcon("enterhouse");		SetCursor("enterhouse");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay())			return false;		return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if(Caller->HasName(NAME_CONTROLPANEL)) //= fire station 1		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			if(l1.GetNumActors() > 0)				Vector Spawn = l1.GetActor(0)->GetPosition();			GameObjectList l2;			Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l2, ACTOR_PERSON);			for(int i = 0; i < l2.GetNumObjects(); i++)			{				GameObject *obj = l2.GetObject(i);				if (obj->GetType() == ACTOR_PERSON)				{					Person p(obj);					p.PushActionMove(ACTION_NEWLIST, Spawn);					p.PushActionDeleteOwner(ACTION_APPEND);				}			}		}		if(Caller->HasName(NAME_CONTROLPANEL2)) //= fire station 2		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			if(l1.GetNumActors() > 0)				Vector Spawn = l1.GetActor(0)->GetPosition();			GameObjectList l2;			Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l2, ACTOR_PERSON);			for(int i = 0; i < l2.GetNumObjects(); i++)			{				GameObject *obj = l2.GetObject(i);				if (obj->GetType() == ACTOR_PERSON)				{					Person p(obj);					p.PushActionMove(ACTION_NEWLIST, Spawn);					p.PushActionDeleteOwner(ACTION_APPEND);				}			}		}	}};object DummyDisableAlarm : CommandScript{	DummyDisableAlarm()	{ 		SetGroupID(DummyGroup);	} 	bool CheckGroupVisibility(GameObject *Caller) 	{ 		return false; 	}  	bool CheckPossible(GameObject *Caller) 	{ 		return false; 	} 	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			v.RemoveCommand(DUMMY_ALARM);		if(Caller->HasName(NAME_CONTROLPANEL) || Caller->HasName(NAME_FIRESTATION)) //= fire Station 1			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION);		else if(Caller->HasName(NAME_CONTROLPANEL2) || Caller->HasName(NAME_FIRESTATION2)) //= fire Station 2			GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2);		else if(Caller->HasName(NAME_CONTROLPANEL3) || Caller->HasName(NAME_POLICESTATION)) //= Police Station			GameObjectList l1 = Game::GetGameObjects(NAME_POLICESTATION);		else			Mission::PlayHint("No Station at all!");			System::Log("No Station at all!");			return;		for(int i=0; i < l1.GetNumObjects(); i++)		{			GameObject *obj = l1.GetObject(i);			obj->EnableSpecialLights(false);			int ref = obj->GetUserData();			obj->UnattachSound(ref);			Audio::StopSample(ref);		}	}};object DummyCallCrew : CommandScript{	DummyCallCrew()	{ 		SetGroupID(DummyGroup);	} 	bool CheckGroupVisibility(GameObject *Caller) 	{ 		return false; 	}  	bool CheckPossible(GameObject *Caller) 	{ 		return false; 	} 	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		Vehicle v(Caller);		if(v.IsCollidingWithVirtualObject(VO_SQUAD01))		{			ActorList l1 = Game::GetActors(VO_SPAWN01);			if(l1.GetNumActors() > 0)				Vector Spawn = l1.GetActor(0)->GetPosition();			GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION);			for(int i=0; i < l2.GetNumObjects(); i++)			{				GameObject *obj = l2.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(true);					obj->PushActionWait(ACTION_NEWLIST, 16.0f);					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}		}		else if(v.IsCollidingWithVirtualObject(VO_SQUAD02))		{			ActorList l1 = Game::GetActors(VO_SPAWN03);			if(l1.GetNumActors() > 0)				Vector Spawn = l1.GetActor(0)->GetPosition();			GameObjectList l2 = Game::GetGameObjects(NAME_FIRESTATION2);			for(int i=0; i < l2.GetNumObjects(); i++)			{				GameObject *obj = l2.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(true);					obj->PushActionWait(ACTION_NEWLIST, 16.0f);					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}		} 		else if(v.IsCollidingWithVirtualObject(VO_SQUAD01_PD))		{			ActorList l1 = Game::GetActors(VO_SPAWN_FRONT);			if(l1.GetNumActors() > 0)				Vector Spawn = l1.GetActor(0)->GetPosition();			GameObjectList l2 = Game::GetGameObjects(NAME_POLICESTATION);			for(int i=0; i < l2.GetNumObjects(); i++)			{				GameObject *obj = l2.GetObject(i);				if (!obj->IsSpecialLightEnabled())				{					obj->EnableSpecialLights(false);					obj->PushActionWait(ACTION_NEWLIST, 16.0f);					obj->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ALARM, Caller, 1, false);					Vector AlarmSnd = obj->GetPosition();					int soundID = Audio::PlaySample3D(SND_ALARM, AlarmSnd, true);					obj->SetUserData(soundID);					obj->AttachSound(soundID);				}			}		}		else if(v.IsCollidingWithVirtualObject(VO_SQUAD02_PD))		{			ActorList l1 = Game::GetActors(VO_SPAWN_BACK);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}		}		else if(v.IsCollidingWithVirtualObject(VO_SQUAD03_PD))		{			ActorList l1 = Game::GetActors(VO_SPAWN_DONUT);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}		} 		else if(v.IsCollidingWithVirtualObject(VO_SQUAD01_TT))		{  			ActorList l1 = Game::GetActors(VO_SPAWN_TT);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}		}		else		{			ActorList l1 = Game::GetActors(VO_SPAWN02);			if(l1.GetNumActors() > 0)			{				Vector Spawn = l1.GetActor(0)->GetPosition();			}		}		PersonList passengers = v.GetPassengers();		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 == 11)			Person p = Game::CreatePerson(OBJ_DEPUTY, UNNAMED);		else if (ChildID == 12)			Person p = Game::CreatePerson(OBJ_CHP, UNNAMED);		else if (ChildID == 13)			Person p = Game::CreatePerson(OBJ_OFFICER, UNNAMED);		else if (ChildID == 21)			Person p = Game::CreatePerson(OBJ_ENGINEER, UNNAMED);		else			return;		p.SetUpgradeLevel(3);		Game::FindFreePosition(&p, Spawn, 250);		p.SetPosition(Spawn);		p.PushActionMove(ACTION_NEWLIST, &v, TARGET_ANY);		p.PushActionTurnTo(ACTION_APPEND, &v);		p.PushActionEnterCar(ACTION_APPEND, &v);	}};object DummyGates : CommandScript{	DummyGates()	{ 		SetGroupID(DummyGroup);	} 	bool CheckGroupVisibility(GameObject *Caller) 	{ 		return false; 	}  	bool CheckPossible(GameObject *Caller) 	{ 		return false; 	} 	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		GameObjectList gate01a = Game::GetGameObjects(NAME_GATE01A);		GameObjectList gate02a = Game::GetGameObjects(NAME_GATE02A);		GameObjectList gate03a = Game::GetGameObjects(NAME_GATE03A);		GameObjectList gate04a = Game::GetGameObjects(NAME_GATE04A);		GameObjectList gate05a = Game::GetGameObjects(NAME_GATE05A);		GameObjectList gate06a = Game::GetGameObjects(NAME_GATE06A);		GameObjectList gate07a = Game::GetGameObjects(NAME_GATE07A);		GameObjectList gate08a = Game::GetGameObjects(NAME_GATE08A);		GameObjectList gate01b = Game::GetGameObjects(NAME_GATE01B);		GameObjectList gate02b = Game::GetGameObjects(NAME_GATE02B);		GameObjectList gate03b = Game::GetGameObjects(NAME_GATE03B);		GameObjectList gate04b = Game::GetGameObjects(NAME_GATE04B);		GameObjectList gate05b = Game::GetGameObjects(NAME_GATE05B); 		GameObjectList gate06b = Game::GetGameObjects(NAME_GATE06B);		GameObjectList gate07b = Game::GetGameObjects(NAME_GATE07B);		GameObjectList gate08b = Game::GetGameObjects(NAME_GATE08B); 		GameObjectList gate01t = Game::GetGameObjects(NAME_GATE01T); 		GameObjectList gate02t = Game::GetGameObjects(NAME_GATE02T); 		GameObjectList gate03t = Game::GetGameObjects(NAME_GATE03T); 		ActorList vogate01a = Game::GetActors(VO_GATE01A); 		ActorList vogate02a = Game::GetActors(VO_GATE02A);		ActorList vogate03a = Game::GetActors(VO_GATE03A); 		ActorList vogate04a = Game::GetActors(VO_GATE04A);		ActorList vogate05a = Game::GetActors(VO_GATE05A); 		ActorList vogate06a = Game::GetActors(VO_GATE06A); 		ActorList vogate07a = Game::GetActors(VO_GATE07A);		ActorList vogate08a = Game::GetActors(VO_GATE08A);  		ActorList vogate01b = Game::GetActors(VO_GATE01B);		ActorList vogate02b = Game::GetActors(VO_GATE02B);		ActorList vogate03b = Game::GetActors(VO_GATE03B);		ActorList vogate04b = Game::GetActors(VO_GATE04B);		ActorList vogate05b = Game::GetActors(VO_GATE05B);		ActorList vogate06b = Game::GetActors(VO_GATE06B);		ActorList vogate07b = Game::GetActors(VO_GATE07B);		ActorList vogate08b = Game::GetActors(VO_GATE08B);		ActorList vogate01t = Game::GetActors(VO_GATE01T);		ActorList vogate02t = Game::GetActors(VO_GATE02T);		ActorList vogate03t = Game::GetActors(VO_GATE03T);		if(ChildID == 1) //= Open front gates fire station 1		{			for(int i=0; i < gate01a.GetNumObjects(); i++)			{				GameObject *gate = gate01a.GetObject(i);				Actor *vogate = vogate01a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			for(int i=0; i < gate02a.GetNumObjects(); i++)			{				GameObject *gate = gate02a.GetObject(i);				Actor *vogate = vogate02a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			for(int i=0; i < gate03a.GetNumObjects(); i++)			{				GameObject *gate = gate03a.GetObject(i);				Actor *vogate = vogate03a.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);				}			}			for(int i=0; i < gate04a.GetNumObjects(); i++)			{				GameObject *gate = gate04a.GetObject(i);				Actor *vogate = vogate04a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			for(int i=0; i < gate05a.GetNumObjects(); i++)			{				GameObject *gate = gate05a.GetObject(i);				Actor *vogate = vogate05a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}		}		if(ChildID == 2) //= Close all opened gates fire station 1		{			for(int i=0; i < gate01a.GetNumObjects(); i++)			{				GameObject *gate = gate01a.GetObject(i);				Actor *vogate = vogate01a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate02a.GetNumObjects(); i++)			{				GameObject *gate = gate02a.GetObject(i);				Actor *vogate = vogate02a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate03a.GetNumObjects(); i++)			{				GameObject *gate = gate03a.GetObject(i);				Actor *vogate = vogate03a.GetActor(i);				Vector GateSnd = gate->GetPosition();				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);					Audio::PlaySample3D(SND_GATE, GateSnd);				}			}			for(int i=0; i < gate04a.GetNumObjects(); i++)			{				GameObject *gate = gate04a.GetObject(i);				Actor *vogate = vogate04a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate05a.GetNumObjects(); i++)			{				GameObject *gate = gate05a.GetObject(i);				Actor *vogate = vogate05a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate01b.GetNumObjects(); i++)			{				GameObject *gate = gate01b.GetObject(i);				Actor *vogate = vogate01b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate02b.GetNumObjects(); i++)			{				GameObject *gate = gate02b.GetObject(i);				Actor *vogate = vogate02b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate03b.GetNumObjects(); i++)			{				GameObject *gate = gate03b.GetObject(i);				Actor *vogate = vogate03b.GetActor(i);				Vector GateSnd = gate->GetPosition();				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);					Audio::PlaySample3D(SND_GATE, GateSnd);				}			}			for(int i=0; i < gate04b.GetNumObjects(); i++)			{				GameObject *gate = gate04b.GetObject(i);				Actor *vogate = vogate04b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate05b.GetNumObjects(); i++)			{				GameObject *gate = gate05b.GetObject(i);				Actor *vogate = vogate05b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}		}		if(ChildID == 3) //= Open front gates fire station 2		{			for(int i=0; i < gate06a.GetNumObjects(); i++)			{				GameObject *gate = gate06a.GetObject(i);				Actor *vogate = vogate06a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			for(int i=0; i < gate07a.GetNumObjects(); i++)			{				GameObject *gate = gate07a.GetObject(i);				Actor *vogate = vogate07a.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			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);				}			}		}		if(ChildID == 4) //= Close all opened gates fire station 2		{			for(int i=0; i < gate06a.GetNumObjects(); i++)			{				GameObject *gate = gate06a.GetObject(i);				Actor *vogate = vogate06a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate07a.GetNumObjects(); i++)			{				GameObject *gate = gate07a.GetObject(i);				Actor *vogate = vogate07a.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			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() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);					Audio::PlaySample3D(SND_GATE, GateSnd);				}			}			for(int i=0; i < gate06b.GetNumObjects(); i++)			{				GameObject *gate = gate06b.GetObject(i);				Actor *vogate = vogate06b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate07b.GetNumObjects(); i++)			{				GameObject *gate = gate07b.GetObject(i);				Actor *vogate = vogate07b.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate08b.GetNumObjects(); i++)			{				GameObject *gate = gate08b.GetObject(i);				Actor *vogate = vogate08b.GetActor(i);				Vector GateSnd = gate->GetPosition();				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);					Audio::PlaySample3D(SND_GATE, GateSnd);				}			}		}		if(ChildID == 5) //= Battalion chief 'calls vehicle cmds' for opening/closing front gates fire station 1		{			Vehicle v(Caller);			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				for(int i=0; i < gate01a.GetNumObjects(); i++)				{					GameObject *gate = gate01a.GetObject(i);					Actor *vogate = vogate01a.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)			{				for(int i=0; i < gate02a.GetNumObjects(); i++)				{					GameObject *gate = gate02a.GetObject(i);					Actor *vogate = vogate02a.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)			{				for(int i=0; i < gate03a.GetNumObjects(); i++)				{					GameObject *gate = gate03a.GetObject(i);					Actor *vogate = vogate03a.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)			{				for(int i=0; i < gate04a.GetNumObjects(); i++)				{					GameObject *gate = gate04a.GetObject(i);					Actor *vogate = vogate04a.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);					}				}				}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate05a.GetNumObjects(); i++)				{					GameObject *gate = gate05a.GetObject(i);					Actor *vogate = vogate05a.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);					}				}			}		}		if(ChildID == 6) //= Battalion chief 'calls vehicle cmds' for opening/closing front gates fire station 2		{			Vehicle v(Caller);			if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0)			{				for(int i=0; i < gate06a.GetNumObjects(); i++)				{					GameObject *gate = gate06a.GetObject(i);					Actor *vogate = vogate06a.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate07a.GetNumObjects(); i++)				{					GameObject *gate = gate07a.GetObject(i);					Actor *vogate = vogate07a.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);					}				}				}			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				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);					}				}			}		}		if(ChildID == 7) //To fire station cmd to open rear gates fire station 1		{			Vehicle v(Caller);			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				for(int i=0; i < gate01b.GetNumObjects(); i++)				{					GameObject *gate = gate01b.GetObject(i);					Actor *vogate = vogate01b.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)			{				for(int i=0; i < gate02b.GetNumObjects(); i++)				{					GameObject *gate = gate02b.GetObject(i);					Actor *vogate = vogate02b.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)			{				for(int i=0; i < gate03b.GetNumObjects(); i++)				{					GameObject *gate = gate03b.GetObject(i);					Actor *vogate = vogate03b.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)			{				for(int i=0; i < gate04b.GetNumObjects(); i++)				{					GameObject *gate = gate04b.GetObject(i);					Actor *vogate = vogate04b.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);					}				}				}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate05b.GetNumObjects(); i++)				{					GameObject *gate = gate05b.GetObject(i);					Actor *vogate = vogate05b.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);					}				}			}		}		if(ChildID == 8) //To fire station cmd to open rear gates fire station 2		{			Vehicle v(Caller);			if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0)			{				for(int i=0; i < gate06b.GetNumObjects(); i++)				{					GameObject *gate = gate06b.GetObject(i);					Actor *vogate = vogate06b.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);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate07b.GetNumObjects(); i++)				{					GameObject *gate = gate07b.GetObject(i);					Actor *vogate = vogate07b.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);					}				}				}			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				for(int i=0; i < gate08b.GetNumObjects(); i++)				{					GameObject *gate = gate08b.GetObject(i);					Actor *vogate = vogate08b.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);					}				}			}		}		if(ChildID == 9) //To fire station cmd to close rear gates fire station 1		{			Vehicle v(Caller);			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				for(int i=0; i < gate01b.GetNumObjects(); i++)				{					GameObject *gate = gate01b.GetObject(i);					Actor *vogate = vogate01b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_USAR) == 0)			{				for(int i=0; i < gate02b.GetNumObjects(); i++)				{					GameObject *gate = gate02b.GetObject(i);					Actor *vogate = vogate02b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_LADDER) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_TILLER) == 0)			{				for(int i=0; i < gate03b.GetNumObjects(); i++)				{					GameObject *gate = gate03b.GetObject(i);					Actor *vogate = vogate03b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0)			{				for(int i=0; i < gate04b.GetNumObjects(); i++)				{					GameObject *gate = gate04b.GetObject(i);					Actor *vogate = vogate04b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate05b.GetNumObjects(); i++)				{					GameObject *gate = gate05b.GetObject(i);					Actor *vogate = vogate05b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}		}		if(ChildID == 10) //To fire station cmd to close rear gates fire station 2		{			Vehicle v(Caller);			if(StrCompare(v.GetPrototypeFileName(), OBJ_HAZMATSQUAD) == 0)			{				for(int i=0; i < gate06b.GetNumObjects(); i++)				{					GameObject *gate = gate06b.GetObject(i);					Actor *vogate = vogate06b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if(StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE01) == 0 || StrCompare(v.GetPrototypeFileName(), OBJ_ENGINE02) == 0)			{				for(int i=0; i < gate07b.GetNumObjects(); i++)				{					GameObject *gate = gate07b.GetObject(i);					Actor *vogate = vogate07b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}			if (v.GetVehicleType() == VT_AMBULANCE_RTW) 			{				for(int i=0; i < gate08b.GetNumObjects(); i++)				{					GameObject *gate = gate08b.GetObject(i);					Actor *vogate = vogate08b.GetActor(i);					Vector GateSnd = gate->GetPosition();					if (gate->GetUserData() == 1)					{						gate->SetUserData(0);						gate->SetAnimation(ANI_CLOSE);						vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);						Audio::PlaySample3D(SND_GATE, GateSnd);					}				}			}		}//******************************************************************************************// Tech Station//******************************************************************************************		if(ChildID == 11) //= Open gates tech station		{			for(int i=0; i < gate01t.GetNumObjects(); i++)			{				GameObject *gate = gate01t.GetObject(i);				Actor *vogate = vogate01t.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}			for(int i=0; i < gate02t.GetNumObjects(); i++)			{				GameObject *gate = gate02t.GetObject(i);				Actor *vogate = vogate02t.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);				}			}			for(int i=0; i < gate03t.GetNumObjects(); i++)			{				GameObject *gate = gate03t.GetObject(i);				Actor *vogate = vogate03t.GetActor(i);				if (gate->GetUserData() == 0)				{ 					gate->SetUserData(1);					gate->SetAnimation(ANI_OPEN);					vogate->SetVirtualObjectTerrain(VOSET_ROAD);				}			}		}		if(ChildID == 12) //= Close all opened gates tech station		{			for(int i=0; i < gate01t.GetNumObjects(); i++)			{				GameObject *gate = gate01t.GetObject(i);				Actor *vogate = vogate01t.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}			for(int i=0; i < gate02t.GetNumObjects(); i++)			{				GameObject *gate = gate02t.GetObject(i);				Actor *vogate = vogate02t.GetActor(i);				Vector GateSnd = gate->GetPosition();				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);					Audio::PlaySample3D(SND_GATE, GateSnd);				}			}			for(int i=0; i < gate03t.GetNumObjects(); i++)			{				GameObject *gate = gate03t.GetObject(i);				Actor *vogate = vogate03t.GetActor(i);				if (gate->GetUserData() == 1)				{ 					gate->SetUserData(0);					gate->SetAnimation(ANI_CLOSE);					vogate->SetVirtualObjectTerrain(VOSET_BARRICADE);				}			}		}//******************************************************************************************	}};object VcmdAutoStaffOn : CommandScript{	VcmdAutoStaffOn()	{		SetIcon("autostaffon");		SetCursor("autostaffon");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid() || !Game::IsFreeplay())			return false;					return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		Caller->RemoveCommand("VcmdAutoStaffOn");		Caller->AssignCommand("VcmdAutoStaffOff");	}};object VcmdAutoStaffOff : CommandScript{	VcmdAutoStaffOff()	{		SetIcon("autostaffoff");		SetCursor("autostaffoff");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid() || !Game::IsFreeplay())			return false;					return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid() || (Caller->GetID() != Target->GetID()))			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		Caller->RemoveCommand("VcmdAutoStaffOff");		Caller->AssignCommand("VcmdAutoStaffOn");	}};object VcmdRepairVehicles : CommandScript{	VcmdRepairVehicles()	{		SetCursor("repair");		SetIcon("repair");	}	bool CheckPossible(GameObject *Caller)	{		if (!Caller->IsValid())			return false;		if (!Game::IsFreeplay() && !Game::IsMultiplayer())			return false;					int Money = Mission::GetMoneyLeft();		if (Money < PRICE_REPAIR)			return false;								Vehicle v(Caller);		if (v.HasCommand(DUMMY_ALARM))			return false;			return true;	}	bool CheckTarget(GameObject *Caller, Actor *Target, int childID)	{		if (!Caller->IsValid() || !Target->IsValid())			return false;		return true;	}	void PushActions(GameObject *Caller, Actor *Target, int ChildID)	{		if (ChildID == 0)		{			Vehicle cp(Caller);			GameObjectList l1;			ActorList l2, l3;			if(Caller->HasName(NAME_CONTROLPANEL))			{				Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l1, ACTOR_VEHICLE);				l2 = Game::GetActors(VO_SPAWN01);				l3 = Game::GetActors(VO_MOVETO01);			}			else if(Caller->HasName(NAME_CONTROLPANEL2))			{				Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l1, ACTOR_VEHICLE);				l2 = Game::GetActors(VO_SPAWN02);				l3 = Game::GetActors(VO_MOVETO02);			}						Vector Spawn = l2.GetActor(0)->GetPosition();			Vector MoveTo = l3.GetActor(0)->GetPosition();			bool repair = false;			for(int i=0; i < l1.GetNumObjects(); i++)			{				if (!repair)				{					Vehicle obj = l1.GetObject(i);					if (!obj.HasCommand(DUMMY_VCALLED) && obj.GetEnergy() < obj.GetMaxEnergy())						repair = true;				}			}			if (repair)			{				int Money = Mission::GetMoneyLeft();				if (Money >= PRICE_REPAIR)				{					int NewMoney = Money - PRICE_REPAIR;					Mission::SetMoney(NewMoney);							}							Person p = Game::CreatePerson(OBJ_ENGINEER, UNNAMED);				if (Game::FindFreePosition(&p, Spawn))				{					p.SetUpgradeLevel(3);					p.SetEquipment(EQUIP_THW_CASE);					Game::FindFreePosition(&p, Spawn);					p.SetPosition(Spawn);					p.PushActionMove(ACTION_NEWLIST, MoveTo);					p.PushActionExecuteCommand(ACTION_APPEND, "VcmdRepairVehicles", &cp, 1, false);				}			} else				Mission::PlayHint(HINT_NO_REPAIR);		}		if (ChildID == 1)		{			Person p(Caller);			Vehicle cp(Target);			GameObjectList l1;			ActorList l2;			bool repair = false;						if(cp.HasName(NAME_CONTROLPANEL))			{				Game::CollectObstaclesOnVirtualObject(VO_SQUAD01, l1, ACTOR_VEHICLE);				l2 = Game::GetActors(VO_SPAWN01);			}				if(cp.HasName(NAME_CONTROLPANEL2))			{				Game::CollectObstaclesOnVirtualObject(VO_SQUAD02, l1, ACTOR_VEHICLE);				l2 = Game::GetActors(VO_SPAWN02);			}						Vector Delete = l2.GetActor(0)->GetPosition();						for(int i=0; i < l1.GetNumObjects(); i++)			{				if (!repair)				{					Vehicle obj = l1.GetObject(i);					if (!obj.HasCommand(DUMMY_VCALLED) && obj.GetEnergy() < obj.GetMaxEnergy())						repair = true;				}			}			if (repair)			{				p.PushActionMove(ACTION_NEWLIST, &obj, TARGET_ANY);				p.PushActionTurnTo(ACTION_APPEND, &obj);				p.PushActionRepair(ACTION_APPEND, &obj);				p.PushActionExecuteCommand(ACTION_APPEND, "VcmdRepairVehicles", &cp, 1, false);			} else			{				Mission::PlayHint(HINT_REPAIRED);				p.PushActionMove(ACTION_NEWLIST, Delete);				p.PushActionDeleteOwner(ACTION_APPEND);			}					}	}}; 

  11. Hey guys,

     

    I've found above statements in the LAFireStation script in the LA mod, but I assume this works for every mod.

     

    The statements are used in a dummy and  command where the target vehicle is random, namely the dummy that spawns personnel for vehicles that are empty in the firestation, and a command that repairs any damaged vehicles in the fire station (by spawning an engineer and making it repair them).

     

    Considering above bit of text, I assume the & thingy is something like a location finder? It finds where the vehicle is so it can send the personnel to the right spot?

     

    And the TARGET_ANY thingy, is that something like Actors, Roles and Behaviors? If so, how does it work? If not, how does it work?

     

    Hope you can help

     

    Tim

  12. Well, it cán be done. The only problem is: it needs more scripting then just adding the ChangeClothes script before the EnterVehicle bit. It's not complicated, but you need a few extra VO's, and you'd need to direct the personnel to those VO's first, then make them change clothes, and then make them enter the vehicle.

     

    I hope I get my school stuff done in a few hours, then I'll give you a more detailed explanation. 

     

    --------------

     

    Well crap.. I had a huuuge post set up, with all kinds of scripting, but it was getting too complicated to just post it on here. 

    I was trying to send all personnel to a specific VO and make them change clothes there, which was OK, but making sure they don't go to the same VO was a bit too much for me without being able to test it and having all needed scripts. But if I may ask: You call this vehicle out, so I assume you're at a different location, not at the fire station. Why would you bother for this animation then? You probably wouldn't see it much.

×
×
  • Create New...