Sign in to follow this  
XcaptharlockX

custom spawn load out help

8 posts in this topic

I need a hand, I am currently trying to set up a group of 3 spawn load outs for my server

with the way things are set up, Roaming ai bandits are made to look like convicts and therefore wear the bright orange jumpsuit so players spawning with the jumpsuit could cause some issues.

 

I've read in the config.cpp that the jumpsuit cannot be changed but I know it has been done on almost every server I've played on in the past

 

my question is how and where would I set up this new loadout

and yes I know there are scripts to do this but I have not learned how to implement scripts just yet so I would like some kind of way to do it in a config or file.

 

thanks in advance for any help and dealing with my slow learning

Share this post


Link to post
Share on other sites

You want to create an overwrite for ExileServer_object_player_network_createPlayerRequest. You could do something like this:
 

/**
 * ExileServer_object_player_network_createPlayerRequest
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_sessionID", "_parameters", "_requestingPlayer", "_spawnLocationMarkerName", "_playerUID", "_accountData", "_bambiPlayer", "_cargoType"];
_sessionID = _this select 0;
_parameters = _this select 1;
_requestingPlayer = _sessionID call ExileServer_system_session_getPlayerObject;
try
{
	if (isNull _requestingPlayer) then 
	{
		throw format ["Session %1 requested a bambi character, but doesn't have a player object. Hacker or Monday?", _sessionID];
	};
	_spawnLocationMarkerName = _parameters select 0;
	_playerUID = getPlayerUID _requestingPlayer;
	if(_playerUID isEqualTo "")then
	{
		throw format ["Player: '%1' has no player UID. Arma/Steam sucks!.",name _requestingPlayer];
	};
	_accountData = format["getAccountStats:%1", _playerUID] call ExileServer_system_database_query_selectSingle;
	_bambiPlayer = (createGroup independent) createUnit ["Exile_Unit_Player", [0,0,0], [], 0, "CAN_COLLIDE"];
	removeHeadgear _bambiPlayer;
	{
		_cargoType = _x call ExileClient_util_cargo_getType;
		switch (_cargoType) do
		{
			case 1: 	{ _bambiPlayer addItem _x; };
			case 2: 	{ _bambiPlayer addWeaponGlobal _x; };
			case 3: 	{ _bambiPlayer addBackpackGlobal _x; };
			case 4:		{ _bambiPlayer linkItem _x; };
			default 					{ _bambiPlayer addItem _x; };
		};
	}
	forEach getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "loadOut");
	
	_bambiplayer forceAddUniform "Exile_Uniform_Woodland";
	_bambiplayer addHeadgear "H_Booniehat_oli";
	_bambiplayer addVest "V_Rangemaster_belt";
	_bambiplayer addBackpack "B_Carryall_oli";
	_bambiplayer addItemToUniform "Exile_Item_DuctTape";
	_bambiplayer addItemToUniform "Exile_Item_PlasticBottleFreshWater";
	_bambiplayer addItemToUniform "Exile_Item_Noodles";
	_bambiplayer addItem "Exile_Item_Bandage";
	_bambiplayer addItem "Exile_Item_CanOpener";
	[_bambiplayer, "Exile_Weapon_Makarov",3] call BIS_fnc_addWeapon;
	
	[_sessionID, _requestingPlayer, _spawnLocationMarkerName, _bambiPlayer, _accountData] call ExileServer_object_player_createBambi;
}
catch
{
	_exception call ExileServer_util_log;
};

Or if you are trying to set respect loadouts you can use this:

Or this:

Or the various other scripts that are out there that do the same thing.

  • Like 2

Share this post


Link to post
Share on other sites
Advertisement

Where would be the proper place to place respect loadouts, in

ExileServer_object_player_network_createPlayerRequest

or

ExileServer_object_player_createBambi.sqf?

(for some reason I could not get it to work in ExileServer_object_player_network_createPlayerRequest, while in createBambi works just fine)

Share this post


Link to post
Share on other sites

thank you for your response :)

 

would it be possible to go into the steps for implementing this override?

would it be something like creating a new file with the override in it then adding #include "override.sqf" in the config.cpp

 

if this is incorrect could I trouble you for an explanation if you have time.

Share this post


Link to post
Share on other sites
2 hours ago, XcaptharlockX said:

thank you for your response :)

 

would it be possible to go into the steps for implementing this override?

would it be something like creating a new file with the override in it then adding #include "override.sqf" in the config.cpp

 

if this is incorrect could I trouble you for an explanation if you have time.

In your mission config.
class CfgExileCustomCode 
{
    ExileServer_object_player_network_createPlayerRequest = "overwrites\ExileServer_object_player_network_createPlayerRequest.sqf";
};

Just place the file location in the quotation marks.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, Brenner said:

Where would be the proper place to place respect loadouts, in

ExileServer_object_player_network_createPlayerRequest

or

ExileServer_object_player_createBambi.sqf?

(for some reason I could not get it to work in ExileServer_object_player_network_createPlayerRequest, while in createBambi works just fine)

I call my in ExileServer_object_player_network_createPlayerRequest. I was just point to those for examples. If they don't work you can do something like this:
 

Spoiler

/**
 * ExileServer_object_player_network_createPlayerRequest
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_sessionID","_parameters","_requestingPlayer","_spawnLocationMarkerName","_playerUID","_accountData","_bambiPlayer","_cargoType","_uniformSelection","_headGearSelection","_backpackSelection","_uniform","_headGear","_backpack","_midLevelUniformSelection","_midLevelHeadGearSelection","_midLevelBackpackSelection","_highLevelUniformSelection","_highLevelHeadGearSelection","_highLevelBackpackSelection"];
_sessionID = _this select 0;
_parameters = _this select 1;
_requestingPlayer = _sessionID call ExileServer_system_session_getPlayerObject;
try
{
    if (isNull _requestingPlayer) then 
    {
        throw format ["Session %1 requested a bambi character, but doesn't have a player object. Hacker or Monday?", _sessionID];
    };
    _spawnLocationMarkerName = _parameters select 0;
    _playerUID = getPlayerUID _requestingPlayer;
    if(_playerUID isEqualTo "")then
    {
        throw format ["Player: '%1' has no player UID. Arma/Steam sucks!.",name _requestingPlayer];
    };
    _accountData = format["getAccountStats:%1", _playerUID] call ExileServer_system_database_query_selectSingle;
    _bambiPlayer = (createGroup independent) createUnit ["Exile_Unit_Player", [0,0,0], [], 0, "CAN_COLLIDE"];
    removeHeadgear _bambiPlayer;
    
    _bambiPlayer linkItem "Exile_Item_XM8";
    _bambiPlayer linkItem "ItemCompass";
    _bambiPlayer linkItem "ItemMap";
    _bambiPlayer linkItem "ItemRadio";
    
    {
        _cargoType = _x call ExileClient_util_cargo_getType;
        switch (_cargoType) do
        {
            case 1:     { _bambiPlayer addItem _x; };
            case 2:     { _bambiPlayer addWeaponGlobal _x; };
            case 3:     { _bambiPlayer addBackpackGlobal _x; };
            case 4:        { _bambiPlayer linkItem _x; };
            default     { _bambiPlayer addItem _x; };
        };
    }
    forEach getArray(configFile >> "CfgSettings" >> "BambiSettings" >> "loadOut");
//Newbi
_uniformSelection = 
[
    "U_C_Poloshirt_stripped",
    "U_C_Poloshirt_salmon",
    "U_Rangemaster",
    "U_OrestesBody",
    "U_C_Poloshirt_burgundy",
    "U_C_Poor_1"
];

_headGearSelection = 
[
    "H_Bandanna_khk",
    "H_Watchcap_blk",
    "H_Watchcap_camo",
    "H_TurbanO_blk",
    "H_Cap_blk",
    "H_Cap_tan"
];

_backpackSelection = 
[
    "B_AssaultPack_blk",
    "B_AssaultPack_cbr",
    "B_AssaultPack_dgtl",
    "B_AssaultPack_khk",
    "B_AssaultPack_mcamo",
    "B_AssaultPack_rgr",
    "B_AssaultPack_sgg"
];
//Rank 1
_RankOneUniformSelection =
[

    "U_C_HunterBody_grn",
    "U_IG_Guerilla1_1",
    "U_IG_Guerilla2_1",
    "U_IG_Guerilla2_2",
    "U_IG_Guerilla2_3",
    "U_IG_Guerilla3_1",
    "U_BG_Guerilla2_1",
    "U_IG_Guerilla3_2",
    "U_BG_Guerrilla_6_1",
    "U_BG_Guerilla1_1",
    "U_BG_Guerilla2_2",
    "U_BG_Guerilla2_3",
    "U_BG_Guerilla3_1"
];

_RankOneHeadGearSelection =
[
    "H_Shemag_khk",
    "H_Shemag_olive",
    "H_Shemag_olive_hs",
    "H_Shemag_tan",
    "H_ShemagOpen_khk",
    "H_ShemagOpen_tan"
];

_RankOneBackpackSelection =
[
    "B_Bergen_blk",
    "B_Bergen_mcamo",
    "B_Bergen_rgr",
    "B_Bergen_sgg"
];

_score = (_accountData select 0);
    if (_score <= 1500) then
    {
        _uniform = _uniformSelection call BIS_fnc_selectRandom;
        _headGear = _headGearSelection call BIS_fnc_selectRandom;
        _backpack = _backpackSelection call BIS_fnc_selectRandom;
        _bambiplayer forceAddUniform _uniform;
        _bambiplayer addHeadgear _headGear;
        _bambiplayer addVest "V_Rangemaster_belt";
        _bambiplayer addBackpack _backpack;
        _bambiplayer addItemToUniform "Exile_Item_DuctTape";
        _bambiplayer addItemToUniform "Exile_Item_PlasticBottleFreshWater";
        _bambiplayer addItemToUniform "Exile_Item_Noodles";
        _bambiplayer addItem "Exile_Item_Bandage";
        _bambiplayer addItem "Exile_Item_CanOpener";
        [_bambiplayer, "Exile_Weapon_Makarov",3] call BIS_fnc_addWeapon;
    } else {
    if ((_score > 1500) && (_score <= 20000)) then
    {
        _uniform = _RankOneuniformSelection call BIS_fnc_selectRandom;
        _headGear = _RankOneheadGearSelection call BIS_fnc_selectRandom;
        _backpack = _RankOnebackpackSelection call BIS_fnc_selectRandom;
        _bambiplayer forceAddUniform _uniform;
        _bambiplayer addHeadgear _headGear;
        _bambiplayer addVest "V_BandollierB_khk";
        _bambiplayer addBackpack _backpack;
        _bambiplayer addItemToUniform "Exile_Item_DuctTape";
        _bambiplayer addItemToUniform "Exile_Item_PlasticBottleFreshWater";
        _bambiplayer addItemToUniform "Exile_Item_PlasticBottleFreshWater";
        _bambiplayer addItemToUniform "Exile_Item_Noodles";
        _bambiplayer addItemToUniform "Exile_Item_Noodles";
        _bambiplayer addItem "Exile_Item_Bandage";
        _bambiplayer addItem "Exile_Item_Vishpirin";
        _bambiplayer addItem "Exile_Item_Vishpirin";
        _bambiplayer addItem "Exile_Item_CanOpener";
        [_bambiplayer, "hgun_P07_F",3] call BIS_fnc_addWeapon;
    };
};    
    [_sessionID, _requestingPlayer, _spawnLocationMarkerName, _bambiPlayer, _accountData] call ExileServer_object_player_createBambi;
}
catch
{
    _exception call ExileServer_util_log;
};

This is a shorten version.

Edited by Beowulfv

Share this post


Link to post
Share on other sites

I have used ExileServer_object_player_createBambi.sqf link below:

https://pastebin.com/TMC7Hwft

Inside that file you will see

Spoiler
///////////////////////////////////////////////////////
///// Respect based loadouts start here /////
//////////////////////////////////////////////////////
and
///////////////////////////////////////////////////////
///// Respect based loadouts end here   /////
///////////////////////////////////////////////////////

 

Between those two you can edit loadouts for each respect level (systemchat command is commented out because for some reason it does not work on my server, if anyone can help with that I would appreciate it)

Next:

Un-pbo your Exile.Mapname.pbo in mpmissions folder with pbo manager (or whatever you use for unpacking .pbo's).

You can create a separate folder inside extracted folder (or two), for example Custom\RespectLoadouts and put the file from the link above to that folder.

Than go back two folders to the folder where you have created Custom folder (or just enter extracted folder again) and open config.cpp with Notepad++ or whatever application you use for editing scripts and configs.(unless you have a separate CustomCode.cpp or hpp)

Once the config is opened find (Ctrl+F in Notepad++)

Spoiler

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";
    */
};

Inside the brackets (but not inside /* and */) add

Spoiler

ExileServer_object_player_createBambi = "Custom\RespectLoadouts\ExileServer_object_player_createBambi.sqf"; 

So it looks like this (you can delete the instructions inside the /* and */ if you want):

Spoiler

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";
    */

ExileServer_object_player_createBambi = "Custom\RespectLoadouts\ExileServer_object_player_createBambi.sqf";
};

Or if you used some other location in Exile.Yourmission folder, make sure you correct the path to file in the CfgExileCustomCode.

Save file and repack the Exile.Yourmap folder to Exile.Yourmap.pbo and you are good to go. :)

P.S. I like to doubleclick the newly created .pbo (just to open it without extracting) and check if the $PREFFIX$ is inside, if it is not I copy it manually (CTRL+C) from the extracted folder, and paste it in opened .pbo with Ctrl+V.

@Beowulfv will try to integrate this into ExileServer_object_player_network_createPlayerRequest  again, tried it once, for some reason it did not work (there also is a high possibility I messed up something in the process, was really late when I did it XD)

Edited by Brenner

Share this post


Link to post
Share on other sites

@Brenner I know there are a few ways to do it as player creation calls to a few different SQF files. I also know my method works as I still use it to this day. But like I said I know there is more than one way of doing things which is why I linked a few other examples. Use what works for you, and don't worry about the rest is usually my approach to everything.

  • Like 1

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.