Serginho Posted February 3, 2019 Report Share Posted February 3, 2019 Hello I am trying to create a script or something so the engineer doesn't get down of the vehicle with his bag or suitcase and you have to take it from the van, something like EMTBag for the doctor. Also, I try to make him have not the installfloodlight script and repair script until I have taken the suitcase. I have basic knowledge about scripting and modding but I have tried a lot and it does not work well. Would anyone know how to do that or if there is a mod that already has it? I'm sorry if I wrote something wrong, I do not speak fluent English and I had to use a bit of a translator. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
itchboy Posted February 3, 2019 Report Share Posted February 3, 2019 You need to remove the "Use" and "repaier" commands from the engineer so he doesnt spawn with the bag. Give him a command to get the bag and in that command, the Use, floodlight and repair commands will be assigned to him. Removing the bag should have the opposite effect of removing those commands so the engineer loses his abilities. Quote Link to comment Share on other sites More sharing options...
amuchalipsis Posted February 4, 2019 Report Share Posted February 4, 2019 I assume you are playing the LA mod or a submod that's based on LA mod. You can copy and modify the LAGetEMTBag file to make engineers get THW bags. Also, you can take a look at the LAEquipmentCommands file to add/remove the repair command when they get/remove the THW bag. Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 4, 2019 Author Report Share Posted February 4, 2019 12 hours ago, itchboy said: You need to remove the "Use" and "repaier" commands from the engineer so he doesnt spawn with the bag. Give him a command to get the bag and in that command, the Use, floodlight and repair commands will be assigned to him. Removing the bag should have the opposite effect of removing those commands so the engineer loses his abilities. Like in the LAPoliceBarricade more or less? When they take the barricade they only have the script to put it and they do not recover the other scripts unit they put it on Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 4, 2019 Author Report Share Posted February 4, 2019 8 hours ago, amuchalipsis said: I assume you are playing the LA mod or a submod that's based on LA mod. You can copy and modify the LAGetEMTBag file to make engineers get THW bags. Also, you can take a look at the LAEquipmentCommands file to add/remove the repair command when they get/remove the THW bag. Yes, I am playing Norway Mod but it is based on LA mod. Thanks! I forgot to look LAEquipmentCommands. I upload the script so you can tell me if there is something wrong. GetTHWBag.script Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 4, 2019 Author Report Share Posted February 4, 2019 It´s imposible. I'm getting the error "is not defined in current scope" always. Could you tell me step by step how can I do it? I know it can take time. I would be very grateful. Quote Link to comment Share on other sites More sharing options...
itchboy Posted February 4, 2019 Report Share Posted February 4, 2019 Show me the script and show me what line the error is at. Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 5, 2019 Author Report Share Posted February 5, 2019 Just now, itchboy said: Show me the script and show me what line the error is at. I think that I have configured everything in the editor. I created a new prototype with the THWbag model of the original game, configured almost exactly like the EMTBag, and I have removed the scripts use and repair to the engineer, giving him the new command. LAGetTHWBag.script LAEquipmentCommands.script Quote Link to comment Share on other sites More sharing options...
itchboy Posted February 6, 2019 Report Share Posted February 6, 2019 LAGetTHWBag.script has a problem: THW_BAG is not recognized in Em4 as a valid code. You need to use "EQUIP_THW_CASE" instead. LAEquipmentCommands.script also has a problem. You need to define CMD_USE and CMD_REPAIR at the top header of the script so the game knows what commands you want removed. Quote Link to comment Share on other sites More sharing options...
amuchalipsis Posted February 6, 2019 Report Share Posted February 6, 2019 I did also find an error on line 81 of LAGetTHWBag: Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_EQUIPMENT, Target, 9, false); This directs to this: if(childID == 9) //GetEMTBAG { Person p(Caller); p.SetAutoHealDistance(1000.f); if (!Caller->HasCommand(CMD_REMOVEEQUIPMENT)) Caller->AssignCommand(CMD_REMOVEEQUIPMENT); if (!Caller->HasCommand(CMD_HEAL)) Caller->AssignCommand(CMD_HEAL); if (Caller->HasCommand(CMD_HEAL2)) Caller->RemoveCommand(CMD_HEAL2); if (Caller->HasCommand(CMD_USEAXE)) Caller->RemoveCommand(CMD_USEAXE); if (Caller->HasCommand(CMD_USECHAINSAW)) Caller->RemoveCommand(CMD_USECHAINSAW); if (Caller->HasCommand(CMD_ATTACHHOSE)) { Caller->RemoveCommand(CMD_ATTACHHOSE); Caller->RemoveCommand(CMD_REMOVEHOSE); } if (Caller->HasCommand(CMD_USEJUMPPAD)) Caller->RemoveCommand(CMD_USEJUMPPAD); if (Caller->HasCommand(CMD_USESHEARS)) Caller->RemoveCommand(CMD_USESHEARS); if (Caller->HasCommand(CMD_THROW)) Caller->RemoveCommand(CMD_THROW); if (Caller->HasCommand(CMD_ARREST) && Caller->HasCommand(CMD_EXTINGUISH)) Caller->RemoveCommand(CMD_EXTINGUISH); if (Caller->HasCommand(CMD_ARREST) && Caller->HasCommand(CMD_COOL)) Caller->RemoveCommand(CMD_COOL); } Not to the part you intended to be directed: if(childID == 10) //GetTHWBAG { Person p(Caller); if (!Caller->HasCommand(CMD_REMOVEEQUIPMENT)) Caller->AssignCommand(CMD_REMOVEEQUIPMENT); if (!Caller->HasCommand(CMD_USE)) Caller->AssignCommand(CMD_USE); if (!Caller->HasCommand(CMD_REPAIR)) Caller->AssignCommand(CMD_REPAIR); } To fix that simply change this 9 to a 10: Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_EQUIPMENT, Target, 9, false); Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 6, 2019 Author Report Share Posted February 6, 2019 14 hours ago, itchboy said: LAGetTHWBag.script has a problem: THW_BAG is not recognized in Em4 as a valid code. You need to use "EQUIP_THW_CASE" instead. LAEquipmentCommands.script also has a problem. You need to define CMD_USE and CMD_REPAIR at the top header of the script so the game knows what commands you want removed. 14 hours ago, amuchalipsis said: I did also find an error on line 81 of LAGetTHWBag: Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_EQUIPMENT, Target, 9, false); This directs to this: Reveal hidden contents if(childID == 9) //GetEMTBAG { Person p(Caller); p.SetAutoHealDistance(1000.f); if (!Caller->HasCommand(CMD_REMOVEEQUIPMENT)) Caller->AssignCommand(CMD_REMOVEEQUIPMENT); if (!Caller->HasCommand(CMD_HEAL)) Caller->AssignCommand(CMD_HEAL); if (Caller->HasCommand(CMD_HEAL2)) Caller->RemoveCommand(CMD_HEAL2); if (Caller->HasCommand(CMD_USEAXE)) Caller->RemoveCommand(CMD_USEAXE); if (Caller->HasCommand(CMD_USECHAINSAW)) Caller->RemoveCommand(CMD_USECHAINSAW); if (Caller->HasCommand(CMD_ATTACHHOSE)) { Caller->RemoveCommand(CMD_ATTACHHOSE); Caller->RemoveCommand(CMD_REMOVEHOSE); } if (Caller->HasCommand(CMD_USEJUMPPAD)) Caller->RemoveCommand(CMD_USEJUMPPAD); if (Caller->HasCommand(CMD_USESHEARS)) Caller->RemoveCommand(CMD_USESHEARS); if (Caller->HasCommand(CMD_THROW)) Caller->RemoveCommand(CMD_THROW); if (Caller->HasCommand(CMD_ARREST) && Caller->HasCommand(CMD_EXTINGUISH)) Caller->RemoveCommand(CMD_EXTINGUISH); if (Caller->HasCommand(CMD_ARREST) && Caller->HasCommand(CMD_COOL)) Caller->RemoveCommand(CMD_COOL); } Not to the part you intended to be directed: Reveal hidden contents if(childID == 10) //GetTHWBAG { Person p(Caller); if (!Caller->HasCommand(CMD_REMOVEEQUIPMENT)) Caller->AssignCommand(CMD_REMOVEEQUIPMENT); if (!Caller->HasCommand(CMD_USE)) Caller->AssignCommand(CMD_USE); if (!Caller->HasCommand(CMD_REPAIR)) Caller->AssignCommand(CMD_REPAIR); } To fix that simply change this 9 to a 10: Caller->PushActionExecuteCommand(ACTION_APPEND, DUMMY_EQUIPMENT, Target, 9, false); It´s done. Thank you very much Itchboy! : ) Y muchas gracias Amuchalipsis, mola encontrarse hispanohablantes por estos lares. And one last thing so that the complete subject remains, the engineer can still use the commands "use" and "repair" even if the suitcase has been previously removed, a suitcase comes out of nowhere and the engineer gets to, for example, repair a vehicle. How can I do so that the engineer necessarily needs the suitcase? Quote Link to comment Share on other sites More sharing options...
itchboy Posted February 7, 2019 Report Share Posted February 7, 2019 Its hardcoded to spawn the case sadly. You can try to remove the auto target script from the engineer so that they dont automatically repair damaged vehicles. Quote Link to comment Share on other sites More sharing options...
Serginho Posted February 7, 2019 Author Report Share Posted February 7, 2019 13 hours ago, itchboy said: Its hardcoded to spawn the case sadly. You can try to remove the auto target script from the engineer so that they dont automatically repair damaged vehicles. F**k. Ok, I will try that, thanks again Itchboy. Keep up the good work in Montana! (and others, the scripts that you showed on your Youtube channel are amazing) Best regards: Sergio Quote Link to comment Share on other sites More sharing options...
amuchalipsis Posted February 11, 2019 Report Share Posted February 11, 2019 On 6/2/2019 at 4:21 PM, Serginho said: Y muchas gracias Amuchalipsis, mola encontrarse hispanohablantes por estos lares. De nada, lo mismo digo. http://www.emergency-planet.com/uploads/emoticons/default_smile.png Quote Link to comment Share on other sites More sharing options...