Seems like holdactions created by BIS_fnc_holdActionAdd fades out if the hold duration is longer than ~15 seconds. Might be tied to a difficulty setting.
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- Ingame UI
Event Timeline
Seems that since this is a normal addaction action it's faded out according to class CfgInGameUi -> class PlayerInfo dimmStartTime/dimmEndTime 🤔
It is really annoying though, would be neat if addaction actions could be separated from this and even have a new shiny parameter to define the amount of time to be visible (maybe even both of those dimmStart and dimmEnd times). Somehow sounds like a very deep change though.
Maybe it would easier to have a command to set/get that whole UI fadeout time via scripting so one could set it longer until longer hold action is done, dunno.
If addAction is not changed at the engine level, there are a few workarounds to achieve the desired effect.
If the user's action menu is closed, and then looks at a new object with an addAction (Or it appears on his body): The addAction window text will not fade.
However, this case cannot be guaranteed and most users may not know to do that before starting a long task.
I have developed three possible workarounds that can be used, two involve creating your own holdAction function, one only requires creativity for setting the _condShow parameter and has an example code.
- Assuming your custom HoldAction function has code that runs every frame in the addAction's condition field AND you have a way to detect when the action starts: You can toggle the action's visibility off for one frame, then turn it back on. This will cause the action menu to think it's a new action and it will not start the fade-out timer.
- Your custom holdAction function can use BIS_fnc_dynamicText to place an icon with text at the exact same spot where action text would go. Then use setUserActionText to make textWindowBackground and textWindowForeground empty so that only BIS_fnc_dynamicText sets the displayed text.
- This is the easiest to do by copying the below code. Tested in Arma 3 v2.06. It refreshes the action window text so that it does not start fading. This also results in the action menu being hidden (Bonus feature?).
// addAction Anti-fader by Caleb Serafin, 2022, MIT License. Feel free to use. Tested in Arma 3 v2.06. // WARNING: This depends on undocumented functionality and will need an update if breaking changes are made to BIS_fnc_holdActionAdd. MyTag_BIS_holdAction_wasRunning = false; private _condShow = str { [] call { private _actualCondition = true; // YOU CAN CHANGE VALUE TO BY YOUR NORMAL SHOW CONDITION. if (!bis_fnc_holdAction_running) exitWith { MyTag_BIS_holdAction_wasRunning = false; _actualCondition; }; if (MyTag_BIS_holdAction_wasRunning) exitWith { _actualCondition; }; MyTag_BIS_holdAction_wasRunning = true; false; // Hide it for one frame to stop action menu timeout. };} trim ["{}",0]; // Make sure to have another character like a semi-colon so that trim doesn't remove the closing brace. // Example of use: [player, "Hold Me", nil, nil, _condShow, nil, nil, nil, nil, nil, nil, 30] call BIS_fnc_holdActionAdd;