Jump to content
Sign in to follow this  
joschaap

[MP] [COOP/DM] GoT Wasteland v2 (Enhanced-edition)

Recommended Posts

I've been pouring over the scripts for wasteland, trying to understand what is going on with the refuel script for jerry cans. Was there a fundamental change in script execution with the release of altis? So far as I can tell, you should be able to refuel jerry cans at barrels and fuel pumps, but that obviously is not happening on any of the altis maps. Ideas?

Share this post


Link to post
Share on other sites

I would totally recommend removing all the pre-spawning armored vehicles, Hunter for example, from the map so you either have to acquire them through mission or buy them. Currently speaking the overwhelming number of these bullet-proof vehicles is such a pain in the ass due to ramming tactics benefited from enabling 3rd person view, and it is only trollish to find many players sitting in their hunter waiting for someone to check the vehicle so that they could ram him, or just driving around and randomly ram anyone they come across, not to mention that you can totally ram all the NPCs from a mission and take the loot without much risk. It's just game-breaking!

PS: It would also be great if "tanks" from the mission could be replaced by GMG/LMG cars so that a team would really have to pull the money to get a "tank" and they would be encouraged to use it wisely.

Share this post


Link to post
Share on other sites

Yash we have civvy vehicles now, they will still spawn but at a rare rate because there's 75% chance of the spawned being a civ vehicle instead of 25% of being a unarmed hunter/ifrit/strider

we have a website and forums for the mission now, suggestions are also posted there and we give some sneak peaks at development progress of the mission :)

website: http://a3wasteland.com

forums: http://forums.a3wasteland.com

Share this post


Link to post
Share on other sites

Yeah but pretty much you can run into one APC every few minutes, and it seems that there're always at least 5+ APCs running on the map, so wherever you are, you will probably ran into one. In fact, most people don't even bother with civilian vehicles cause Hunters and Ifiris are easy to come by.

Share this post


Link to post
Share on other sites

hi JoSchaap,

i worked on the loot system a bit for the release on Altis and ended up with an easy to adjust system for every map to use on. It should now scale with multiple threads, too, as of the use of the spawn command contrary to the before used call.

Here it comes :)

in "server" init.sqf

execVM "server\looting\MainLootCreation.sqf";

I have given it an own directory.

MainLootCreation.sqf

//	Random weapons and items spawning script for wasteland missions.
//	Authors: 
//	original: Ed! (404Forums)
//	Adjusted for Arma3 Wasteland use by: [GoT] JoSchaap (GoT2DayZ.nl), 
//	Player near town spawning concept by: Na_Palm (BIS-Forums)
//-------------------------------------------------------------------------------------
//local
_xMin = 1000;					// dimensions of landmass downleft -> topright
_yMin = 4000;
_xMax = 28000;
_yMax = 26000;
_spawnradius = 600;				//Radius of areas to spawn loot
_interval = 600;				//Time (in sec.) to pass before an area spawns new loot

//global
chBuildhasloot = 60;			//The odds that a building is selected to place loot.
chSpothasloot = 30;				//The odds that the selected building's spots will have loot(almost like odds per room).
chItem = 45;					//Chance of item instead of weapon
chfullfuel = 35;				//Chance of a spawned fuelcan to be full instead of empty
randomweapontestint = 0.03;		//Sets the highintervals(in meter) in which weaponpositions are tested. (Lower = slower, but more accurate. Higher = faster, but less accurate.)
//-------------------------------------------------------------------------------------
spawnarea_list = [];			//DONT change this, will be filled in mainloop

//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
// Buildings that can spawn loot go here
#include "lootBuildings.sqf"


lootweapon_list = [
["arifle_SDAR_F","20Rnd_556x45_UW_mag"],
//["arifle_TRG21_ACO_pointer_F","30Rnd_556x45_Stanag_Tracer_Red"],
//["arifle_TRG20_ACO_F","30Rnd_556x45_Stanag_Tracer_Yellow"],
["arifle_TRG21_F","30Rnd_556x45_Stanag"],
["arifle_TRG20_F","30Rnd_556x45_Stanag"],
["arifle_MK20_F","30Rnd_556x45_Stanag"],
["arifle_MK20C_F","30Rnd_556x45_Stanag"],
["SMG_01_F","30Rnd_45ACP_Mag_SMG_01"],
["SMG_02_F","30Rnd_9x21_Mag"],
["hgun_ACPC2_snds_F","9Rnd_45ACP_Mag"],
["hgun_ACPC2_F","9Rnd_45ACP_Mag"],
["hgun_P07_snds_F","16Rnd_9x21_Mag"],
["hgun_P07_F","16Rnd_9x21_Mag"],
["hgun_Rook40_snds_F","16Rnd_9x21_Mag"],
["hgun_Rook40_F","16Rnd_9x21_Mag"]
];


lootitem_list = [
//Water
"Land_Basket_F",
//Food
"Land_Bucket_F",
//repairkit
"Land_Suitcase_F",
//fuelcan
"Land_CanisterFuel_F"
];

//-------------------------------------------------------------------------------------

   lootspawnweapon = 
{
	_position = _this;
	_selectedgroup = (floor(random(count lootweapon_list)));
	_weapon = lootweapon_list select _selectedgroup select 0;
	_weaponholder = createVehicle ["groundWeaponHolder", _position, [], 0, "CAN_COLLIDE"];
	_weaponholder addWeaponCargoGlobal [_weapon, 1];
	if((count((lootweapon_list) select _selectedgroup)) > 1) then {
		for[{_rm = 0}, {_rm < (2 + floor(random(3)))}, {_rm = _rm + 1}] do {
			_mag = lootweapon_list select _selectedgroup select ((floor(random((count(lootweapon_list select _selectedgroup) - 1)))) + 1);
			_weaponholder addMagazineCargoGlobal [_mag, 1]; 
		};
	};
	_weaponholder setPos _position;
   };


   lootspawnitem = 
{
	_position = _this;
	_chfullf = 0;
	_selectedgroup = (floor(random(count lootitem_list)));
	_class = lootitem_list select _selectedgroup;
	_item = createVehicle [_class, _position, [], 0, "CAN_COLLIDE"];
	if(_class == "Land_CanisterFuel_F") then {
		_chfullf = (random 100);
		if (_chfullf < chfullfuel) then {
			_item setVariable["fuel", true, true];
		} else {
			_item setVariable["fuel", false, true];
		};
	};
	_item setPos _position;
   };

//-------------------------------------------------------------------------------------

spawnlootinarea =
{
_timeBegin2 = time;
   _pos = _this select 0;
_sprad = _this select 1;
   _randomweapon_buildings = nearestObjects [_pos, Buildingstoloot_list, _sprad];
diag_log format["ToA WASTELAND - LOOTSPAWNER Time to get %2 buildings: %1s", (time - _timeBegin2), (count _randomweapon_buildings)];
_timeBegin3 = time;
_lootcount = 0;
{
	_building = _x;
	_buildingpos = [];
	_endloop = false;
	_poscount = 0;
	while {!_endloop} do {
		if(((_building buildingPos _poscount) select 0) != 0 && ((_building buildingPos _poscount) select 1) != 0) then {
			_buildingpos = _buildingpos + [_building buildingPos _poscount];
			_poscount = _poscount + 1;
		} else {
			_endloop = true;
		};
	};
	_chBuilding = (random 100);
	if (_chBuilding < chBuildhasloot) then {
		if (_poscount > 0) then {  
			for[{_r = 0}, {_r < count _buildingpos}, {_r = _r + 1}] do
			{
				_chSpot = (random 100);
				if (_chSpot < chSpothasloot) then {
					_pos = _buildingpos select _r;
					_posnew = _pos;
					if(_pos select 2 < 0) then {
						_pos = [_pos select 0, _pos select 1, 1];
					};
					_z = 0;
					_testpos = true;
					while {_testpos} do 
					{
						if((!lineIntersects[ATLtoASL(_pos), ATLtoASL([_pos select 0, _pos select 1, (_pos select 2) - (randomweapontestint * _z)])]) && (!terrainIntersect[(_pos), ([_pos select 0, _pos select 1, (_pos select 2) - (randomweapontestint * _z)])]) && (_pos select 2 > 0)) then {
							_posnew = [_pos select 0, _pos select 1, (_pos select 2) - (randomweapontestint * _z)];
							_z = _z + 1;
							sleep 0.001;
						} else {
							_testpos = false;
						};
					};
					_posnew = [_posnew select 0,_posnew select 1,(_posnew select 2) + 0.05];
					_chweapitem = floor(random(100));
					if(_chweapitem < chItem) then {
						_posnew call lootspawnitem;
					} else {
						_posnew call lootspawnweapon;
					};
					sleep 0.001;
					_lootcount = _lootcount + 1;
				};
			};
		};    
	};
	//sleep 0.001;
   }foreach _randomweapon_buildings;
diag_log format["ToA WASTELAND - LOOTSPAWNER Time to spawn %2 objects in area: %1s", (time - _timeBegin3), _lootcount];
};

//-------------------------------------------------------------------------------------

deleteoldloot =
{
_todeleteclass_list = ["groundWeaponHolder"];
_todeleteclass_list = _todeleteclass_list + lootitem_list;
_delrad = _this select 0;
_lifetime = _this select 1;
sleep _lifetime;
while {true} do	{
	{
		_todelete_list = [];
		_posArea = (_x select 0);
		_lastSpawned = (_x select 1);
		_playernear = false;
		{
			if ((isPlayer _x) && (alive _x)) then {
				_posPlayer = getPos _x;
				if ((_posArea distance _posPlayer) > (_delrad * 2)) then {
					_playernear = true;
				};
			};
			sleep 0.001;
		}foreach playableUnits;
		if ((!_playernear) && ((floor (_lifetime / 2)) < (time - _lastSpawned))) then {
			_todelete_list = _posArea nearEntities [_todeleteclass_list, _delrad];
			diag_log format["ToA WASTELAND - LOOTSPAWNER Objects to delete: %1", (count _todelete_list)];
			{
				deleteVehicle _x;
			}foreach _todelete_list;
			(spawnarea_list select _forEachIndex) set [1,0];
			diag_log format["ToA WASTELAND - LOOTSPAWNER Objects deleted"];
		};
		sleep 0.001;
	}foreach spawnarea_list;
	sleep 30;
};
};

//-------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
//integrated concept of spawnareas for use on any island

// fill the list with needed spawnareas
_posPlayer = [];
_posArea = [];
_lastSpawned = 0;
_sadist = floor(_spawnradius * 1.4) + 1;
_xused = _xMin;
while {_xused < _xMax} do {
	_yused = _yMin;
	while {_yused < _yMax} do {
		_posArea = [_xused, _yused, 0];
		_BuildLootTest_list = [];
		_BuildLootTest_list = nearestObjects [_posArea, Buildingstoloot_list, _spawnradius];
		if (!(isNil {_BuildLootTest_list})) then {
			diag_log format["ToA WASTELAND - LOOTSPAWNER Spawnarea created at: %1", _posArea];
			spawnarea_list set [count spawnarea_list, [_posArea, _lastSpawned]];
		} else {
			diag_log format["ToA WASTELAND - LOOTSPAWNER Spawnarea NOT created at: %1", _posArea];
		};
		_yused = _yused + _sadist;
	};
	_xused = _xused + _sadist;
};
diag_log format["ToA WASTELAND - LOOTSPAWNER Spawnareas created: %1", (count spawnarea_list)];
// delete loot if no player is near and some time has passed
_null = [_spawnradius, _interval] spawn deleteoldloot;
// mainloop
while {true} do {
	_timeBegin1 = time;
	{
		if ((isPlayer _x) && (alive _x)) then {
			_posPlayer = getPos _x;
			usedspawnarea_list = [];
			{
				_posArea = (_x select 0);
				_lastSpawned = (_x select 1);
				if (((_posArea distance _posPlayer) < _spawnradius) && ((_interval < (time - _lastSpawned)) || (_lastSpawned == 0))) then {
					_null = [_posArea, _spawnradius] spawn spawnlootinarea;
					usedspawnarea_list set [count usedspawnarea_list, [_forEachIndex, time]];
				};
				sleep 0.001;
			}forEach spawnarea_list;
			{
				(spawnarea_list select (_x select 0)) set [1,(_x select 1)];
			}forEach usedspawnarea_list;
		};
		sleep 0.001;
	}forEach playableUnits;
	diag_log format["ToA WASTELAND - LOOTSPAWNER Time for one mainloop pass: %1s", (time - _timeBegin1)];
	sleep 10;
};

and finaly the lootBuildings.sqf

Buildingstoloot_list = [
"Land_Addon_01_V1_dam_F", 
"Land_Airport_Tower_F", 
"Land_Airport_Tower_dam_F", 
"Land_Airport_center_F",
"Land_Airport_left_F",
"Land_Airport_right_F",
"Land_CarService_F",
"Land_Cargo_HQ_V1_F",
"Land_Cargo_HQ_V3_F",
"Land_Cargo_House_V1_F",
"Land_Cargo_House_V3_F",
"Land_Cargo_Patrol_V1_F",
"Land_Cargo_Patrol_V3_F",
"Land_Cargo_Tower_V1_F",
"Land_Cargo_Tower_V3_F",
"Land_Castle_01_tower_F",
"Land_Chapel_Small_V1_F",
"Land_Chapel_V1_F",
"Land_Communication_F", 
"Land_Communication_anchor_F", 
"Land_Crane_F",
"Land_Factory_Hopper_F",
"Land_FuelStation_Build_F", 
"Land_FuelStation_Shed_F", 
"Land_Garage_V1_dam_F", 
"Land_Hangar_F",
"Land_Hospital_side1_F",
"Land_Hospital_side2_F",
"Land_LightHouse_F", 
"Land_Lighthouse_small_F", 
"Land_Metal_Shed_F", 
"Land_MilOffices_V1_F", 
"Land_Offices_01_V1_F",
"Land_Radar_F",
"Land_Research_HQ_F",
"Land_Research_house_V1_F",
"Land_ReservoirTank_Airport_F", 
"Land_Shed_Big_F", 
"Land_Shed_Small_F",  
"Land_Slum_House01_F", 
"Land_Slum_House02_F", 
"Land_Slum_House03_F", 
"Land_TBox_F", 
"Land_TTowerBig_1_F", 
"Land_TTowerBig_2_F", 
"Land_Unfinished_Building_01_F", 
"Land_Unfinished_Building_02_F",
"Land_WIP_F",
"Land_cargo_addon01_V1_F", 
"Land_cargo_addon01_V2_F", 
"Land_cargo_addon02_V2_F", 
"Land_cargo_house_slum_F",
"Land_cmp_Shed_F",
"Land_cmp_Tower_F",
"Land_d_Stone_Shed_V1_F", 
"Land_dp_bigTank_F", 
"Land_dp_mainFactory_F",
"Land_dp_smallFactory_F", 
"Land_dp_smallTank_F", 
"Land_i_Addon_03_V1_F", 
"Land_i_Addon_03mid_V1_F", 
"Land_i_Addon_04_V1_F", 
"Land_i_Barracks_V1_F",
"Land_i_Barracks_V2_F",
"Land_i_Garage_V1_F", 
"Land_i_House_Big_01_V1_F", 
"Land_i_House_Big_01_V1_dam_F", 
"Land_i_House_Big_01_V2_F",
"Land_i_House_Big_01_V3_F",
"Land_i_House_Big_02_V1_F", 
"Land_i_House_Big_02_V1_dam_F", 
"Land_i_House_Small_01_V1_F", 
"Land_i_House_Small_01_V1_dam_F", 
"Land_i_House_Small_01_V2_F", 
"Land_i_House_Small_01_V2_dam_F", 
"Land_i_House_Small_02_V1_F", 
"Land_i_House_Small_02_V1_dam_F", 
"Land_i_House_Small_03_V1_F", 
"Land_i_House_Small_03_V1_dam_F", 
"Land_i_Shed_Ind_F",
"Land_i_Shop_01_V1_F", 
"Land_i_Shop_01_V1_dam_F", 
"Land_i_Shop_01_V2_F",
"Land_i_Shop_02_V1_F", 
"Land_i_Shop_02_V1_dam_F", 
"Land_i_Shop_02_V2_F",
"Land_i_Stone_HouseBig_V1_F", 
"Land_i_Stone_HouseBig_V1_dam_F", 
"Land_i_Stone_HouseBig_V3_F",
"Land_i_Stone_HouseSmall_V1_F", 
"Land_i_Stone_HouseSmall_V1_dam_F", 
"Land_i_Stone_Shed_V1_F", 
"Land_i_Stone_Shed_V1_dam_F", 
"Land_i_Stone_Shed_V2_F",
"Land_i_Stone_Shed_V3_F",
"Land_u_Addon_01_V1_F", 
"Land_u_Addon_02_V1_F", 
"Land_u_Barracks_V2_F",
"Land_u_House_Big_01_V1_F",
"Land_u_House_Big_02_V1_F",
"Land_u_House_Small_01_V1_F", 
"Land_u_House_Small_01_V1_dam_F", 
"Land_u_House_Small_02_V1_F", 
"Land_u_House_Small_02_V1_dam_F", 
"Land_u_Shed_Ind_F",
"Land_u_Shop_02_V1_F"
];

greetings Na_Palm

P.S. to lessen the server load i implemented a way to delete old loot.

Share this post


Link to post
Share on other sites

hi napalm, the same fixes are allready in the altis mission of a3wasteland, with the addition of classed loot, only spawn when a player is near, and ignore players that are just driving through town (comes close to the dayz principle)

military buildings will have a chance of spawning 6.5mm rifles instead of just small arms and food yahdahyahdah i'm spoiling too much

thanks for sharing it though, players that converted the GoT mission will enjoy this to add loot to the new buildings :)

Share this post


Link to post
Share on other sites

Hmmmm I played on a server last night.... never found any loot at all... ran around for 45 minutes with just a pistol.... might have just been the server... I found no loot and no vehicles...

Share this post


Link to post
Share on other sites

i have not released an altis mission yet, so it might be the mission youre playing :)

Share this post


Link to post
Share on other sites

Well this is good to know, I was playing an altis version as well. someone must have failed an attempt to port it, because there was zero loot, very few vehicles. And all the missions were showing up at the edges of the map..

Share this post


Link to post
Share on other sites

hi joSchaap,

i may have something for you, in light of your todays post at a3wastelands forum.

Its not entirely ready for an official release as I'am working further on it but to testing it should be fine.

If you like, send me your e-mail and i will get you the functions asap.

greetings Na_Palm

P.S.: you could also rethink the need of vehicle respawn in server/spawning/vehicleCreation.sqf line 41. disable it and put therefore more vehicles in to compensate. This script seems to eat performance for me.

Edited by Na_Palm
see PS

Share this post


Link to post
Share on other sites

altis cant handle more then 100 vehicles in multiplayer. it isnt the respawn script ;)

Share this post


Link to post
Share on other sites

The problem is actually not the quantity of vehicles. It is the distribution. There are respawn locations where you can hardly find any vehicles because they are pretty far off. Maybe reduce the spawn locations and concentrate the vehicles to those areas to fix the second most annoying problem (right after the FPS issues) there is atm with altis.

Share this post


Link to post
Share on other sites

the altis version no longer uses set spawns, and yes it is the ammount, try it yourself, put a char in the editor, measure fps, now spawn 100 vehicles in a verry remote location and measure fps again, it will be degraded below 60% since in mutiplayer every vehicle requires intensive syncing :)

but were not giving up and are nearing a more playable version with each day of optimizations

ive measured 45fps in kavala and 70fps outside town with 12 players ingame today so we are getting somewhere :)

disabling the vehicle respawns was our first attempt, fps/performance gain was nil

---------- Post added at 21:14 ---------- Previous post was at 20:22 ----------

all my time goes into the mission at this time, when we get it done tickets will be made for all issues weve found

Share this post


Link to post
Share on other sites

Hi JoSchaap,

its fine to hear that you are all on the right track then.

I mentioned the vehicle respawns as it was an observation by me based on your "old" Wasteland mission with a new lootspawner system I'am working on. Disabling them gave me and some friends an smooth ride. :D

Btw. if you want to give my new loot spawn system a try, i can send it your way. A bit of cleanup and it should be ready for release.

Your latest dev. build locks and feels good!:yay:

greetings Na_Palm

Share this post


Link to post
Share on other sites

I cannot seem to get the save loadouts etc to work. I have it enabled in the config but it never creates anything under the db folder.

Any ideas?

Share this post


Link to post
Share on other sites

the mission isnt finished yet, you'd have to await the release before we can provide support

Share this post


Link to post
Share on other sites

Hi JoSchaap,

It's me once more! :) I released my lootspawn system, that more or less a total rewrite, in the 'MISSION EDITING & SCRIPTING' section.

quick link

It's out of the box run able by your A3wasteland mission published on Github. You only need to exchange the corresponding line in server/init.sqf

If your now used spawn script is something like the one on Github, try these one before you dismiss it.

greetings Na_Palm

Share this post


Link to post
Share on other sites

Hi there,

in your mission.sqm there is a missing marker for "mission_6". Thats the reason for some missions takeing place at pos [0,0].

Share this post


Link to post
Share on other sites

this thread should be closed, to avoid confusion.

please report issues with a3wasteland mission issues on forums.a3wasteland.com or the a3wasteland github tracker :)

GoT Wasteland v2 has not been updated and will not be updated anymore

There wont be a GoT mission-release untill we finish the a3wasteland-base mission release on which the GoT edition will be based.

for both missions ill make a new thread once we reach a release state :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×