Jump to content

Dayz style heli crash sites


Richie

Recommended Posts

 

The ammo should spawn with the weapon Darth, no idea why RHS weapons would be different, the following code spawns the ammo unless you changed it ?

case (isClass (configFile >> "CfgWeapons" >> _item)): {
                    _kindOf = [(configFile >> "CfgWeapons" >> _item),true] call BIS_fnc_returnParents;
                    if ("ItemCore" in _kindOf) then {
                        // Min 1, Max 2
                        _crate0 addItemCargoGlobal [_item,(floor(random(2)))+1];
                        _crate1 addItemCargoGlobal [_item,(floor(random(2)))+1];
                    } else {
                        // One Weapon, Three Mags
                        _crate0 addWeaponCargoGlobal [_item,1];
                        _crate1 addWeaponCargoGlobal [_item,1];
                        
                        _cAmmo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
                        {
                            if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {
                                _crate0 addMagazineCargoGlobal [_x,3];
                                _crate1 addMagazineCargoGlobal [_x,3];
                            };
                        } forEach _cAmmo;
                    };
                };

 

thats not exactly correct ... this only spawns ammo for weapons that have a price in the confg, so his problem is most likely this line:

if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {

try change this block:

                        {
                            if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {
                                _crate0 addMagazineCargoGlobal [_x,3];
                                _crate1 addMagazineCargoGlobal [_x,3];
                            };
                        } forEach _cAmmo;

to this:

                        _crate0 addMagazineCargoGlobal [(_cAmmo select 0),3];
                        _crate1 addMagazineCargoGlobal [(_cAmmo select 0),3];
Link to comment
Share on other sites

@second_coming:

 

How do I decrease the amount of boots at the scene?

 

Edit the spawn line and change  XXX to the number of AI you want to spawn:

//Infantry spawns using the A3EAI
_CrashName = format ["Crashsite_%1",_j];
[_CrashName,_posOfCrash,75,XXX,2,false,300] call A3EAI_createCustomInfantryQueue;	
diag_log text format ["[HeliCrash]: Creating AI at %1 (%2)",_CrashName,_posOfCrash];
Link to comment
Share on other sites

That fixed it!  Works perfectly now.  Although I do have to mention that the weapons that were not spawning ammo at the crashes were listed in cfgPricing.  

 

in that case i guess it you change this to mission config?

 

if that is the case, try change this:

if (isClass(configFile >> "CfgPricing" >> _x)) exitWith {

to this:

if (isClass(missionConfigFile>> "CfgPricing" >> _x)) exitWith {
Link to comment
Share on other sites

Check your RPT logs, search for the word 'heli' and you should see :

 

"Loading Heli Crashes"
"Heli Crashes Loaded"

 

If you see that then it's loaded and working :)

Try increasing the number of sites while testing, that way they'll be easier to find when there is more on the map, Altis is huge so 5 could be hard to miss.

Link to comment
Share on other sites

Yes I have A3EAI custom spawn set to true I have other custom spawns working, do I need a line in the A3EAI custom spawn file. It says in the log creating ai at crashsite but non spawn. Does it work with random crashsites or do they need to be custom placed.

Link to comment
Share on other sites

Getting the following error with this script:

 

13:10:11 BattlEye Server: Player #0 Gaius Cavadus - GUID: d3fa20a0829d05d87bda95025f60cd22 (unverified)
13:10:15 Player Gaius Cavadus connected (id=76561197979455288).
13:10:15 BattlEye Server: Verified GUID (d3fa20a0829d05d87bda95025f60cd22) of player #0 Gaius Cavadus
13:10:22 BattlEye Server: Script Log: #0 Gaius Cavadus (d3fa20a0829d05d87bda95025f60cd22) - #22 "(_this select 0) execVM "\A3\Structures_F\Wrecks\Scripts\Wreck_Heli_Attack_01.sqf""
13:10:22 Player Gaius Cavadus kicked off by BattlEye: Script Restriction #22
13:10:22 Player Gaius Cavadus disconnected.

 

 

Every single person that tries to connect gets booted.

Link to comment
Share on other sites

Cavadus, at the end of line 23 of your scripts.txt add :

!="execVM "\A3\Structures_F\Wrecks\Scripts\""

 

If that doesn't work try :

!="execVM "\A3\Structures_F\Wrecks\Scripts\Wreck_Heli_Attack_01.sqf""

 

Then save the txt file and join the server, no restart needed for a filter change.

Link to comment
Share on other sites

thank you for tha.

 

when the script spawns the crash sites does it in appearing rpt log cause ive checked my and isnt showing

 

No it doesn't log the location, it will tell you if the script ran, look for these 2 lines :

"Loading Heli Crashes"
"Heli Crashes Loaded"
Link to comment
Share on other sites

hey richie, a few things i would like to say ...

 

first off i got sick of the crashsites always spawing in the altis desert, basicly on top of eachother, so i decided to change the beginning, to this:

_spawnCenter = getMarkerPos "center"; //Center of any map
_allpositions = [];
for "_j" from 1 to _crashNum do {

	_posOfCrash = _spawnCenter;
	while{true}do{
		_posOfCrash = [_spawnCenter,0,7000,25,0,20,0] call BIS_fnc_findSafePos; // find a random loc
		if({_posOfCrash distance _x < 2000}count _allpositions < 1 && _posOfCrash distance _spawnCenter > 2000 || count _allpositions < 1)exitWith{};
	};
	_allpositions pushBack _posOfCrash;

now for a little note, if you add this at the end, you can check where your crashes spawn at:

	//create marker
	_marker = createMarker [format["CrashSite_%1",_j],_posOfCrash];
	_marker setMarkerType "mil_dot";
	_marker setMarkerSize [1.25, 1.25];
	_marker setMarkerColor "ColorRed";
	_marker setMarkerText "Helicrash";

if you do this on chernarus, you will notice that with 12000 as range it will place most crashes outside the map ... i suggest you lower it to about 6-7k instead to force them inside the map borders.

 

 

also this gun has a problem and should not be used:

"srifle_DMR_03_spotter_F"
Link to comment
Share on other sites

Anyone who wants to add this to chernarus map:

 

 

use this : _spawnCenter = [9528,6535,0];

 

and this: _max = 7100;

 

and none of the crash sites should spawn in the debug zone.

 

I`ve to say that the count of my crash sites was 13 max while playin with the coordinates so i cant tell if a higher count would result in spawning crash sites in the debug zone. this u would have to find out urself. but for less it works.

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
×
×
  • Create New...