thirith 27 Posted June 30, 2017 I'm currently putting together a sort of lobby mission for my coop group, a place where people can hang out once they've logged in, check if all the mods are correctly installed and have some fun with weapons and vehicles. I've added a crate that acts as a Virtual Arsenal - but I'd quite like to be a bit silly and have a Virtual Arsenal sheep, since our Steam group's logo is a military sheep. Unfortunately I only seem to be able to create a module that in turn spawns sheep, rather than create a single sheep and add the Arsenal code to its Init field. Any tips (from people who are okay with a break from milsim realism ) how I could spawn a single sheep and turn it into a Virtual Arsenal? Share this post Link to post Share on other sites
xjoker_ 25 Posted June 30, 2017 I guess you just have to put the sheep on the map within the editor, and use a addAction on it which open the virtual arsenal this addAction ["Arsenal", {["Open",true ] spawn BIS_fnc_arsenal;}]; Share this post Link to post Share on other sites
thirith 27 Posted June 30, 2017 That's the thing: I can't find individual animals (other than rabbits) in the editor. Perhaps I'm looking in the wrong place, but even a search didn't produce any useable results. Share this post Link to post Share on other sites
xjoker_ 25 Posted June 30, 2017 try to put a rabbit, save the mission, then edit it manually in a text editor. Then replace Rabbit_F to Sheep_random_F, save the file and reload the mission in the editor 1 Share this post Link to post Share on other sites
thirith 27 Posted June 30, 2017 Cool, will try that. Thanks! Edit: I just tried it, and unfortunately the command to open the Arsenal just doesn't open. This is the code I've got in the Init field (copied from a Steam discussion): this addaction ["Open Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }]; Share this post Link to post Share on other sites
Larrow 2779 Posted June 30, 2017 Something rings a bell that agents do not support addActions. Instead place the action on each player and give the sheep a variable name and use the addActions condition to see if the player is looking at the sheep via cursorObject. 2 Share this post Link to post Share on other sites
thirith 27 Posted June 30, 2017 Yup, that worked. I tried to add a double condition - cursorObject and proximity to the sheep - but couldn't get the latter to work for some reason. Still, it works well enough just using cursorObject. Thanks! Share this post Link to post Share on other sites
johnnyboy 3739 Posted June 30, 2017 14 hours ago, Larrow said: Something rings a bell that agents do not support addActions. That's a fact jack. I used the same solution for heal actions on dogs (added action to player and units instead). Share this post Link to post Share on other sites
thirith 27 Posted July 1, 2017 How did you set the conditions? Just with cursorObject or did you use anything else, e.g. proximity? If so, could you post your code, please? Share this post Link to post Share on other sites
Larrow 2779 Posted July 1, 2017 player addAction[ "Open Arsenal", { ["Open",true] call BIS_fnc_arsenal; },[],1,true,true,"","cursorObject isEqualTo mySheep && {_target distanceSqr mySheep < (2^2)}"]; Where mySheep is the variable name given to your animal. _target is available in the condition and is the OBJECT the addAction has been placed on (the player). OR you could use _this which is the unit current trying to use the addAction. See the wiki for available variables passed to both the addActions code and condition. 1 Share this post Link to post Share on other sites
thirith 27 Posted July 2, 2017 Brilliant, I'll add this ASAP. ... of course, the first thing my guys did when they joined the lobby mission was shoot the sheep. Still, even when dead it could be used as a Virtual Arsenal - and I'm not sure it's ickier to pull guns from a dead sheep than from a live one. Share this post Link to post Share on other sites