rafaelmfernandez Posted January 12, 2014 Report Share Posted January 12, 2014 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); } } }; Quote Link to comment Share on other sites More sharing options...
Guest Posted January 12, 2014 Report Share Posted January 12, 2014 I like the idea of people working together to make a script:)...means more impressive scripts;) Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 12, 2014 Report Share Posted January 12, 2014 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(); Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 12, 2014 Author Report Share Posted January 12, 2014 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 Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 13, 2014 Report Share Posted January 13, 2014 I'll take a crack at it after work. Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 I'll take a crack at it after work.Sounds good thanks man! Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 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 Model itself rotates but the childs are all jammed in the center of the object. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 13, 2014 Report Share Posted January 13, 2014 Love the map preview Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 Love the map preview Removed, oops please dont show anyone SPOILER ALERT lol Quote Link to comment Share on other sites More sharing options...
Guest Posted January 13, 2014 Report Share Posted January 13, 2014 I won't Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 13, 2014 Report Share Posted January 13, 2014 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); } } }; Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 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? Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 13, 2014 Report Share Posted January 13, 2014 Ok Ill let you know dude , you have teamspeak? Nope, nor mic. Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 Nope, nor mic. 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. Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 13, 2014 Report Share Posted January 13, 2014 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. Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 13, 2014 Author Report Share Posted January 13, 2014 The Script is done and solid now, It is not final though for my mod but it is useable for others, enjoy. The code is on the first thread, here it is in action. Quote Link to comment Share on other sites More sharing options...
FInn Rescue 12 Posted January 14, 2014 Report Share Posted January 14, 2014 So instead of the tower ladder going in revers to set the legs, they just come down. You would still would have to make two sets of light patterns for the unit correct? It looks good and more realistic nice. Quote Link to comment Share on other sites More sharing options...
jdclark2008 Posted January 14, 2014 Report Share Posted January 14, 2014 Nice job on that. Now where can I get the script?. LOL is it the one at the top of page one? ~ thanks Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 14, 2014 Author Report Share Posted January 14, 2014 Only developers who know what they are doing will probably be able to put this to use. Quote Link to comment Share on other sites More sharing options...
The Loot Posted January 14, 2014 Report Share Posted January 14, 2014 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. Deploymentif (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"); Quote Link to comment Share on other sites More sharing options...
Hoppah Posted January 14, 2014 Report Share Posted January 14, 2014 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? Quote Link to comment Share on other sites More sharing options...
rafaelmfernandez Posted January 14, 2014 Author Report Share Posted January 14, 2014 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 Quote Link to comment Share on other sites More sharing options...