Guest Posted June 23, 2013 Report Share Posted June 23, 2013 Yea thought that was it any brighter by any chance? lol Quote Link to comment Share on other sites More sharing options...
Handsup! Posted June 23, 2013 Report Share Posted June 23, 2013 This mod looks awesome, mainly because you're letting your creative side out on the units!Good luck! Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted June 23, 2013 Author Report Share Posted June 23, 2013 This mod looks awesome, mainly because you're letting your creative side out on the units!Good luck!Thanks much Handsup! I have to do SOMETHING since I can't model yet (have to learn that) and there are SO MANY GREAT MODS coming.Yea thought that was it any brighter by any chance? lolI thought about changing it to color version, but as they are in a "deployment" position if they were called for, I believe they would be in there subdued colors for their patches. The normal 32nd Infantry is a red arrow on a brighter green background as well, not the black on olive green. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 23, 2013 Report Share Posted June 23, 2013 Ok it's fine anyway ;)haha sorry lol Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted June 16, 2014 Author Report Share Posted June 16, 2014 I know it's been a WHILE since I posted, but I haven't given up on my mod. Just real world life got a little too busy for me. Anyway, need some help.I've upgraded my Bomb Squad, by making a second truck, based on an ESU unit from NY Mod. I have both working in game, but I do have one issue. I can't find how to get the ROBOT into unit #2! Can't find anything in the scripts on attaching it to a specific unit. So right now, I respond BOTH units. Any help? Quote Link to comment Share on other sites More sharing options...
The Loot Posted June 16, 2014 Report Share Posted June 16, 2014 If you're using LABombRobot, find something like this...StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0...and add new entries for any other vehicles you want. Example(StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0 || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/truck_bomb_squad.e4p") == 0 || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/atf_nru.e4p") == 0)Make sure to find and edit all similar lines in the script. Quote Link to comment Share on other sites More sharing options...
the wolfhunter Posted June 16, 2014 Report Share Posted June 16, 2014 Looks good keep up the good work! Quote Link to comment Share on other sites More sharing options...
Bugi007 Posted June 16, 2014 Report Share Posted June 16, 2014 WOW, great job, man! Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted June 17, 2014 Author Report Share Posted June 17, 2014 Thanks for the help. Working on it now. Must have typed something wrong, still didn't get the robot on the new truck. Still working on it. Quote Link to comment Share on other sites More sharing options...
Handsup! Posted June 18, 2014 Report Share Posted June 18, 2014 YES! Great to hear. Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted July 5, 2014 Author Report Share Posted July 5, 2014 Well, still no luck getting a bomb robot into my new vehicle. Got the script updated as explained to me above. Is there a limit to how many bomb robots in the game? Does anyone know if there is another file I'm missing than the scripting above (corrected to my unit's name)? I'll have to shoot some pics for you all of the new unit too! Quote Link to comment Share on other sites More sharing options...
The Loot Posted July 5, 2014 Report Share Posted July 5, 2014 There's a limit of one robot out at a time. And as far as I know, they shouldn't be any other script to deal with. Just make sure that every line in the robot script that deals with a vehicle includes your new one. Maybe a step-by-step explanation of what hapens in-game, and maybe your logfile in case there are any errors popping up. Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted February 22, 2015 Author Report Share Posted February 22, 2015 I know it's been some time since I posted, but I had lots of Real World/Real Life stuff get in the way. But I have never given up on making my own mod. Previously, I had stated (as above) that when I added a 2nd Bomb Squad Unit if I tried to get the robot, it caused an error. This is the error I get. Happens if I click with the Bomb Defusal officer on the vehicle. If I hit Ignore, I can go back to game. But no matter what, I cannot get the robot out of either the original vehicle, or the new vehicle. This screen capture, I specifically had JUST the original vehicle deployed, and had not gotten the robot. In fact, this happened when I went to put the officer back in the truck after defusing by hand. Any additional ideas? Quote Link to comment Share on other sites More sharing options...
quasar3210 Posted February 23, 2015 Report Share Posted February 23, 2015 How in the world did I miss this. Looks very good so far. Can't wait to try it out once it goes live. Quote Link to comment Share on other sites More sharing options...
The Loot Posted February 23, 2015 Report Share Posted February 23, 2015 Previously, I had stated (as above) that when I added a 2nd Bomb Squad Unit if I tried to get the robot, it caused an error. This is the error I get. Happens if I click with the Bomb Defusal officer on the vehicle. If I hit Ignore, I can go back to game. But no matter what, I cannot get the robot out of either the original vehicle, or the new vehicle. Can you post that script real quick? It should be a very simple fix but I'd have to take a look to see exactly how it is. Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted February 24, 2015 Author Report Share Posted February 24, 2015 Hope this is what you are looking for. This is the BombRobot Script //******************************************************************************************// #Version 1.0#//// Includes: All bomb squad robot scripts.//// - PcmdRobotGet// - PcmdRobotRemove// - PcmdRobotSendTo// - PcmdRobotUse// - PcmdDummyRobot//// Script by Hoppah// // Usage of this script in other mods is NOT allowed without permission of Hoppah////******************************************************************************************const char CMD_FLOODLIGHTS_ON[] = "VCmdFloodLightsOn";const char CMD_FLOODLIGHTS_OFF[] = "VCmdFloodLightsOff";const char CMD_DOORS[] = "OpenCloseDoor";const char HINT_MAXREACHED[] = "Only one robot is allowed!";const char ANI_MIKE[] = "talkmike";const char ANI_IDLE[] = "idle";const char CMD_GETROBOT[] = "PcmdRobotGet";const char CMD_REMOVEROBOT[] = "PcmdRobotRemove";const char CMD_SENDROBOT[] = "PcmdRobotSendTo";const char CMD_USEROBOT[] = "PcmdRobotUse";const char OBJ_RADIO[] = "01 LA Equipment/radio.V3O";const char OBJ_ROBOT[] = "mod:Prototypes/Vehicles/06 Objects/bomb_squad_robot.e4p";const char NAME_ROBOT[] = "BombRobot";const char NAME_BOMB01[] = "bomb";const char NAME_BOMB02[] = "m03_bomb";const char DUMMY_ROBOT[] = "DummyRobot";int DummyGroup = 20;object PcmdRobotGet : CommandScript{ PcmdRobotGet() { SetIcon("robotget"); SetCursor("robotget"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); SetGroupID(CGROUP_GETEQUIPMENT); SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING); SetPossibleCallers(ACTOR_PERSON); } bool CheckPossible(GameObject *Caller) { GameObjectList SelectPer = Game::GetSelectedGameObjects(); if (SelectPer.GetNumObjects() > 1) return false; Person p(Caller); if (p.IsValid() && (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID() != 0 || p.IsPulling() || p.GetEnteredCarID() != -1)) return false; if (!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target || !Target->IsValid() || Target->GetType()!=ACTOR_VEHICLE) return false; if(Caller->GetObjectType()==TYPE_PERSON) { Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/BombSquad2.e4p") == 0) { return true; } return false; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { GameObjectList list = Game::GetGameObjects(NAME_ROBOT); if (list.GetNumObjects() > 0) { Mission::PlayHint(HINT_MAXREACHED); return; } Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_EQUIPMENTDOOR); Caller->PushActionMove(ACTION_NEWLIST, TargetPos); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionGetEquipment(ACTION_APPEND, Target, EQUIP_NONE); Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 1, false); }};object PcmdRobotRemove : CommandScript{ PcmdRobotRemove() { SetIcon("robotremove"); SetCursor("robotremove"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); SetGroupID(CGROUP_GETEQUIPMENT); SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING); SetPossibleCallers(ACTOR_PERSON); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target || !Target->IsValid() || Target->GetType()!=ACTOR_VEHICLE) return false; if(Caller->GetObjectType()==TYPE_PERSON) { Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p") == 0) || StrCompare(v.GetPrototypeFileName(), "mod:Prototypes/Vehicles/03 LA Police/BombSquad2.e4p") == 0) { return true; } return false; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_EQUIPMENTDOOR); p.PushActionMove(ACTION_NEWLIST, TargetPos); p.PushActionTurnTo(ACTION_APPEND, Target); p.PushActionGetEquipment(ACTION_APPEND, Target, EQUIP_NONE); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 2, false); obj.PushActionMove(ACTION_NEWLIST, TargetPos); obj.PushActionTurnTo(ACTION_APPEND, Target); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }};object PcmdRobotSendTo : CommandScript{ PcmdRobotSendTo() { SetIcon("sendto"); SetCursor("sendto"); SetValidTargets(ACTOR_FLOOR | ACTOR_VIRTUAL); SetPriority(200); SetDeselectCaller(false); SetSelfClickActivation(true); SetHighlightingEnabled(false); SetGroupLeader(true); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || Caller->GetID() == Target->GetID()) return false; if (Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; if (p.IsCurrentAction("EActionTreatPerson")) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Vector CmdPos = Game::GetCommandPos(); Caller->PushActionTurnTo(ACTION_NEWLIST, CmdPos); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_MIKE); Caller->PushActionWait(ACTION_APPEND, 3.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_IDLE); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); obj.PushActionWait(ACTION_NEWLIST, 0.2f); obj.PushActionMove(ACTION_APPEND, CmdPos); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }};object PcmdRobotUse : CommandScript{ PcmdRobotUse() { SetIcon("use"); SetCursor("use"); SetValidTargets(ACTOR_OBJECT); SetRestrictions(RESTRICT_USABLE); SetPriority(700); SetSelfClickActivation(true); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; return Game::ExistsObjectWithFlagSet(OF_USABLE); } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if (!Caller->IsValid() || !Target->IsValid() || Caller->GetID()==Target->GetID()) return false; GameObject obj(Target); Person p(Caller); if(!obj.HasName(NAME_BOMB01) && !obj.HasName(NAME_BOMB02) && !obj.IsValid()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Vector CmdPos = Target->GetPosition(); Caller->PushActionTurnTo(ACTION_NEWLIST, CmdPos); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_MIKE); Caller->PushActionWait(ACTION_APPEND, 3.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_IDLE); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); obj.PushActionMove(ACTION_NEWLIST, Target, TARGET_USE); obj.PushActionTurnTo(ACTION_APPEND, Target); obj.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, &obj, 4, false); obj.PushActionUse(ACTION_APPEND, Target); obj.PushActionWait(ACTION_APPEND, 0.5f); obj.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, &obj, 5, false); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }};object DummyRobot : CommandScript{ DummyRobot() { SetGroupID(DummyGroup); } bool CheckGroupVisibility(GameObject *Caller) { return false; } bool CheckPossible(GameObject *Caller) { return false; } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { return false; } void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 1) { Person p(Caller); p.PlaceObjectInRightHand(OBJ_RADIO); p.PushActionSwitchAnim(ACTION_APPEND, "idleequipped2"); p.AssignCommand(CMD_REMOVEROBOT); p.RemoveCommand(CMD_GETROBOT); p.AssignCommand(CMD_SENDROBOT); p.AssignCommand(CMD_USEROBOT); p.RemoveCommand("Use"); p.RemoveCommand("EnterCar"); p.RemoveCommand("EnterHouse"); Vehicle v(Target); v.PushActionExecuteCommand(ACTION_APPEND, CMD_DOORS, Caller, 1, false); Vector CarPos = v.GetPosition(); float r[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_ROBOT, NAME_ROBOT); if (Game::FindFreePosition(&m, CarPos)) { m.SetPosition(CarPos); m.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); m.UpdatePlacement(); m.Hide(); m.PushActionWait(ACTION_NEWLIST, 0.6f); m.PushActionShowHide(ACTION_APPEND, false); m.SetUserData(p.GetID()); m.SetPlayerMP(p.GetPlayerMP()); m.SetSpeed(4.5f); m.SetParking(true); } } if(childID == 2) { Person p(Caller); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsCurrentAction("EActionFindPath")) { p.RemoveObjectInRightHand(); p.PushActionSwitchAnim(ACTION_NEWLIST, "idle"); p.RemoveCommand(CMD_REMOVEROBOT); p.AssignCommand(CMD_GETROBOT); p.RemoveCommand(CMD_SENDROBOT); p.RemoveCommand(CMD_USEROBOT); p.AssignCommand("Use"); p.AssignCommand("EnterCar"); p.AssignCommand("EnterHouse"); obj.PushActionDeleteOwner(ACTION_NEWLIST); Vehicle v(Target); v.PushActionExecuteCommand(ACTION_APPEND, CMD_DOORS, Caller, 1, false); } else { p.PushActionWait(ACTION_NEWLIST, 2.0f); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 2, false); } } } } if(childID == 3) { Person p(Caller); p.RemoveObjectInRightHand(); p.PushActionSwitchAnim(ACTION_NEWLIST, "idle"); p.RemoveCommand(CMD_REMOVEROBOT); p.AssignCommand(CMD_GETROBOT); p.RemoveCommand(CMD_SENDROBOT); p.RemoveCommand(CMD_USEROBOT); p.AssignCommand("Use"); p.AssignCommand("EnterCar"); p.AssignCommand("EnterHouse"); } if(childID == 4) { System::Log("Open door"); Vehicle v(Caller); v.PlayAnimOpenDoor(DAT_SPECIAL, 2.0f, NULL); } if(childID == 5) { System::Log("Close door"); Vehicle v(Caller); v.PlayAnimCloseDoor(DAT_SPECIAL, 1.6f, NULL); } }}; Thanks in advance for all the help! Quote Link to comment Share on other sites More sharing options...
The Loot Posted February 24, 2015 Report Share Posted February 24, 2015 Hope this is what you are looking for. This is the BombRobot Script Looks like your vehicle checks were a little off with an errant parenthesis. I went ahead and fixed both lines of those, and I also added constants with the prototype filepaths and pointed them to those, which will make it easier to change the prototype files if you need to in the future. //******************************************************************************************// #Version 1.0#//// Includes: All bomb squad robot scripts.//// - PcmdRobotGet// - PcmdRobotRemove// - PcmdRobotSendTo// - PcmdRobotUse// - PcmdDummyRobot//// Script by Hoppah// // Usage of this script in other mods is NOT allowed without permission of Hoppah////****************************************************************************************** const char CMD_FLOODLIGHTS_ON[] = "VCmdFloodLightsOn";const char CMD_FLOODLIGHTS_OFF[] = "VCmdFloodLightsOff";const char CMD_DOORS[] = "OpenCloseDoor";const char HINT_MAXREACHED[] = "Only one robot is allowed!";const char ANI_MIKE[] = "talkmike";const char ANI_IDLE[] = "idle";const char CMD_GETROBOT[] = "PcmdRobotGet";const char CMD_REMOVEROBOT[] = "PcmdRobotRemove";const char CMD_SENDROBOT[] = "PcmdRobotSendTo";const char CMD_USEROBOT[] = "PcmdRobotUse";const char OBJ_RADIO[] = "01 LA Equipment/radio.V3O";const char OBJ_ROBOT[] = "mod:Prototypes/Vehicles/06 Objects/bomb_squad_robot.e4p";const char NAME_ROBOT[] = "BombRobot";const char NAME_BOMB01[] = "bomb";const char NAME_BOMB02[] = "m03_bomb";const char DUMMY_ROBOT[] = "DummyRobot"; const char VEH_BOMB1[] = "mod:Prototypes/Vehicles/03 LA Police/suv_bomb_squad.e4p";const char VEH_BOMB2[] = "mod:Prototypes/Vehicles/03 LA Police/BombSquad2.e4p"; int DummyGroup = 20; object PcmdRobotGet : CommandScript{ PcmdRobotGet() { SetIcon("robotget"); SetCursor("robotget"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); SetGroupID(CGROUP_GETEQUIPMENT); SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING); SetPossibleCallers(ACTOR_PERSON); }bool CheckPossible(GameObject *Caller) { GameObjectList SelectPer = Game::GetSelectedGameObjects(); if (SelectPer.GetNumObjects() > 1) return false;Person p(Caller); if (p.IsValid() && (p.IsCarryingPerson() || p.IsLinkedWithPerson() || p.GetFirehoseID() != 0 || p.IsPulling() || p.GetEnteredCarID() != -1)) return false;if (!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false;return true; }bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target || !Target->IsValid() || Target->GetType()!=ACTOR_VEHICLE) return false; if(Caller->GetObjectType()==TYPE_PERSON) { Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && (StrCompare(v.GetPrototypeFileName(), VEH_BOMB1) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_BOMB2) == 0)) { return true; } return false; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { GameObjectList list = Game::GetGameObjects(NAME_ROBOT); if (list.GetNumObjects() > 0) { Mission::PlayHint(HINT_MAXREACHED); return; } Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_EQUIPMENTDOOR); Caller->PushActionMove(ACTION_NEWLIST, TargetPos); Caller->PushActionTurnTo(ACTION_APPEND, Target); Caller->PushActionGetEquipment(ACTION_APPEND, Target, EQUIP_NONE); Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 1, false); }}; object PcmdRobotRemove : CommandScript{ PcmdRobotRemove() { SetIcon("robotremove"); SetCursor("robotremove"); SetValidTargets(ACTOR_VEHICLE | ACTOR_OBJECT); SetGroupID(CGROUP_GETEQUIPMENT); SetRestrictions(RESTRICT_NOTDESTROYED | RESTRICT_NOTBURNING); SetPossibleCallers(ACTOR_PERSON); } bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || !Target || !Target->IsValid() || Target->GetType()!=ACTOR_VEHICLE) return false; if(Caller->GetObjectType()==TYPE_PERSON) { Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; Vehicle v(Target); if (v.IsValid() && !v.IsDestroyed() && (StrCompare(v.GetPrototypeFileName(), VEH_BOMB1) == 0 || StrCompare(v.GetPrototypeFileName(), VEH_BOMB2) == 0)) { return true; } return false; } } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); Vector TargetPos = Target->GetTargetPoint(Caller, TARGET_EQUIPMENTDOOR); p.PushActionMove(ACTION_NEWLIST, TargetPos); p.PushActionTurnTo(ACTION_APPEND, Target); p.PushActionGetEquipment(ACTION_APPEND, Target, EQUIP_NONE); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 2, false); obj.PushActionMove(ACTION_NEWLIST, TargetPos); obj.PushActionTurnTo(ACTION_APPEND, Target); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }}; object PcmdRobotSendTo : CommandScript{ PcmdRobotSendTo() { SetIcon("sendto"); SetCursor("sendto"); SetValidTargets(ACTOR_FLOOR | ACTOR_VIRTUAL); SetPriority(200); SetDeselectCaller(false); SetSelfClickActivation(true); SetHighlightingEnabled(false); SetGroupLeader(true); }bool CheckTarget(GameObject *Caller, Actor *Target, int childID) { if(!Caller->IsValid() || Caller->GetID() == Target->GetID()) return false; if (Caller->GetType() != ACTOR_PERSON) return false; Person p(Caller); if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false; if (p.IsCurrentAction("EActionTreatPerson")) return false; return true; }void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Vector CmdPos = Game::GetCommandPos(); Caller->PushActionTurnTo(ACTION_NEWLIST, CmdPos); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_MIKE); Caller->PushActionWait(ACTION_APPEND, 3.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_IDLE);int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); obj.PushActionWait(ACTION_NEWLIST, 0.2f); obj.PushActionMove(ACTION_APPEND, CmdPos); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }}; object PcmdRobotUse : CommandScript{ PcmdRobotUse() { SetIcon("use"); SetCursor("use"); SetValidTargets(ACTOR_OBJECT); SetRestrictions(RESTRICT_USABLE); SetPriority(700); SetSelfClickActivation(true); } bool CheckPossible(GameObject *Caller) { if (!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; return Game::ExistsObjectWithFlagSet(OF_USABLE); } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { if (!Caller->IsValid() || !Target->IsValid() || Caller->GetID()==Target->GetID()) return false; GameObject obj(Target); Person p(Caller); if(!obj.HasName(NAME_BOMB01) && !obj.HasName(NAME_BOMB02) && !obj.IsValid()) return false; return true; } void PushActions(GameObject *Caller, Actor *Target, int childID) { Person p(Caller); Vector CmdPos = Target->GetPosition(); Caller->PushActionTurnTo(ACTION_NEWLIST, CmdPos); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_MIKE); Caller->PushActionWait(ACTION_APPEND, 3.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, ANI_IDLE); int UnitID = p.GetID(); VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsValid() || obj.IsDestroyed() || obj.IsSmoking() || obj.IsCarried()) { System::Log("Robot not capable of performing actions!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); return; } else if (!obj.IsCurrentAction("EActionUse") && !obj.IsDestroyed() && obj.IsValid()) { System::Log("Robot found!"); obj.PushActionMove(ACTION_NEWLIST, Target, TARGET_USE); obj.PushActionTurnTo(ACTION_APPEND, Target); obj.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, &obj, 4, false); obj.PushActionUse(ACTION_APPEND, Target); obj.PushActionWait(ACTION_APPEND, 0.5f); obj.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, &obj, 5, false); } else { System::Log("Robot found, but has EactionUse!"); } } } else { System::Log("Robot not found!"); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Caller, 3, false); } }}; object DummyRobot : CommandScript{ DummyRobot() {SetGroupID(DummyGroup); } bool CheckGroupVisibility(GameObject *Caller) { return false; } bool CheckPossible(GameObject *Caller) {return false; }bool CheckTarget(GameObject *Caller, Actor *Target, int childID) {return false; }void PushActions(GameObject *Caller, Actor *Target, int childID) { if(childID == 1) { Person p(Caller); p.PlaceObjectInRightHand(OBJ_RADIO); p.PushActionSwitchAnim(ACTION_APPEND, "idleequipped2"); p.AssignCommand(CMD_REMOVEROBOT); p.RemoveCommand(CMD_GETROBOT); p.AssignCommand(CMD_SENDROBOT); p.AssignCommand(CMD_USEROBOT); p.RemoveCommand("Use"); p.RemoveCommand("EnterCar"); p.RemoveCommand("EnterHouse"); Vehicle v(Target); v.PushActionExecuteCommand(ACTION_APPEND, CMD_DOORS, Caller, 1, false); Vector CarPos = v.GetPosition(); float r[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_ROBOT, NAME_ROBOT); if (Game::FindFreePosition(&m, CarPos)) {m.SetPosition(CarPos); m.SetRotation(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]); m.UpdatePlacement(); m.Hide(); m.PushActionWait(ACTION_NEWLIST, 0.6f); m.PushActionShowHide(ACTION_APPEND, false); m.SetUserData(p.GetID()); m.SetPlayerMP(p.GetPlayerMP()); m.SetSpeed(4.5f); m.SetParking(true); } } if(childID == 2) {Person p(Caller); int UnitID = p.GetID();VehicleList list(NAME_ROBOT); if (list.GetNumVehicles() > 0) { if (list.GetVehicle(0)->GetUserData() == UnitID) { Vehicle obj = list.GetVehicle(0); if (!obj.IsCurrentAction("EActionFindPath")) { p.RemoveObjectInRightHand(); p.PushActionSwitchAnim(ACTION_NEWLIST, "idle"); p.RemoveCommand(CMD_REMOVEROBOT); p.AssignCommand(CMD_GETROBOT); p.RemoveCommand(CMD_SENDROBOT); p.RemoveCommand(CMD_USEROBOT); p.AssignCommand("Use"); p.AssignCommand("EnterCar"); p.AssignCommand("EnterHouse"); obj.PushActionDeleteOwner(ACTION_NEWLIST); Vehicle v(Target); v.PushActionExecuteCommand(ACTION_APPEND, CMD_DOORS, Caller, 1, false); } else { p.PushActionWait(ACTION_NEWLIST, 2.0f); p.PushActionExecuteCommand(ACTION_APPEND, DUMMY_ROBOT, Target, 2, false); } } } } if(childID == 3) { Person p(Caller); p.RemoveObjectInRightHand(); p.PushActionSwitchAnim(ACTION_NEWLIST, "idle"); p.RemoveCommand(CMD_REMOVEROBOT); p.AssignCommand(CMD_GETROBOT); p.RemoveCommand(CMD_SENDROBOT); p.RemoveCommand(CMD_USEROBOT); p.AssignCommand("Use"); p.AssignCommand("EnterCar"); p.AssignCommand("EnterHouse"); } if(childID == 4) { System::Log("Open door"); Vehicle v(Caller); v.PlayAnimOpenDoor(DAT_SPECIAL, 2.0f, NULL); } if(childID == 5) { System::Log("Close door"); Vehicle v(Caller); v.PlayAnimCloseDoor(DAT_SPECIAL, 1.6f, NULL); } }}; Hopefully that will do it for the issue. Quote Link to comment Share on other sites More sharing options...
n00bingtarget Posted February 28, 2015 Author Report Share Posted February 28, 2015 That worked! Thanks much! Now I can actually deploy 2 vehicles with robots. Quote Link to comment Share on other sites More sharing options...