Jump to content
Serginho

THW Bag (engineer suitcase)

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

 

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...