Jump to content

Recommended Posts

[] spawn {
	waitUntil {!isNil "DZE_safeVehicle"};
	sleep 5;
	_cascaVehicles = ["Lada2","UAZ_CDF","HMMWV_M1035_DES_EP1","Offroad_DSHKM_Gue","UAZ_MG_CDF","WMMWV_M998A2_SOV_DES_EP1"];
	DZE_safeVehicle = DZE_safeVehicle + _cascaVehicles;
};

Added this as updated in post #1.  We are not being killed by the cars now!   :) However, we are promptly kicked out of the vehicle.  Four of us tried and none of us were able to sit in the cars, but like I said, we don't blow up for trying.

 

@ Charles,

 

I will love to help. You already helped me! But even if you had not helped.

 

You can edit anything you want.

 

About dificulty, you believe a vehicle with turret could help? This can be done really simple, since the code for it, and for bigger convoys (4, 5, 6 vehicles) is ready.

 

 

Our vision would be one single mission running at a time, perhaps a few times per server restart (this part I believe I know how to change).

 

As far as the convoy, we would envision an armed vehicle at the front and rear, with perhaps 2-3 SUV's in the middle, each with 4-6 AI.  Does this sound pretty close to what's already available, as you mentioned?

 

That being said, we really like and appreciate the script how it is, too.

Share this post


Link to post
Share on other sites

nice work

 

convoys run good but they are way too easy if you have a M240 lol

 

how do we add the turrents back in ?

 

added  "HMMWV_Armored","HMMWV_M1035_DES_EP1" yet no gunner in gunner position.

 

Any way to add a heli to convoy 100m above make it follow the leader ?

 

would also like to have 4,5,6 vehicles in each convoy

 

I run this as a event ["any","any","any","any",30,"convoy"] placed convoy.sqf in the module folder server side and 2nd script in custom folder mission side.

Share this post


Link to post
Share on other sites

nice work

 

convoys run good but they are way too easy if you have a M240 lol

 

how do we add the turrents back in ?

 

added  "HMMWV_Armored","HMMWV_M1035_DES_EP1" yet no gunner in gunner position.

 

Any way to add a heli to convoy 100m above make it follow the leader ?

 

would also like to have 4,5,6 vehicles in each convoy

 

I run this as a event ["any","any","any","any",30,"convoy"] placed convoy.sqf in the module folder server side and 2nd script in custom folder mission side.

To have the vehicles use their turrets  go to approx line 520 and find the   _cars = [   

Mine looks like so:

_cars = [
//[vehicle, cargo places, [gunner 1 ammo, gunner 2 ammo, ...], loot]
["BAF_Jackal2_L2A1_w",3,[3,3],_loot1 call BIS_fnc_selectRandom],
 
 
 
its the  gunner ammo sections you need to change.  Dont forget to add the vehicle to the _cascaVehicles   sections as well just to be safe.
 
Thats how i got them to be armed.  The Jackal has 2 gunners, passenger, and a  driver.  
 
Next is to figure out how to get in a vehicle and stay in it.  I only wan tthem to stay till restart so people can sell them or use them temporarily. 
 
Hope this helps!  :)
 
 
 

Share this post


Link to post
Share on other sites

 

To make the vehicles enterable, remove this code from the script:

_motor addEventHandler ["GetIn",{
	_motor = _this select 0;
	_player = _this select 2;
	if (_player in playableUnits) then {
		_player action ['getOut', _motor];
	};
}];

 

could you do this?

_motor addEventHandler ["GetIn",{
			_motor = _this select 0;
			_player = _this select 2;
			if (_player in playableUnits) then {
				_nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5];
			};
		}];

Share this post


Link to post
Share on other sites

Every one of the _*rand variables (whether defined by BIS_fnc_selectRandom or by your loadout_fnc_selectRandom) contains exactly one item.  _rndnumber* are defined once and hold a constant number, so the randomization in the script,

		call compile format [
			"_motor %1 ['%2',%3];",
			_car select 3 select 0,
			_car select 3 select 1,
			_car select 3 select 2 select (_qtd - 1)
		];

will be for naught because every entry in [_rndnumber2, _rndnumber2, _rndnumber2]  is equal.

 

I assume you could do something like

_medicalrand = ["ItemPainkiller", "ItemMorphine", "ItemBandage", "ItemBloodbag", "ItemAntibiotic","ItemEpinephrine"];

[...]

["addMagazineCargoGlobal", (_medicalrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 2) + 2)]],

[...]

and repeat the last line a few times. Same for the other loot types. Note that the definition of _medicalrand now has no BIS_fnc_selectrandom, keeping the array intact for multiple choosing.

 

This way

  • there would be more lines generating medical loot in _loot1, each one picking randomly from _medicalrand and
  • each one generating a different set of numbers to be picked from.

When duplicating the lines in _loot you of course have to adjust the random number, that's lower (round(random 2)+2).

 

Ok, so I made some changes, but there's still just one item appearing in each vehicle. Here's the updated code I'm using:

 

_toolsrand = ["NVGoggles","ItemEtool","Binocular_Vector","ItemFlashlight","ItemWatch","ItemKnife","ItemHatchet","ItemCompass","ItemMap","ItemToolbox","ItemMatchbox","ItemFlashlightRed","ItemGPS","ItemCrowbar"];
_medicalrand = ["ItemPainkiller", "ItemMorphine", "ItemBandage", "ItemBloodbag", "ItemAntibiotic","ItemEpinephrine"];
_foodrand = ["FoodCanBadguy", "FoodCanBoneboy", "FoodCanCorn", "FoodCanCurgon", "FoodCanDemon", "FoodCanFraggleos", "FoodCanGriff", "FoodCanHerpy", "FoodCanOrlok", "FoodCanPowell", "FoodCanTylers", "FoodCanSardines", "FoodCanBakedBeans", "FoodCanFrankBeans", "FoodCanPasta", "ItemWaterbottleUnfilled","ItemWaterbottleBoiled","FoodmuttonCooked","FoodchickenCooked","FoodBaconCooked","FoodRabbitCooked","FoodCanUnlabeled","FoodPistachio","FoodNutmix","FoodMRE"];
_drinkrand = ["ItemSodaClays", "ItemSodaDrwaste", "ItemSodaLemonade", "ItemSodaLvg","ItemSodaMzly", "ItemSodaRabbit", "ItemSodaSmasht", "ItemSodaOrangeSherbet", "ItemSodaMdew", "ItemSodaRbull", "ItemSodaMtngreen", "ItemSodaCoke", "ItemSodaPepsi", "ItemWaterbottle"];
_backpackrand = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Puch"];
_partsrand = ["PartEngine","PartVRotor","PartWheel","PartGlass","PartFueltank","PartGeneric"];
_buildingrand = ["ItemSandbag","ItemTankTrap","ItemTentOld","ItemWire","30m_plot_kit","ItemVault","ItemTentDomed","ItemTentDomed2","ItemLightBulb","ItemGenerator","ItemComboLock","ItemLockbox","ItemPole","ItemCorrugated","ItemMixOil","bulk_ItemSandbag","bulk_ItemTankTrap","bulk_ItemWire","PartPlywoodPack","CinderBlocks","MortarBucket","PartPlankPack"];
_moneyrand = ["ItemSilverBar","ItemSilverBar","ItemSilverBar","ItemSilverBar","ItemSilverBar","ItemSilverBar","ItemSilverBar","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar10oz","ItemGoldBar10oz","ItemBriefcase10oz","ItemBriefcase50oz","ItemBriefcase100oz"];
_loot1 = [
	["addWeaponCargoGlobal",(_toolsrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 4) + 2)]],
	["addMagazineCargoGlobal",(_medicalrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 4)]],
	["addMagazineCargoGlobal",(_foodrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 8) + 2)]],
	["addBackpackCargoGlobal",(_backpackrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 1) + 2)]],
	["addMagazineCargoGlobal",(_partsrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 4) + 2)]],
	["addMagazineCargoGlobal",(_drinkrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_moneyrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 1) + 2)]]
];

Share this post


Link to post
Share on other sites

Now I decided that I don't want loot in the armed vehicles, only in the cargo vehicle, so I commented out the loot for the armed vehicles and I have this for the cargo vehicle:

_loot2 = [
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_buildingrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 6) + 2)]],
	["addMagazineCargoGlobal",(_moneyrand call BIS_fnc_selectRandom), [(round(random 2) + 2), (round(random 2) + 2), (round(random 1) + 2)]]
];

When I checked the cargo vehicle, only the "moneyrand" was in there. None of the building supplies. Suggestions?

Share this post


Link to post
Share on other sites

I had another look into the script and came up with a different interpretation, sorry:

	_cars = [
		//[vehicle, cargo places, [gunner 1 ammo, gunner 2 ammo, ...], loot]
		["Lada2",1,[],_loot1 call BIS_fnc_selectRandom],
		["UAZ_CDF",2,[],_loot1 call BIS_fnc_selectRandom],
		["HMMWV_M1035_DES_EP1",3,[],_loot2 call BIS_fnc_selectRandom]
	];

is the culprit. Here only one entry from _loot1 or _loot2 is picked, regardless from how randomized _loot<n> is.

 

You could try to put something like (please check syntax)

// additional loot for last vehicle
if ( _x == _qtd ) then {
  _motor addMagazineCargoGlobal [(_moneyrand call BIS_fnc_selectRandom), (round(random 2) + 2)];
  _motor addMagazineCargoGlobal [(_drinkrand call BIS_fnc_selectRandom), (round(random 2) + 2)];
};

between the sections //Put Loot in the Car and //Put vehicle Ammo and expand it to include your other _*rand.

Share this post


Link to post
Share on other sites

If you have coin currency on your server I recommend adding these lines around line 600 or so

//Spawn Soldier


_driverCount = 1;
_turreterCount = count _ammos;
_cargorsCount = _car select 1;
_crewCount = _driverCount + _turreterCount + _cargorsCount;
_gunnerPos = 0;
_crew = [];
for "_y" from 1 to _crewCount do {
//Create Soldier
//_skin = ["Functionary1_EP1_DZ","TK_INS_Bonesetter_EP1","TK_INS_Bonesetter_EP1","TK_INS_Bonesetter_EP1","TK_INS_Bonesetter_EP1"];
_unit = _rosa_group createUnit ["Functionary1_EP1_DZ",[50,50,50],[],50,"PRIVATE"];
[_unit] joinSilent _rosa_group;
_unit setCombatMode "RED";
_unit setBehaviour "SAFE";
donn_units_motor = donn_units_motor + [_unit];
_unit addEventHandler ["Killed",{
_unit = _this select 0;
_cash = round(random 5) * 1000;
_unit setVariable["cashMoney",_cash,true];

_weapon = (weapons _unit) select 0;
removeAllWeapons _unit;
removeAllItems _unit;
if (random 100 > 50) then {
_unit addWeapon _weapon;
_unit selectWeapon _weapon;

Share this post


Link to post
Share on other sites

I'm having issues with the actual AI not moving/driving. The convoys spawn every so often, I can see spawn point 1,2,3 on the map; But the vehicles just sit there not moving?
Any ideas what it could be?

*EDIT*
Seems to be the newest version of Infistar
 

/*  EXPERIMENTAL CU FIX   */ _CUF = true; /* true or false */ /* *experimental* - will transfer serverside units (including mission AI) to clientside */

 

Setting this to false fixes it.

Share this post


Link to post
Share on other sites

Tried the Andre Convoy, getting some errors;

 

 

12:39:08   Error Undefined variable in expression: _shotnearplayers

12:39:08 File mpmissions\DayZ_Overpoch_1.Chernarus\andre_convoy.sqf, line 536
12:39:09 Error in expression <etVariable ["donn_pshot",[]];
if (count _shotNearPlayers > 0) then {
{_rosa_grou>
12:39:09   Error position: <_shotNearPlayers > 0) then {
{_rosa_grou>
12:39:09   Error Undefined variable in expression: _shotnearplayers
12:39:09 File mpmissions\DayZ_Overpoch_1.Chernarus\andre_convoy.sqf, line 536
12:39:10 Error in expression <etVariable ["donn_pshot",[]];
if (count _shotNearPlayers > 0) then {
{_rosa_grou>
12:39:10   Error position: <_shotNearPlayers > 0) then {
{_rosa_grou>

 

 

12:38:03 Error in expression <lloweds;

} forEach _AiUnits;
if (_numbKA/_numbKA_total >= 0.5) then {_KA_players>
12:38:03   Error position: </_numbKA_total >= 0.5) then {_KA_players>
12:38:03   Error Zero divisor
12:38:03 File mpmissions\DayZ_Overpoch_1.Chernarus\andre_convoy.sqf, line 556
12:38:18 Error in expression <lloweds;
} forEach _AiUnits;
if (_numbKA/_numbKA_total >= 0.5) then {_KA_players>
12:38:18   Error position: </_numbKA_total >= 0.5) then {_KA_players>
12:38:18   Error Zero divisor
12:38:18 File mpmissions\DayZ_Overpoch_1.Chernarus\andre_convoy.sqf, line 556
12:38:33 Error in expression <lloweds;
} forEach _AiUnits;
if (_numbKA/_numbKA_total >= 0.5) then {_KA_players>
12:38:33   Error position: </_numbKA_total >= 0.5) then {_KA_players>
12:38:33   Error Zero divisor

Share this post


Link to post
Share on other sites

outlander,

 

Added a new line to the script. This line is commented with //here, outlander.

 

By the way, despite the errors, the script is working?

 

Those errors repeats again and again on the script?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By 2DayZ2Retirement
      -PROBLEM SOLVED-
       
      G'day, Survivors.
      I am having an issue on my server where vehicles which spawn randomly around the map repair themselves upon server restart.
      I use this config in my init.sqf which successfully spawns the vehicles in damaged and with low fuel...
      DynamicVehicleDamageLow = 75;
      DynamicVehicleDamageHigh = 100;
      DynamicVehicleFuelLow = 0;
      DynamicVehicleFuelHigh = 25;
      ...However upon each server restart the vehicles repair themselves (the fuel remains low however) and for the life of me I can't figure out why this is happening. 
      DayZ Version -DayZ Epoch 1.0.6.2
      Scripts Used -DZAI | -DZMS | -Right Click Actions (Suicide, Smoke Drugs, GPS Scan)
      AntiHack - InfiSTAR
      Server Host - GTXGaming
      My HiveEXT.log and arma2oaserver.RPT logs are not showing anything out of the ordinary.
      I'm not sure if it matter, but all Planes/Helicopters and Boats have been removed from the server via the dynamic_vehicle.sqf.
      In addition, all of the traders and trader cities being removed by removing the call for the CfgServerTrader.hpp in the description.ext.
      If there is any other info I can show to assist in fixing this problem please let me know, any help would be greatly appreciated.
      Cheers.
    • By FG_Trap
      Made a quick static ai mission that spawns on restart. 
      12 ai patrol the compound 
      4 Static m2's
      1 Heli Patrolling the compound 
      Crate for who ever clears all the ai.
      Some screenshots of the compound 


       
      https://github.com/Trapxxgods/Wai-Static-Mission 
    • By Brian Soanes
      To unlock vehicles left in your traders over a server restart, open your epoch_server.pbo

      In epoch_server\compile\epoch_vehicle\EPOCH_load_vehicles.sqf
      Find
      if (_allowDamage) then { Just above that, add this
      A3E_SafeZonePosArray = [ [[18451.9,14278.1,0]], //Altis East trader [[13333.5,14494.3,0]], //Altis Central trader [[6192.46,16834,0]] //Altis West trader ]; { if (_vehicle distance (_x select 0) < 200) then { _vehicle lock false; diag_log format["Vehicle %1 left in trader unlocked @ %2", _class, mapGridPosition _vehicle]; }; } forEach A3E_SafeZonePosArray; Pack pbo and you're good to go
    • By victorks
      my first work in editin :) https://uploaddeimagens.com.br/imagens/20180307202515_1-jpg https://uploaddeimagens.com.br/imagens/20180307202245_1-jpg DOWNLOAD: https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0 AI M2 NEED WAI: https://pastebin.com/GJMnPvZP ON THE MAP: https://pastebin.com/cyqH9rNV  
       
      https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0
       
       
       
       
       
       
       
       
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...