Leopard20 813 Posted October 24, 2018 Hello everyone. Does anyone know a way to add hold actions to hidden units? Unfortunately, when a unit is hidden using hideObject the action doesn't appear anymore. However, if there was a way to hide the unit without using hideObject it would work. My first idea was to use setObjectTexture, but it doesn't hide the unit completely (the unit's face and arms are still visible) Share this post Link to post Share on other sites
HazJ 1289 Posted October 25, 2018 Or just add the action to yourself and supply some distance condition. 3 Share this post Link to post Share on other sites
Leopard20 813 Posted October 25, 2018 6 hours ago, HazJ said: Or just add the action to yourself and supply some distance condition. Not a bad idea. There's just one tiny problem. I'm creating a script that performs an action on the hidden unit and thus adding the action to the unit is more convenient (you can easily retrieve the unit, i.e. target, using the action parameters). If I add it to the player, I probably should resort to using something like this: _units = allUnits select {_x distance player < 7 && ([visiblePosition player, getDir player, 60, visiblePosition _x] call BIS_fnc_inAngleSector)}; _units = [_units, [], {_x distance2D player}, "ASCEND"] call BIS_fnc_SortBy; _unit = _units select 0; just to get the unit the player is looking at! Doesn't it make the game slow? 1 Share this post Link to post Share on other sites
HazJ 1289 Posted October 25, 2018 You can use cursorObject or var name if you know the specific unit. https://community.bistudio.com/wiki/cursorObject Share this post Link to post Share on other sites
Leopard20 813 Posted October 25, 2018 2 minutes ago, HazJ said: You can use cursorObject or var name if you know the specific unit. https://community.bistudio.com/wiki/cursorObject I don't want the player to look at the unit directly. The unit being in player's filed of view should suffice! Share this post Link to post Share on other sites
HazJ 1289 Posted October 25, 2018 There is also: https://community.bistudio.com/wiki/checkVisibility What you have should work though. Share this post Link to post Share on other sites
Leopard20 813 Posted October 25, 2018 What about this one: //adding this to the "action appear" condition _unit = cursorObject player; if !(_unit in WoundedUnits && _unit distance player < 7) then {_unit = objNull}; player setVariable ["patient", _unit]} and then using this variable in "condition progress" for further processing. Share this post Link to post Share on other sites
HazJ 1289 Posted October 25, 2018 What are you trying to do exactly? When do you want the action to appear? Specifics. Share this post Link to post Share on other sites
Leopard20 813 Posted October 25, 2018 18 minutes ago, HazJ said: What are you trying to do exactly? When do you want the action to appear? Specifics. Think of it as a healing script. I want to heal the unit. https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd What I meant by my previous code is that the action appears when you look at the unit and he's close to you. I use the "patient" variable to later retrieve the unit in the conditionshow, thus eliminating the need to look at the unit all the time and also using it in code progress part. Share this post Link to post Share on other sites
HazJ 1289 Posted October 25, 2018 Yeah. That's a good idea. So you can use cursorObject at first but then move. Once stored, in the action show (when looping round) just check the distance. No need for visibility then. In this case. Are you stuck with how to do that or? 1 Share this post Link to post Share on other sites
Leopard20 813 Posted October 25, 2018 17 minutes ago, HazJ said: Yeah. That's a good idea. So you can use cursorObject at first but then move. Once stored, in the action show (when looping round) just check the distance. No need for visibility then. In this case. Are you stuck with how to do that or? Nope! At least not yet! I just typed all that on my phone. I'll have to check it later on my computer! ;) Share this post Link to post Share on other sites