Sign in to follow this  
chinchill3r

Custom Loot Spawns (Solved)

19 posts in this topic

Hello Exile Server creators,

me and friend are setting up a exile Server on Map Tanoa.

At one point we have issues with the loot spawn system.

We try to put in some Loot Spawn points by using the Exilemod Loot Position Creator.

We produced Loot positions with that tool and put them into the @exileserver --> addons --> exile_server_config --> config.cpp. But doesnt work for us.

class CfgBuildings
{
	//We put this (down below) right into the original config.cpp
	class Land_Barrack2
	{
		table = "Military";
		positions[] = {{-0.868164,1.81738,-0.592377},
			{-0.866211,3.47363,-0.591431},
			{-0.855469,5.25,-0.590393},
			{-0.958008,0.408203,-0.593201},
			{-0.992188,-1.11133,-0.594086},
			{-0.807617,-2.42578,-0.594849},
			{0.389648,-2.45703,-0.594879},
			{1.71973,-2.4209,-0.594849},
			{0.979492,-0.828125,-0.175323},
			{-2.04395,0.573242,0.0819397},
			{-1.85742,2.58594,-0.591919},
			{-1.96875,4.04297,-0.591064},
			{0.804688,4.87598,-0.175354},
			{0.788086,5.01855,0.615753},
			{0.977539,3.26367,0.615692},
			{0.561523,3.29102,-0.175385},
			{0.646484,1.43555,-0.175354},
			{-1.79395,-1.26172,-0.594177},
		{-1.92773,-2.53613,-0.59494}};
	};
};

 

Maybe somebody could help us out. If more information is needed, like i think so, let me know

 

i would really appreciate some help.

have a nice day

chinchill3r

Edited by chinchill3r
Problem Solved

Share this post


Link to post
Share on other sites

@chinchill3r give this a look:

https://github.com/redned70/CodeAddons/tree/master/Napf Loot Positions

it is for Napf in theory but I made it to cover Cup Terrain Core buildings along with the Exile ones so should cover most of what you need and is easy to dump into the config if you follow the instructions and may cover most of what you need

the auto generated one was for everything on the map but the manual one should be good for you

Edited by red_ned

Share this post


Link to post
Share on other sites
Advertisement

@red_nedi don`t think that this will solve my problem, because its just a List of loot spots in buildings. As i told i have no issue with creating spots. As you can see we did the Same (just with another building) but the loot doesnt show up ingame. 

 

Do i need to tell the Server the building i want to spawn loot in in another file ?

 

Edited by chinchill3r

Share this post


Link to post
Share on other sites
15 minutes ago, chinchill3r said:

@red_nedi don`t think that this will solve my problem, because its just a List of loot spots in buildings. As i told i have no issue with creating spots. As you can see we did the Same (just with another building) but the loot doesnt show up ingame. 

 

Do i need to tell the Server the building i want to spawn loot in in another file ?

 

yes you need to define loot tables - what kind of loot position class spawns what loot

http://www.exilemod.com/download-all-the-files/LootTableCompiler-1.0.3b.zip

get that then all I do is drop the output file into the server config pbo and include:

Quote

// Napf Loot Positions
#include "NapfLootPos.cpp"
// Napf Loot tables
#include "CfgExileLootServer.hpp"

that way my loot positions and loot tables don't get scrubbed in Exile updates

pbo_serverconfig.jpg

Edited by red_ned

Share this post


Link to post
Share on other sites

but doesnt the original config.cpp already tell what kind of loot to spawn in which building

 

class Land_Barrack2

tells which building 

table = "Military";
		positions[] = 

tells which loot group

and military is defined below the position content in the config.cpp

 

or am i wrong with that ?

another thing is that we tried to put in another loot spot to an existing building in the config.cpp

didnt work, too..... -.-

is there a way to talk to you on discord or ts3 or sth like that ?

 

 

Edited by chinchill3r

Share this post


Link to post
Share on other sites
3 hours ago, chinchill3r said:

or am i wrong with that ?

No you're totally right.

The problem tho, as i remember correctly there where some buildings for example those cup tents where you could create lootpositions but the loot actually never spawned. 

You might wanna try this:

https://github.com/kuplion/ExileZ-Crashes/blob/master/ExileClient_system_lootManager_thread_spawn.sqf

 

If that's still not fixing your problem, try adding your building:

forEach ["House","Building","Structure","Land_Barrack2"];

 

Edited by WURSTKETTE

Share this post


Link to post
Share on other sites

Download that file, put it into missionfile and create an overwrite in config.cpp for that file. 

class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon/myfunction.sqf";
	*/
  ExileClient_system_lootManager_thread_spawn = "PATHTOFILE/ExileClient_system_lootManager_thread_spawn.sqf";
};

 

Share this post


Link to post
Share on other sites

i've added this to the @exileserver-->addons--> exile_server_config.pbo --> config.cpp

 class Land_Barrack2
    {
        table = "Military";
        positions[] = 
            {
                {0.0708008,-3.99121,-0.910141},
                {0.0302734,-3.11816,-0.624046},
                {-2.30273,-3.11035,-0.624046},
                {-0.998535,-1.45215,-0.624046},
                {-0.869141,1.68359,-0.624046},
                {-0.808594,5.4248,-0.624046}
            };
    };

then in the mpmissions--> exile.tanoa --> config.cpp

: class CfgExileCustomCode 
{    
        //Loot//
        ExileClient_system_lootManager_thread_spawn = "Loot\ExileClient_system_lootManager_thread_spawn.sqf";

then added the ExileClient_system_lootManager_thread_spawn.sqf file to mpmissions--> exile.tanoa --> Loot
looks like this

private["_spawnRadius","_minimumDistanceToTraderZones","_minimumDistanceToTerritories","_lootLifeTime","_buildings","_buildingNetIdsToSpawnLootIn","_building","_lastTimeSentToServer"];
if !(alive player) exitWith {false};
if !((vehicle player) isEqualTo player) exitWith {false};
_spawnRadius = getNumber (missionConfigFile >> "CfgExileLootSettings" >> "spawnRadius");
_minimumDistanceToTraderZones = getNumber (missionConfigFile >> "CfgExileLootSettings" >> "minimumDistanceToTraderZones");
_minimumDistanceToTerritories = getNumber (missionConfigFile >> "CfgExileLootSettings" >> "minimumDistanceToTerritories");
_lootLifeTime = getNumber (missionConfigFile >> "CfgExileLootSettings" >> "lifeTime") * 60;
// Add wrecks to loot system
_buildings = [];
{
      _buildings append (player nearObjects [_x, _spawnRadius]);
} forEach ["House","Building","Structure","Land_Barrack2"];

_buildingNetIdsToSpawnLootIn = [];
{
	_building = _x;
	try 
	{
		if (isObjectHidden _building) throw false;
		_lastTimeSentToServer = _building getVariable ["ExileLastLootRequestedAt", -99999];
		if ((time - _lastTimeSentToServer) < _lootLifeTime) throw false;
		if (_minimumDistanceToTraderZones > 0) then
		{
			if ([_building, _minimumDistanceToTraderZones] call ExileClient_util_world_isTraderZoneInRange) then
			{
				throw false;
			};
		};
		if (_minimumDistanceToTerritories > 0) then
		{
			if ([_building, _minimumDistanceToTerritories] call ExileClient_util_world_isTerritoryInRange) then
			{
				throw false;
			};
		};
		_buildingNetIdsToSpawnLootIn pushBack (netId _building);
		_building setVariable ["ExileLastLootRequestedAt", time];
	}
	catch 
	{
	};
}
forEach _buildings;
if ((count _buildingNetIdsToSpawnLootIn) > 0) then 
{
	["spawnLootRequest", [_buildingNetIdsToSpawnLootIn]] call ExileClient_system_network_send;
};

doesnt work -.-

 

i really hate this thing now :D

i think i am trying some other buildings to see if it works for them, but if you have another idea, let me know it ;)

Share this post


Link to post
Share on other sites
Advertisement

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.