Jump to content
rafaelmfernandez

Tower Ladder Script [Released]

Recommended Posts

This requires you to model a Tower Ladder (Normal Version) and then a Tower Ladder that has its jacks down and ready to go.

 

Now this script works pretty well but there are a couple of bugs I have to work on to make it perfect.

//******************************************************************************************// #Version 0.1a# BROOKLYN MODIFICATION TOWER LADDER SCRIPT//// 		Includes: All TowerLadder Commands////	- LadderInstall//	- LadderUninstall////		Script by Rafael Based off of Hoppah's Crane and Tow Script//		//		Usage of this script in other mods is NOT allowed without CREDITS to Rafael & Hoppah////******************************************************************************************const char CMD_TOWERINSTALL[]		= "LadderInstall";const char CMD_TOWERDEINSTALL[]		= "LadderUninstall";const char CMD_MCU_DEINSTALL[]			= "VcmdMCUDeinstall";const char CMD_AUTOSIREN_OFF[] 			= "VcmdAutoSirenOff";const char CMD_AUTOSIREN_ON[] 			= "VcmdAutoSirenOn";const char PROTO_TOWER_LADDER[] 		= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_12.e4p";const char PROTO_TOWER_LADDER2] 		= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_35.e4p";const char PROTO_TOWER_LADDERDEP[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/usfs_enginerev2.e4p";const char PROTO_TOWER_LADDER2DEP[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/usfs_enginerev.e4p";const char DUMMY_LIGHTS[] 				= "DummyLights";const char DUMMY_PATROL[] 				= "DummyPatrol";const char VO_FS01[]					= "fs1";const char VO_FS02[]					= "fs2";const char DUMMY_DISABLE[] 				= "DummyDisableSiren";const char DUMMY_HASSIREN[] 			= "DummyHasSiren";const char CMD_AUTOSIREN_OFF[]			= "VcmdAutoSirenOff";int DummyGroup = 27;object LadderInstall : CommandScript{ 	LadderInstall() 	{ 		SetIcon("install"); 		SetCursor("install"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{			Vehicle v(Caller);			if (v.IsCollidingWithVirtualObject(VO_FS01) || v.IsCollidingWithVirtualObject(VO_FS02))				return false; 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 		Vehicle v(Caller);      	if (childID == 0)		{			Vector Pos = v.GetPosition();				float r[9];				float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDERDEP, "unnamed");			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           		m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);           		m.UpdatePlacement();			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			v.RemoveCommand(CMD_TOWERINSTALL);			v.AssignCommand(CMD_TOWERDEINSTALL);			v.SetCommandable(false);			v.PushActionExecuteCommand(ACTION_APPEND, "LadderInstall", Caller, 1, false);			v.PushActionDeleteOwner(ACTION_NEWLIST);		}		if (childID == 1)		{			v.SetCommandable(true);		} 	}	};object LadderUninstall : CommandScript{ 	LadderUninstall() 	{ 		SetIcon("deinstall");		SetCursor("deinstall"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 			Vehicle v(Caller);      	if (childID == 0)		{			Vector Pos = v.GetPosition();				float r[9];				float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDER, "unnamed");			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           		m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);            		m.UpdatePlacement();			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			v.RemoveCommand(CMD_TOWERINSTALL);			v.AssignCommand(CMD_TOWERDEINSTALL);			v.SetCommandable(false);			v.PushActionExecuteCommand(ACTION_APPEND, "LadderInstall", Caller, 1, false);			v.PushActionDeleteOwner(ACTION_NEWLIST);		}		if (childID == 1)		{			v.SetCommandable(true);		} 	}	};
Link to comment
Share on other sites

1. The rig flips 180 degrees from the direction it was facing

 

We basically would have to add lines after the command to flip the rig 180 degrees AFTER deployment.

 

 

The LACrane script for the Heavy Rescue Crane does not have issues with rotation, so taking a look at it should help.

Vector Pos = v.GetPosition();float r[9];float childr[9];v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);Vehicle m = Game::CreateVehicle(OBJ_CRANE_REVERSED, NAME_CRANE_REVERSED);m.SetUserData(v.GetID());m.SetPlayerMP(v.GetPlayerMP());m.SetPosition(Pos);Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);Math::MultiplyMatrices(childr, r);m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);m.UpdatePlacement();
Link to comment
Share on other sites

The LACrane script for the Heavy Rescue Crane does not have issues with rotation, so taking a look at it should help.

Vector Pos = v.GetPosition();float r[9];float childr[9];v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);Vehicle m = Game::CreateVehicle(OBJ_CRANE_REVERSED, NAME_CRANE_REVERSED);m.SetUserData(v.GetID());m.SetPlayerMP(v.GetPlayerMP());m.SetPosition(Pos);Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);Math::MultiplyMatrices(childr, r);m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);m.UpdatePlacement();

Would you mind putting those lines into the script and reporsting it? That's where it gets me, I don't know exactly how to fit in other lines that well, I'm learning lol

Link to comment
Share on other sites

I updated the script in the start of the thread, this is now the result on the push action no idea why, when I move the rig though everything goes back to normal. Any Ideas? 

The positioning code works fine with the Rescue Crane, so I'm not sure how it would mess up here.

 

Removed, oops please dont show anyone SPOILER ALERT lol

;)

 

Completely untested and winging it, but here's a script. Prototype constants changed a bit, so double-check wild guesses.

//******************************************************************************************// #Version 1.4#//// 		Includes: All TowerLadder Commands////	- LadderInstall//	- LadderUninstall////		Script by Hoppah Edited by Raf//		//		Usage of this script in other mods is NOT allowed without permission of Rafael////******************************************************************************************const char CMD_SPECIALLIGHTS_ON[]		= "LadderInstall";const char CMD_SPECIALLIGHTS_OFF[]		= "LadderUninstall";const char CMD_MCU_DEINSTALL[]			= "VcmdMCUDeinstall";const char PROTO_LADDER_12[] 			= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_12.e4p";const char PROTO_LADDER_35[] 			= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_35.e4p";const char PROTO_LADDER_12_REVERSED[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_12_reversed.e4p";const char PROTO_LADDER_35_REVERSED[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_35_reversed.e4p";const char DUMMY_LIGHTS[] 				= "DummyLights";const char DUMMY_PATROL[] 				= "DummyPatrol";const char VO_FS01[]					= "fs1";const char VO_FS02[]					= "fs2";const char DUMMY_DISABLE[] 				= "DummyDisableSiren";const char DUMMY_HASSIREN[] 			= "DummyHasSiren";const char CMD_AUTOSIREN_OFF[]			= "VcmdAutoSirenOff";int DummyGroup = 27;object LadderInstall : CommandScript{ 	LadderInstall() 	{ 		SetIcon("install"); 		SetCursor("install"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{			Vehicle v(Caller);			if (v.IsCollidingWithVirtualObject(VO_FS01) || v.IsCollidingWithVirtualObject(VO_FS02))				return false; 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 		Vehicle v(Caller);		if (childID == 0)		{			if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_12) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_12_REVERSED, "12r");			else if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_35) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_35_REVERSED, "35r");			Vector Pos = v.GetPosition();			float r[9];			float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           	m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);            m.UpdatePlacement();			m.PushActionInstall(ACTION_NEWLIST, Target);			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			m.RemoveCommand(CMD_WARNINGLIGHTS_ON);			m.AssignCommand(CMD_WARNINGLIGHTS_OFF);			m.EnableBlinker(BLT_BOTH);			if (v.IsSelected())				m.Select();			v.PushActionDeleteOwner(ACTION_NEWLIST);			m.PushActionExecuteCommand(ACTION_APPEND, "LadderInstall", Caller, 1, false);		}		if (childID == 1)		{			v.SetCommandable(true);		} 	}	};object LadderUninstall : CommandScript{ 	LadderUninstall() 	{ 		SetIcon("deinstall");		SetCursor("deinstall"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 		Vehicle v(Caller);		if (childID == 0)		{			v.RemoveCommand(CMD_SPECIALLIGHTS_OFF);			v.AssignCommand(CMD_SPECIALLIGHTS_ON); 			v.SetCommandable(false);			v.PushActionWait(ACTION_APPEND, 2.5f);						v.PushActionExecuteCommand(ACTION_APPEND, "LadderUninstall", Caller, 1, false);		}		if (childID == 1)		{			if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_12_REVERSED) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_12, "unnamed");			else if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_35_REVERSED) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_35, "unnamed");			Vector Pos = v.GetPosition();			float r[9];			float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           	m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);            m.UpdatePlacement();			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			m.RemoveCommand(CMD_WARNINGLIGHTS_ON);			m.AssignCommand(CMD_WARNINGLIGHTS_OFF);			m.EnableBlinker(false);			if (v.IsSelected())				m.Select();			v.PushActionDeleteOwner(ACTION_NEWLIST);		} 	}	};

Link to comment
Share on other sites

The positioning code works fine with the Rescue Crane, so I'm not sure how it would mess up here.

 

;)

 

Completely untested and winging it, but here's a script. Prototype constants changed a bit, so double-check wild guesses.

//******************************************************************************************// #Version 1.4#//// 		Includes: All TowerLadder Commands////	- LadderInstall//	- LadderUninstall////		Script by Hoppah Edited by Raf//		//		Usage of this script in other mods is NOT allowed without permission of Rafael////******************************************************************************************const char CMD_SPECIALLIGHTS_ON[]		= "LadderInstall";const char CMD_SPECIALLIGHTS_OFF[]		= "LadderUninstall";const char CMD_MCU_DEINSTALL[]			= "VcmdMCUDeinstall";const char PROTO_LADDER_12[] 			= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_12.e4p";const char PROTO_LADDER_35[] 			= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_35.e4p";const char PROTO_LADDER_12_REVERSED[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_12_reversed.e4p";const char PROTO_LADDER_35_REVERSED[] 	= "mod:Prototypes/Vehicles/02 LA Fire Department/fdny_ladder_35_reversed.e4p";const char DUMMY_LIGHTS[] 				= "DummyLights";const char DUMMY_PATROL[] 				= "DummyPatrol";const char VO_FS01[]					= "fs1";const char VO_FS02[]					= "fs2";const char DUMMY_DISABLE[] 				= "DummyDisableSiren";const char DUMMY_HASSIREN[] 			= "DummyHasSiren";const char CMD_AUTOSIREN_OFF[]			= "VcmdAutoSirenOff";int DummyGroup = 27;object LadderInstall : CommandScript{ 	LadderInstall() 	{ 		SetIcon("install"); 		SetCursor("install"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{			Vehicle v(Caller);			if (v.IsCollidingWithVirtualObject(VO_FS01) || v.IsCollidingWithVirtualObject(VO_FS02))				return false; 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 		Vehicle v(Caller);		if (childID == 0)		{			if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_12) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_12_REVERSED, "12r");			else if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_35) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_35_REVERSED, "35r");			Vector Pos = v.GetPosition();			float r[9];			float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           	m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);            m.UpdatePlacement();			m.PushActionInstall(ACTION_NEWLIST, Target);			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			m.RemoveCommand(CMD_WARNINGLIGHTS_ON);			m.AssignCommand(CMD_WARNINGLIGHTS_OFF);			m.EnableBlinker(BLT_BOTH);			if (v.IsSelected())				m.Select();			v.PushActionDeleteOwner(ACTION_NEWLIST);			m.PushActionExecuteCommand(ACTION_APPEND, "LadderInstall", Caller, 1, false);		}		if (childID == 1)		{			v.SetCommandable(true);		} 	}	};object LadderUninstall : CommandScript{ 	LadderUninstall() 	{ 		SetIcon("deinstall");		SetCursor("deinstall"); 		SetGroupID(DummyGroup); 		SetGroupLeader(true); 		SetRestrictions(RESTRICT_SELFEXECUTE);		SetPriority(100); 	}  	bool CheckPossible(GameObject *Caller) 	{ 		if (!Caller->IsValid()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return false; 	}  	bool CheckTarget(GameObject *Caller, Actor *Target, int childID) 	{ 		if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID()) 			return false;  		if (Caller->GetType() == ACTOR_VEHICLE) 		{ 			return true; 		}  		return true; 	} 	void PushActions(GameObject *Caller, Actor *Target, int childID) 	{ 		Vehicle v(Caller);		if (childID == 0)		{			v.RemoveCommand(CMD_SPECIALLIGHTS_OFF);			v.AssignCommand(CMD_SPECIALLIGHTS_ON); 			v.SetCommandable(false);			v.PushActionWait(ACTION_APPEND, 2.5f);						v.PushActionExecuteCommand(ACTION_APPEND, "LadderUninstall", Caller, 1, false);		}		if (childID == 1)		{			if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_12_REVERSED) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_12, "unnamed");			else if (StrCompare(v.GetPrototypeFileName(), PROTO_LADDER_35_REVERSED) == 0)				Vehicle m = Game::CreateVehicle(PROTO_LADDER_35, "unnamed");			Vector Pos = v.GetPosition();			float r[9];			float childr[9];			v.GetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);			m.SetUserData(v.GetID());			m.SetPlayerMP(v.GetPlayerMP());           	m.SetPosition(Pos);			Math::EulerToMatrix(180.0f, 0.f, 0.f, childr);			Math::MultiplyMatrices(childr, r);			m.SetRotation(childr[0], childr[1], childr[2], childr[3], childr[4], childr[5], childr[6], childr[7], childr[8]);            m.UpdatePlacement();			PersonList passengers = v.GetPassengers();			for(int i = 0; i < passengers.GetNumPersons(); i++)			{				v.RemovePassenger(&passengers.GetPerson(i));				m.AddPassenger(&passengers.GetPerson(i));			}			if (!v.IsBlueLightEnabled())				m.EnableBlueLights(false);			if (v.HasCommand(CMD_AUTOSIREN_OFF))				m.AssignCommand(CMD_AUTOSIREN_OFF);			else				m.AssignCommand(CMD_AUTOSIREN_ON);			m.RemoveCommand(CMD_WARNINGLIGHTS_ON);			m.AssignCommand(CMD_WARNINGLIGHTS_OFF);			m.EnableBlinker(false);			if (v.IsSelected())				m.Select();			v.PushActionDeleteOwner(ACTION_NEWLIST);		} 	}	};

Ok Ill let you know dude :), you have teamspeak?

Link to comment
Share on other sites

Tested it in game, no change on the push action other than everyone in the rig dissapears. So I say we go back to before the edits (code in start of thread), where we managed to get the rig to 180 but all the childs were stuck in the center. 

 

Well, bummer. Probably will require a little more finesse that my brute-force methods can provide.

Link to comment
Share on other sites

Only thing I see is that both trucks will turn into the same one when deployed, and then only turn back into one truck when undeployed. A simple "if-else" check at both points will keep them as separate vehicles, so it's not a biggie.

 

Deployment

if (StrCompare(v.GetPrototypeFileName(), PROTO_TOWER_LADDER) == 0)    Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDERDEP, "unnamed");else if (StrCompare(v.GetPrototypeFileName(), PROTO_TOWER_LADDER2) == 0)    Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDER2DEP, "unnamed");

Undeployment 

if (StrCompare(v.GetPrototypeFileName(), PROTO_TOWER_LADDERDEP) == 0)    Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDER, "unnamed");else if (StrCompare(v.GetPrototypeFileName(), PROTO_TOWER_LADDER2DEP) == 0)    Vehicle m = Game::CreateVehicle(PROTO_TOWER_LADDER2, "unnamed");
Link to comment
Share on other sites

Looks good! Did you succesfully manage to install the Tower at a window of an open structure? (to reach floors) That's basically the only issue left for the tower ladder ánd the tiller. How does the script deal with the limited water?

Nope no idea lol, I want to add a couple of restrictions and other push actions.

1. Be able to right click a building to install.

2. In multiplayer there is a weird issue if you install it while there are guys inside of it, it disappears so I wanna add a restriction for that.

3. I want to have a push action So that the engine is on when you install and uninstall it.

And if the bucket is up remove the ability to uninstall the tower ladder.

Most complicated of all the tower ladder requires a line from a hydrant so when it's installed in order to get water flowing you need to have a water supply but I want to add a restriction that if you have a line connected to the rig then you cannot uninstall and install or else the rig gets stuck on the floating hose lll.

Other than that script works great :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...