wyattwic 38 Posted September 13, 2015 Hello, Ive been messing around with this addaction and I am having one heck of a time placing an sleep into the condition of this addaction without error. Any ideas? _unit addAction [ "Holster Weapons", "client/holster.sqf", true, //EDIT - This line should return (_this select 3) as "true" am I right? 1, false, false, "", "(!(currentWeapon _target == '') && (_target == _this))" ]; Any help would be appricated! Share this post Link to post Share on other sites
Heeeere's johnny! 50 Posted September 13, 2015 The addAction condition is handled by the engine and is executed on each frame in unscheduled environment (call), so of course there must not be any sleep in there. Why would you want to do that anyways? //EDIT - This line should return (_this select 3) as "true" am I right? Yes Putting (_target == _this) into the condition is not needed if you add the action to the player object, because as the BIKI says it, the "[c]reated action is only available on the computer where command was executed." So in your case, _target is already _this. Share this post Link to post Share on other sites
wyattwic 38 Posted September 13, 2015 The addAction condition is handled by the engine and is executed on each frame in unscheduled environment (call), so of course there must not be any sleep in there. Why would you want to do that anyways? Yes Putting (_target == _this) into the condition is not needed if you add the action to the player object, because as the BIKI says it, the "[c]reated action is only available on the computer where command was executed." So in your case, _target is already _this. Thanks Johnny, reason why I would like a sleep in there is because the conditional does not need to be checked every frame. When its all said and done with, I need to be running as lean as possible. When it comes to locality, in this specific instance it is local client, but what happens when its added to the player by the server? Share this post Link to post Share on other sites
Heeeere's johnny! 50 Posted September 13, 2015 reason why I would like a sleep in there is because the conditional does not need to be checked every frame. I'm currently developing an action manager for that very reason, so you can easily add and remove actions whenever needed, e.g. on trigger condition. Still needs some testing, but it's gonna come out very soon and maybe it fits your needs. When it comes to locality, in this specific instance it is local client, but what happens when its added to the player by the server? Well, using addAction on the server is not senseful for the mentioned reason that only the server ("the computer where command was executed") has that action then. Use addAction only client side. Share this post Link to post Share on other sites