Jump to content
strider42

BIS_fnc_holdActionAdd change duration

Recommended Posts

The BIS_fnc_holdActionAdd is and action so you apply it to any player you want to be able to use the action, usually done some time before the player will use the action.  This means you have to set the duration (how long the player has to hold the key to complete the action) when you add the action.  This is the engine that is used for the vanilla revive system.

 

Does anyone know a hack that would let you change the duration the code block that is run when the player starts the action by holding down the appropriate key?

 

Currently I can only think of adding a trigger close to where the action will be used to create the action as the player approaches at which point you could set the duration appropriately.

 

All help gratefully received  S

 

 

Share this post


Link to post
Share on other sites

No sure to understand your aim.
For vanilla revive system, you can set what you want in mission parameters (3den).

 

For your own BIS_fnc_holdActionAdd, the parameter already exists, you can script something to make it different along with your condition (place a variable returning a figure instead of a fixed figure).

 

For existing functions embedded in mods, just forget.

  • Like 1

Share this post


Link to post
Share on other sites

Similarly to pierremgi, I am not sure I completely understand your intention or what you are trying to achieve.

 

Regarding duration, in BIS_fnc_holdActionAdd the 12th argument is the duration of the "holdAction" (for more info see the docs). If you clarify a bit your intentions we may be able to help you a bit more.

Share this post


Link to post
Share on other sites

OK. My particular application is to IEDs.  I wanted the time it took to disarm an IED to be depended on whether the player had a 'ToolKit' on them.  However the action is added to the player when the IED is placed (usually at mission start) and that is the point where you set the duration that they have to hold the key down.

 

Mission start.

 

_duration = 30;

[_ied, "Disarm IED", ... , _duration, ...] call BIS_fnc_holdActionAdd;

 

...

 

Player approaches IED with 'ToolKit'.

// Set _duration to 15

?

 

I hope that explains things better  S

 

 

Share this post


Link to post
Share on other sites

Add two actions to the IED.

 

holdAction 1 has conditionShow

("Toolkit" in items player)

or whatever the proper syntax for that would be. This holdAction has the lower duration.

 

holdAction 2 has conditionShow

!("Toolkit" in items player)

again, junk code, but you get the idea. This holdAction has the longer duration.

  • Like 1

Share this post


Link to post
Share on other sites

@harzach Thank you.  Obvious when it is pointed out to you.  S

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×