wilderness

consume instadoc with key press

33 posts in this topic

Hi guys I need a pointer in the right direction please, my players are asking if there is a way to consume instadoc with a single key press if they have one in their inventory, I'm looking at "ExileClient_action_event_onKeyDown" and the consume function but really have no clue where to go from here, how do I tell it to consume instadoc only, and not other consumables on a key press and to check if its in the inventory?

any help would be great.

Share this post


Link to post
Share on other sites

I'm not on my server to be able to check. But I was under the impression it was in the scroll menu already. I could be 100% wrong on this. But it could also be an easier option to add it to the scroll wheel menu through add action.

Share this post


Link to post
Share on other sites
Advertisement

I don't recall seeing that and I carry an instadoc with me pretty much all the time, either way would be good, I just don't know how to go about adding a consume action to instadoc on the scroll wheel or button press, vehicles is a piece of cake. just a nudge in the right direction would be great.

Share this post


Link to post
Share on other sites
On 10/1/2016 at 2:49 PM, wilderness said:

I don't recall seeing that and I carry an instadoc with me pretty much all the time, either way would be good, I just don't know how to go about adding a consume action to instadoc on the scroll wheel or button press, vehicles is a piece of cake. just a nudge in the right direction would be great.

I'll look into it real quick. I'm not sure if you can do an add action to yourself. But I imagine it can be done with a little looking into. I see in the add actions for Safes and Vehicles that the code tests for certain conditions and if met adds an action that triggers the code. To test for something like player speed below 1 mps and health below 100%, then point it to the code that does the healing in exile.

I'm not sure, but this is how I would try to do this. Hell, if I find the time, this may be how I do this.

Share this post


Link to post
Share on other sites

@Redbeard_Actual Are you trying to add a shortcut to using an Instadoc via the addAction scroll wheel?  Or are you trying to do it via a keypress?

If you want to do it via an addaction:

unit addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious]   //Base Addaction Code, for ref

player addAction ["HEAL ME!", "custom\HealMeRightMeow.sqf",,6,,,"User4",{Exile_Item_InstaDoc in magazines player;}]; //Apoc

So, in the new script, "HealMeRightMeow.sqf: you need to tell the system that you want to consume a certain item, preferably the instadoc that our little addAction checked for.  Since what'll happen is that via the scroll wheel, or CustomerUserAction4 (this is a good way to get a keybindable thing for players), is the aforenamed script will get executed.  It'll be a pretty short script, like 2-3 lines.  This could be longer if you want to do some further checks to see if the player has used it already this life or whatnot.  

So, give this a little try and see where it gets you.  If you still hit a wall, PM me an update and I'll try working on it to put a little release out.

Edited by Apoc
  • Like 1

Share this post


Link to post
Share on other sites

@Apoc

Quote

Are you trying to add a shortcut to using an Instadoc via the addAction scroll wheel?  Or are you trying to do it via a keypress?

Either way would be good, My guys are saying that in the heat of the action opening inventory, scrolling and double clicking is costing precious time, they are basically asking for a way to speed the process up, but obviously we need to check that they have one or more instadocs to start with.

Btw way I was way off with my logic in going about this.

Share this post


Link to post
Share on other sites

I was just rambling to point this guy in the right direction. But I'm learning as I go.

I understand that this method will put the action on the scroll wheel as well as it will add a key press bind? But the player must assign a custom bind in the arma 3 setting? Or can I assign a key?

Edited by Redbeard_Actual
Had more time to read and think.

Share this post


Link to post
Share on other sites
5 hours ago, Redbeard_Actual said:

I was just rambling to point this guy in the right direction. But I'm learning as I go.

I understand that this method will put the action on the scroll wheel as well as it will add a key press bind? But the player must assign a custom bind in the arma 3 setting? Or can I assign a key?

Well, you can assign a key, but generally I try to avoid that since you may overlap with another script or whatnot.  For a feature like this, I would prefer (for my use) to be able to assign whatever key I like.

Something else to keep in mind, is do you want to set a minimum threshold that the user can, or can not, use the instadoc?

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Apoc said:

Well, you can assign a key, but generally I try to avoid that since you may overlap with another script or whatnot.  For a feature like this, I would prefer (for my use) to be able to assign whatever key I like.

Something else to keep in mind, is do you want to set a minimum threshold that the user can, or can not, use the instadoc?

Personally, that is what I would try. Like making sure they are standing still and are below max health. These are things I can figure out eventually. But I never say no to good old fashioned education.

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.