Jump to content

Recommended Posts

Dynamic Animal/Game Spawn Script

 

This script will continuously spawn animals that can be hunted (and butchered with the ravage mod and the mods "Survival systems" module active) in proximity of the player.

 

Showcase Video: 

(This is just showing the basic functions with speed up despawn times and reduced spawn/despawn distances FYI)

 

 

 

Functions of the script:

- spawn loop for animals

- random number and type of animals

- can be butchered (using the ravage mod and a knife)

- despawn once player moves away

- customizable code

 

How to create, use and Install the script:

Step 1 - init.sqf

1. Open notepad.

2. Copy this code ------->  [] execVM "animalspawner.sqf";  

3. Paste the code into your notepad doc.

4. Save the notepad document with this name ----->  init.sqf

5. Move the init.sqf to your mission folder.

===================================

Note - if you already have an init.sqf then just add the code from 2 to it.

 

Step 2 - "animalspawner.sqf"

1. Open notepad.

2. Copy this code ------> from the spoiler below

3. Paste the code below into your notepad doc.

4. Save the notepad document with this name ------> animalspawner.sqf

5. Move the animalspawner.sqf to your mission folder.

=========================================

animalspawner.sqf code:

Spoiler

while {true} do {
_pos = [getPosATL player, 100, 250, 0, 0, 100	, 0] call BIS_fnc_findSafePos; // the first two numbers are the minimum and maximum range that the animals spawn related to the players position

_eastGrp = createGroup east;
for "_i" from 0 to random 4 do {
	_type = ["Hen_random_F","Rabbit_F","Goat_random_F","Sheep_random_F"] call BIS_fnc_selectRandom;
 	_unit = _eastGrp createUnit [_type, _pos, [], 1, "FORM"];
	_unit setVariable ["BIS_fnc_animalBehaviour_disable", true];
	_unit setSpeaker "NoVoice";
  _unit disableAI "FSM";
	_unit disableAI "AIMINGERROR";
	_unit disableAI "SUPPRESSION";
	_unit disableAI "AUTOTARGET";
	_unit disableAI "TARGET";
	_unit setCombatMode "BLUE";
	_unit setBehaviour "CARELESS";
};
[_eastGrp, _pos, 250] call BIS_fnc_taskPatrol;

sleep 600; // sets the time of how long the animals remain spawned. After this duration, and if the player is not close by (see below line), the animals will despawn and the script starts again (e.g. new animals spawn close to your current location)
WaitUntil {player distance _pos > 255}; //After the above sleep timer has expired, this line will stop the script-looper (including deletion) until the player is 450 meters away from the animals latest spawn position. set it a few meters more than the maximum spawn distance.

//the below lines delets the animals
if(isNil("_eastGrp"))exitWith{};
{
	if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};
	deleteVehicle _x;
}forEach units _eastGrp;
};

 

 

 

Script Dependencies:

No dependencies.

However, the Ravage mod and the mods "Survival systems" module is required to butcher the animals and process their meat. You can find all about the Ravage mod here: LINK

 

Setting up the Script in the editor:

1. Find the Ravage section in your Editors "Systems" tab.

2. Place the module "Survival systems"

Note: you need a "Gutting Knife" (from the Ravage mod) to butcher the animals

 

5. Place your player and start your mission.

 

Using the script without Ravage mod:

- the script runs without the Ravage mod active, no changes needed

 

Credit:

 

the basic template for the spawner came from a fellow ravager, however I can not trace back the specific post anymore. so shout out to all the friendly scripters from the ravage comunity for all their input;)!

 

Edited by Vandeanson
Credits added
  • Like 5
  • Thanks 2

Share this post


Link to post
Share on other sites

Pardon if this sounds like a dumb question but is their behavior similar to the hare in Ravage(will they run if alerted)?

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, miasdad said:

Pardon if this sounds like a dumb question but is their behavior similar to the hare in Ravage(will they run if alerted)?

very good question @miasdad!

I tested it and no, they will not flee. I have briefly tried to implement that but so far i did not get it to work. Chicken, goats and sheeps that are spawned with the script will not flee, but i think hares do.

So if anyone knows how to force such behaviour onto them please let me know and i will happily implement it. I think it would be a great addition to the script!

  • Like 2

Share this post


Link to post
Share on other sites

@Vandeanson this looks great. 

Feel free to include my JBOY Chicken scripts if you like.  The scripts are fairly simple, and chickens will fly away when person or vehicle gets too close.   Plus they have nice feather effects when shot.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
On 7/28/2018 at 7:19 AM, Vandeanson said:

Note: you need a "Gutting Knife" (from the Ravage mod) to butcher the animals

Is the Gutting script part of Ravage or in your script?  If in your script I suggest attaching a knife to player's hand during gutting animation to add a bit more realism.   Then detaching and hiding knife when animation complete.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, johnnyboy said:

Ravage or in your script?

 

it's part of ravage , but  it would be very cool to have this animation !

 

I 'm still wondering why there aren't these kind of animations in the game !

 

I remember me doing this to a player !

  • Like 1
  • Thanks 1

Share this post


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

@Vandeanson this looks great. 

Feel free to include my JBOY Chicken scripts if you like.  The scripts are fairly simple, and chickens will fly away when person or vehicle gets too close.   Plus they have nice feather effects when shot.

thanks man! i like it, gotta include this!

 

With regards to the gutting, that is from the ravage mod as @GEORGE FLOROS GR confirmed, i have just made sure to only spawn animals that can be gutted. i believe there was a cow mod where the gutting would not work. obviously it would be cool to have deers boars and bears and such, but well.. i do not have the skills and knowledge to create that;) also if someone would export all those stalker mutants from armstalker mod that would be too good...

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, Vandeanson said:

it would be cool

 

Maybe we should check for this further !

It would be great to have such things !

 

Share this post


Link to post
Share on other sites
On 31/07/2018 at 9:58 AM, Vandeanson said:

....also if someone would export all those stalker mutants from armstalker mod that would be too good...

 

I'd rather starve than eat a mutant...:yuck: 

  • Haha 5

Share this post


Link to post
Share on other sites

cant be too picky in the Apocalypse=D

  • Haha 3

Share this post


Link to post
Share on other sites
2 hours ago, Vandeanson said:

cant be too picky

This is why in the apocalypse they have this  Dress code ?!

 

 

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, GEORGE FLOROS GR said:

This is why in the apocalypse they have this  Dress code ?!

 

haha, i would go for full camo 24/7:))

  • Thanks 1

Share this post


Link to post
Share on other sites
On 31.7.2018 at 7:31 PM, GEORGE FLOROS GR said:

 

Maybe we should check for this further !

It would be great to have such things !

 

i know about sharks, hostile/friendly dogs, dinos, rideable horses(!) and the mutants, but they are part of the armstalker mod unfortunatel:(

  • Like 1

Share this post


Link to post
Share on other sites

If so then we need to add a ravage action to make them working with the skinning.

 

I will try to do this!

 

 

. . . But not for the mutants ok ?!

 

Because :

16 hours ago, EO said:

I'd rather starve than eat a mutant...:yuck: 

BiohazardWithChopsticks.jpg

  • Like 4

Share this post


Link to post
Share on other sites

I twicked just a little bit Haleks script.

 

This is an example:

 

Skinning !

jVuYc52vSt_r4B0erCDFRQ.png

0omFcguORse9oOoGPeVPTw.png

It's not the correct meat though !

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
2 hours ago, GEORGE FLOROS GR said:

It's not the correct meat though !

Yummm, "long pork".  Don't do it GeorgyBoy.  I will be forced to put cannibals in my next mission.   Don't make me do it... :scared:

humanflesh_4296.jpg

  • Haha 5

Share this post


Link to post
Share on other sites

You killed Billy! NOOOO!!!

goatlivesmatter-justiceforbilly-meme-309

:rofl::rofl::rofl:

  • Haha 4

Share this post


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

Yummm, "long pork".  Don't do it GeorgyBoy.  I will be forced to put cannibals in my next mission.   Don't make me do it... :scared:

 

I have already start of thinking  ,  on what might be the video , for that next mission ?

YIKES !

 

 

  • Haha 2

Share this post


Link to post
Share on other sites
On 2/8/2018 at 8:59 PM, johnnyboy said:

Yummm, "long pork".  Don't do it GeorgyBoy.  I will be forced to put cannibals in my next mission.   Don't make me do it... :scared:

 

. . . It's already to late for this !

 

gf-skinning-script-version-10-6_4.png

 

I'll be waiting for the mission !

 

also there is an exclude list available , according to players dietary lifestyles.

On 1/8/2018 at 10:01 PM, EO said:

I'd rather starve than eat a mutant...:yuck: 

 

more info here:

 

Thanks to everyone !

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Couldn't get the script to work earlier today. No animals spawned at all. Still working?

Share this post


Link to post
Share on other sites

hi man,

 

it's a nice little script that do a good job.

I put it in my mission (lightly modified).

 

thank you very much

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@VandeansonWEIRD QUESTION

 

Does this script use _eastGrp all the time so no other groups are created ?

 

or does it create a new group [_eastGrp_01, _eastGrp_02, _eastGrp_02] each time the script "resets".

 

if so running this 6 times an hour for a 24 hour mission will create 144 groups ?

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

×