Jump to content

custom ai island


MrFlopsy

Recommended Posts

Is there a tutorial which shows how to create a custom ai island. It would be on napf and have a loot crate with custom loot which is reset on server restart, and would have constant so patrols, I plan on using the island at the top right of the map.

Link to comment
Share on other sites

  • 3 weeks later...

How would I go about adding the loot crate which resets on restart, and how would I edit napf in the editor

 

i've created a static AI mission on Skalisty Island, i've used WAI but added code to randomise the chance of AI spawning (out of 40 possible spawn locations, at least 25 or more spawn with 2-3 AI per group) , I also randomise the chance and position of static weapons and finally when players get close enough to the loot after killing the first wave of AI, there's a random chance that 1-3 helis with 8 bandits per sweep will paradrop in.  Makes the island tough as hell, but well worth it for the loot.

 

Here's my script that spawns in the loot crates, look at the code and you'll see how i've done it:

private ["_SKALIKEABAF_VehicleBox","_SKALAmmobox_PMC","_SKALBAF_OrdnanceBox","_SKALBAF_VehicleBox","_SKALBAF_BasicWeapons","_SKALSpecialWeaponsBox","_SKALRUBasicWeaponsBox","_SKALGERBasicWeapons_EP1"];



_SKALAmmobox_PMC = [13772.143, 2910.552];
_SKALBAF_OrdnanceBox = [13768.698, 2915.1238];
_SKALBAF_VehicleBox = [13771.743, 2906.7522];
_SKALBAF_BasicWeapons = [13774.955, 2912.5815];
_SKALSpecialWeaponsBox = [13708.245, 2914.8281];
_SKALRUBasicWeaponsBox = [13706.539, 2918.5696];
_SKALGERBasicWeapons_EP1 = [13705.673, 2913.3411];
_SKALIKEABAF_VehicleBox = [13763.668, 2922.8923];

_crate = createVehicle ["BAF_VehicleBox",_SKALIKEABAF_VehicleBox,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\ikea.sqf";
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["Ammobox_PMC",_SKALAmmobox_PMC,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\foodndrink.sqf";
_crate setDir 74.73938;
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["BAF_OrdnanceBox",_SKALBAF_OrdnanceBox,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\money.sqf";
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["BAF_VehicleBox",_SKALBAF_VehicleBox,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\allweapons.sqf";
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["BAF_BasicWeapons",_SKALBAF_BasicWeapons,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\foodndrink.sqf";
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["SpecialWeaponsBox",_SKALSpecialWeaponsBox,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\guns.sqf";
_crate setDir -46.063427;
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["RUBasicWeaponsBox",_SKALRUBasicWeaponsBox,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\guns.sqf";
_crate setVariable ["permaLoot",true];

_crate = createVehicle ["GERBasicWeapons_EP1",_SKALGERBasicWeapons_EP1,[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\modules\skalisland\ammo.sqf";
_crate setVariable ["permaLoot",true];

I'm using the Skal Island castle map edition (can't remember where I got it at this moment).

 

An example of one of the crate filler scripts is here (ikea.sqf):

_crate = _this select 0;

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;

_ChainSaws = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"] call BIS_fnc_selectRandom;
_ChainSawChance = floor(random 100);
if (_ChainSawChance < 25) then { 
_crate addWeaponCargoGlobal [_ChainSaws,1]; 
_crate addMagazineCargoGlobal ["ItemMixOil",ceil(Random 5)]};

_documentChance = floor(random 100);
if (_documentChance < 15) then { 
_crate addMagazineCargoGlobal ["ItemDocumentRamp", (random 2)];
_crate addMagazineCargoGlobal ["ItemORP", ceil(random 2)];
_crate addMagazineCargoGlobal ["ItemAVE", ceil(random 2)];
_crate addMagazineCargoGlobal ["ItemLRK", ceil(random 2)];
_crate addMagazineCargoGlobal ["ItemTNK", ceil(random 2)];
};

_crate addWeaponCargoGlobal ["ItemToolbox", (random 6)];
_crate addWeaponCargoGlobal ["ItemMatchbox_DZE", (random 6)];
_crate addWeaponCargoGlobal ["ItemHatchet_DZE", (random 6)];
_crate addWeaponCargoGlobal ["ItemEtool", (random 6)];
_crate addWeaponCargoGlobal ["ItemCrowbar", (random 6)];

_crate addMagazineCargoGlobal ["cinder_wall_kit",(random 8)];
_crate addMagazineCargoGlobal ["ItemComboLock",(random 4)];
_crate addMagazineCargoGlobal ["ItemWoodWallGarageDoorLocked",(random 6)];
_crate addMagazineCargoGlobal ["ItemWoodFloorHalf", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodWallLg", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodWallWindowLg", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodFloorQuarter", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodWallWindow", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodWall", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodLadder", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodFloor", (random 10)];
_crate addMagazineCargoGlobal ["ItemWoodStairs", (random 3)];
_crate addMagazineCargoGlobal ["CinderBlocks", (random 10)];
_crate addMagazineCargoGlobal ["MortarBucket", (random 10)];
_crate addMagazineCargoGlobal ["ItemPole", (random 10)];
_crate addMagazineCargoGlobal ["PartWoodLumber", (random 30)];
_crate addMagazineCargoGlobal ["PartWoodPlywood", (random 30)];
_crate addMagazineCargoGlobal ["bulk_empty", (random 10)];
_crate addMagazineCargoGlobal ["ItemSandbag", (random 10)];
_crate addMagazineCargoGlobal ["metal_floor_kit", (random 5)];


_crate addMagazineCargoGlobal ["ItemTankTrap", (random 10)];

_crate addMagazineCargoGlobal ["forest_large_net_kit", (random 2)];

_crate addMagazineCargoGlobal ["forest_net_kit", (random 2)];

_crate addBackpackCargoGlobal ['DZ_LargeGunBag_EP1',1]; 

Hope that helps.  To get the crate locations, just add them in the editor, then open the mission.sqf file and take the coords and crate model, put it in the script like the one I've provided as an example.  It's always better to call this scripts from your server pbo, you can do a lot more with it, like stop them disappearing with the permaloot fix for example ;)

Link to comment
Share on other sites

Answering your question..

 

For the AI i used WAI system, and you can find it in here:   

The loot crate i added with a custom script, i'm going to paste it on pastebin for you, here: http://pastebin.com/Cs5cp9np

I placed the ammobox.sqf inside a folder called "scripts" and this folder is on the sameone as my init.sqf.

 

Then add the code to call the ammobox script in your init.sqf - add the code below in the end of your init

//Custom scripts
[] execVM "scripts\ammobox.sqf";

to add the custom things on the map, there is a lot of tutorials out there, like this 

 

But you can google it, looke for something like "dayz custom buildings" and you'll find it! =D

 

Hope you understand what i mean, i'm not that advanced in scripting, but i hope i can help you.

Link to comment
Share on other sites

If you're going to add the scripts and ammo crates in the mission.pbo and not the server pbo , then get ready to play around with Battleye. Do not under any circumstances just remove or 1"" your exceptions in BE, or you're going to have hackers all day long!

 

Tip: Adding scripts server side removes the need to play with battle eye, as scripts run on the server are ignored by BE.

Link to comment
Share on other sites

i've created a static AI mission on Skalisty Island, i've used WAI but added code to randomise the chance of AI spawning (out of 40 possible spawn locations, at least 25 or more spawn with 2-3 AI per group) , I also randomise the chance and position of static weapons and finally when players get close enough to the loot after killing the first wave of AI, there's a random chance that 1-3 helis with 8 bandits per sweep will paradrop in.  Makes the island tough as hell, but well worth it for the loot.

 

How did you do to make the WAI to spawn at random position? Because i have the same system but with static spawns.

I want to have, for example, minimum of 10 ground units spawning in 15 possible locations, something like this..

Can you help me?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...