Jump to content
chrisbaker1981

Activate Animal Site With Trigger

Recommended Posts

Ok ive sarched for this, and havent found anything.

I want an animal site module, chickens in particular, to only be active when i walk through a trigger.

 

Syncing a trigger to an animal site doesnt seem to do anything.

 

Anyone know how to make the animal site active only when a player enters the trigger?

 

The scene - Its night time, I go inside a house at night, i have a fade out fade in, time passes. And its morning, i walk outside and i want to see chickens running around...

 

Thanks 🙂

  • Like 1

Share this post


Link to post
Share on other sites

I'm not sure about the trigger to activate them, but once you have that working, you might be interested in chickens that make noise and react to nearby humans and vehicles:

 

 

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, johnnyboy said:

I'm not sure about the trigger to activate them, but once you have that working, you might be interested in chickens that make noise and react to nearby humans and vehicles:

 

 

Well this looks pretty cool thanks will take a look 🙂 but yea, really need animals to spawn when i want them to, ie in the morning i want the chickens to come out their coop and be roaming around.. Stupid things that nobody playing my mission cares about , except me! 🙂

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, chrisbaker1981 said:

Syncing a trigger to an animal site doesnt seem to do anything.

Anyone know how to make the animal site active only when a player enters the trigger?

 

 

Don't use the Sites module, use the Animals module found under Others in the Editor, this module works with triggers. :rthumb:

 

Edit: If you want to add a few cockerels into the mix, I made a little mod that adds more animals to the Animals Module, be aware however it will add a dependency to your mission. 

  • Like 1

Share this post


Link to post
Share on other sites

Good tip from EO.

 

Also, my Turbo Chicken example mission is a good start for you to figure this out.  See this code in the init.sqf:

Spoiler

//if(!isServer) then {waitUntil{!isNull player}};
JBOY_say3d =              compile preprocessFileLineNumbers "JBOY\JBOY_say3d.sqf";
JBOY_turboChicken =       compile preprocessFileLineNumbers "JBOY\JBOY_turboChicken.sqf";

//if jip player then exit
_JIPplayer = not isServer && isNull player;
if (_JIPplayer) exitwith {};
// **************************************************************************
// Create some rabbits and chickens explicitly.  These small animals will run or fly when dog or man approaches.
// **************************************************************************
R1 = createAgent ['Rabbit_F', rabbitPos getRelPos [2,   0], [], 0, "NONE"];
R2 = createAgent ['Rabbit_F', rabbitPos getRelPos [5,  90], [], 0, "NONE"];
R3 = createAgent ['Rabbit_F', rabbitPos getRelPos [4, 180], [], 0, "NONE"];
R4 = createAgent ['Rabbit_F', rabbitPos getRelPos [2, 270], [], 0, "NONE"];
{nul = [_x, false] execVM "JBOY\JBOY_animalScatter.sqf";} foreach [R1,R2,R3,R4]; // rabbits will scatter when dog or man near.
C1 = createAgent ['Cock_random_F', rabbitPos getRelPos [3, 200], [], 0, "NONE"];
C2 = createAgent ['Cock_white_F', rabbitPos getRelPos [2, 100], [], 0, "NONE"];
C3 = createAgent ['Cock_random_F', rabbitPos getRelPos [4, 200], [], 0, "NONE"];
C4 = createAgent ['Cock_white_F', rabbitPos getRelPos [1, 100], [], 0, "NONE"];

// **************************************************************************
// Also look at Animals Module in this mission used to create hens.
// It has the following line of code in the module's init field, which readies
// the birds and rabbits to scatter.
// **************************************************************************
// nul = [this, 20, true] execVM "JBOY\addBirdDamageEHs.sqf";

 

In this mission the hens are created via an editor placed animal module (as described in commented out code at bottom of init.sqf).  But the cockerels are created in the init.sqf using createAgent:

C1 = createAgent ['Cock_random_F', rabbitPos getRelPos [3, 200], [], 0, "NONE"];
C2 = createAgent ['Cock_white_F', rabbitPos getRelPos [2, 100], [], 0, "NONE"];
C3 = createAgent ['Cock_random_F', rabbitPos getRelPos [4, 200], [], 0, "NONE"];
C4 = createAgent ['Cock_white_F', rabbitPos getRelPos [1, 100], [], 0, "NONE"]

So in your case, you can use createAgent in your triggers to create hens and cockerels on demand wherever you want them.  Using createAgent means you don't need to use a module.

 

Either way will work for you.

  • Like 1

Share this post


Link to post
Share on other sites
On 6/12/2020 at 7:20 PM, chrisbaker1981 said:

The scene - Its night time, I go inside a house at night, i have a fade out fade in, time passes. And its morning, i walk outside and i want to see chickens running around...🙂

 

Another trigger based idea, add this code to the condition field of a trigger synced to the Animals module will spawn chickens at 06:30 in-game time...

floor daytime >= 06 && floor (60 * (daytime % 1)) >= 30;

🦃🐔🐓

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, EO said:

 

Don't use the Sites module, use the Animals module found under Others in the Editor, this module works with triggers. :rthumb:

 

Edit: If you want to add a few cockerels into the mix, I made a little mod that adds more animals to the Animals Module, be aware however it will add a dependency to your mission. 

Brilliant, Thanks EO exactly what i want, great stuff, thanks Jonnyboy for you mod as well, gonna try that out as well as funnily enough i want dudes hunting fowl at the end...  Thanks All

  • Like 2

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

×