total 1 Posted March 30, 2014 (edited) What must I do to have a constant Squad leader ONLY-Trigger, 50 meters around a movable Cargobox, with addAction ["Create FOB", "fobscript.sqf"] ? OLD: I want the Squad leader to have the ability to create a FOB spawn point by pressing "Place FOB" with the radio - one time only. One requirement: A specific object must be 0-50 feet away to build FOB. Is this object within reach and Squad Leader press "Place FOB" so there will be built a building and a Virtual ammo box right next to it + an invisible marker. Isn't the object within range = Hint message and no FOB. Does anyone have a suggestion on how I can do this? Edited April 3, 2014 by Total Share this post Link to post Share on other sites
jshock 513 Posted March 30, 2014 Should be pretty simple, create a radio trigger with "Place FOB" in the Text field and set it to only be used once. Then in the On Act pace a call to your script that would create the FOB (i.e. nul = [] execVM "fob_creator.sqf"; ). Then within the script have a check for if they are the squad leader, which you could do bu classname or the variable name of the unit, if they aren't have a hint that says this is for squad leaders only, but if they are move onto the next part of the script. Next part would be to check if they are less than 50m away from your special object, if not waituntil they are then check again, if they are within range move on. Then you get into the creation of the objects and such with createVehicle and other such scripting commands for objects and markers to get what you want. Share this post Link to post Share on other sites
total 1 Posted April 3, 2014 (edited) What must I do to have a constant Squad leader ONLY-Trigger, 50 meters around a movable Cargobox, with addAction ["Create FOB", "fobscript.sqf"] ? Edited April 3, 2014 by Total Share this post Link to post Share on other sites
Magirot 14 Posted April 3, 2014 (edited) You can use the condition parameter of addAction to implement that. init.sqf: if isServer then { FOB_created = FALSE; publicVariable "FOB_created" }; // on server and public to prevent JIP issues player addAction ["Create FOB", "fobscript.sqf", [], 1, TRUE, TRUE, "", "_this == _target && _this distance [b]cargobox_object[/b] < 50 && leader group _this == _this && !FOB_created"]; Then somewhere in fobscript.sqf put FOB_created = TRUE; publicVariable "FOB_created"; Don't know if it's for MP, just in case I put the public variables and the check for updating the leader. A trigger isn't necessary unless I missed something. Edit: Explanation for the command in case someone is wondering: player addAction ["Create FOB", "fobscript.sqf", [], 1, TRUE, TRUE, "", Stuff you have to give before getting to the condition. In order: Action name, script or code, extra arguments passed to the script, priority in the action menu, show text in the middle of the screen if active, close menu on use, shortcut key. _this == _target The condition field has two special variables available, _this referring to the person using the action and _target referring to the target. In this case the action is attached to the player itself, so this is kind of redundant, mainly for issues with switchable units in SP. _this distance cargobox_object < 50 Check that the activator is less than 50 meters from the vehicle named cargobox_object. leader group _this == _this Check that the activator is the leader of his group. Or is it leader group _this == leader _this? !FOB_created Check that variable FOB_created is FALSE. Edited April 3, 2014 by Magirot Share this post Link to post Share on other sites
total 1 Posted April 4, 2014 Thank you! - Again! Will test this as soon I get home from work! ;) Share this post Link to post Share on other sites
O.Languedoc 67 Posted April 4, 2014 I am also working on a deployable FOB that Will work with a mobile respawn system. Its différent from from what you are doing but you'll see the kind of issue we are having. http://forums.bistudio.com/showthread.php?174854-Mobile-HQ-that-deploys-from-a-Container-Addaction-issue-Need-help Share this post Link to post Share on other sites