Jump to content
thirith

Possible to turn a sheep into a Virtual Arsenal?

Recommended Posts

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 :f:) how I could spawn a single sheep and turn it into a Virtual Arsenal?

Share this post


Link to post
Share on other sites

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

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

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

  • Like 1

Share this post


Link to post
Share on other sites

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

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.

  • Like 2

Share this post


Link to post
Share on other sites

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
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

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
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.

  • Like 1

Share this post


Link to post
Share on other sites

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. :evil:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×