Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
  • Announcements

    • randomperson139

      Signatures   03/04/2016

      Hi everyone. It appears that the update to the new forum has affected the format of the majority of signatures (adding extra spaces, changing sizes etc.). Due to this, could everyone please check their own signature, ensuring that it complies with the site rules. See the http://www.emergency-planet.com/tos.html/ or http://www.emergency-planet.com/topic/16848-acceptable-signature-sizes/ for more information.  We'll give it a few weeks to give enough time to edit signatures, after that the unnecessarily large signatures will simply be removed. Thanks for your cooperation. Regards, EMP Staff.
Sign in to follow this  
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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);

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×