Wildman132331 0 Posted August 10, 2024 Hello everyone! This is my first post on here so apologies if something's amiss with my delivery. I am using the following line in a unit's init who I want to activate a trigger upon the player walking up to them, scrolling through the action menu, and selecting "Start Briefing": this addaction ["Start Briefing",{Trigger_Con = true; publicVariable "Trigger_Con";}]; I am then activating the trigger with this line in the condition: Trigger_Con; It would seem things were going well at first, the player walked up to the unit and the briefing started after selecting the action in the menu, activating some code I put in the trigger's activation field, however, I ran into some limitations: 1. The distance at which I can activate the briefing by looking at the unit is ridiculous. (I assume it is 50m.) 2. The menu item "Start Briefing" by looking at the unit still remains after I use it, which I do not want. I have looked at the syntax for the addaction, but I find it confusing and can not get the result I want experimenting with that information. Much thanks if anyone can assist me with either problem. Share this post Link to post Share on other sites
JCataclisma 80 Posted August 10, 2024 Hello! I'd say that example #5 would be the easiest to show what we must focus on your case. The selection "hide on use" doesn't mean to hide/remove the action istelf, but only to hide the scroll menu after clicking. The action, though, will still be available. As the params' count starts on "0", the object which's got the action is "_this select 0" and "actionID" would be "_this select 2". So your first command lines inside the addAction code could be "_notPlayer = _this select 0; _usedAction = _this select 2;" , and then at the end you should use "_notPlayer removeAction _usedAction;", so that the action will be deleted after clicking on it. Still on the same example 5, you could change the "50" radius to something like "5", so that the action will only be shown when player is that close to the unit with the addAction. Try something like this, to check the effects: this addAction [ "Start Briefing", // title { _notPlayer = _this select 0; _usedAction = _this select 2; Trigger_Con = true; publicVariable "Trigger_Con"; _notPlayer removeAction _usedAction; }, nil, // arguments 7, // priority ("7" will force it to be shown way on top) true, // showWindow true, // hideOnUse "User5", // shortcut (just a suggestion, the action's executed also if you click the keybind you have on Config -> Controls -> Custom -> Custom 5 "true", // condition 5, // radius (need to get closer to see the action) false, // unconscious "", // selection "" // memoryPoint ]; https://community.bistudio.com/wiki/addAction?useskin=darkvector 4 Share this post Link to post Share on other sites
Wildman132331 0 Posted August 16, 2024 Thanks 🙂. It's working just how I want. Share this post Link to post Share on other sites