Vandeanson 1677 Posted July 28, 2018 (edited) 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 July 28, 2018 by Vandeanson Credits added 5 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted July 28, 2018 Thanks for this Vandeanson ! 1 Share this post Link to post Share on other sites
miasdad 94 Posted July 28, 2018 Pardon if this sounds like a dumb question but is their behavior similar to the hare in Ravage(will they run if alerted)? 1 Share this post Link to post Share on other sites
Vandeanson 1677 Posted July 28, 2018 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! 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted July 28, 2018 1 hour ago, Vandeanson said: how to force You can use an eventhandler FiredNear Check this by @phronk: 2 Share this post Link to post Share on other sites
johnnyboy 3793 Posted July 30, 2018 @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. 3 1 Share this post Link to post Share on other sites
johnnyboy 3793 Posted July 30, 2018 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. 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted July 31, 2018 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 ! 1 1 Share this post Link to post Share on other sites
Vandeanson 1677 Posted July 31, 2018 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... 1 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted July 31, 2018 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
EO 11277 Posted August 1, 2018 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... 5 Share this post Link to post Share on other sites
Vandeanson 1677 Posted August 2, 2018 cant be too picky in the Apocalypse=D 3 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted August 2, 2018 2 hours ago, Vandeanson said: cant be too picky This is why in the apocalypse they have this Dress code ?! 1 Share this post Link to post Share on other sites
Vandeanson 1677 Posted August 2, 2018 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:)) 1 Share this post Link to post Share on other sites
Vandeanson 1677 Posted August 2, 2018 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:( 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted August 2, 2018 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... 4 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted August 2, 2018 I twicked just a little bit Haleks script. This is an example: Skinning ! It's not the correct meat though ! 1 1 Share this post Link to post Share on other sites
johnnyboy 3793 Posted August 2, 2018 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... 5 Share this post Link to post Share on other sites
HazJ 1289 Posted August 2, 2018 You killed Billy! NOOOO!!! 4 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted August 2, 2018 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... I have already start of thinking , on what might be the video , for that next mission ? YIKES ! 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted August 10, 2018 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... . . . It's already to late for this ! 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... more info here: Thanks to everyone ! 2 1 Share this post Link to post Share on other sites
acoustic 82 Posted July 26, 2019 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
pSiKO 124 Posted July 23, 2020 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 1 Share this post Link to post Share on other sites
HVK Industries 0 Posted April 5 @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