Jump to content
barto300

Scripts work in SP testing but not in MP testing

Recommended Posts

So i've been quite busy with a Zeus mission and already have multiple pieces of code inside of it. These pieces of code are all taken from submissions either on the forums or armaholic. I have no clue what it all means.
When I test my mission in Singleplayer all the code runs fine and everything does what it's supposed to do. But whenever I try to test it in Multiplayer some of the stuff stops working.
I'll just note the scripts that i'm using here:

Enigma Civilians: Works
Player keeps loadout on respawn: Works
Show/hide certain markers to certain logged players: Semi works. Markers will hide but not re-appear.
INCON Undercover: Does not work. Will only show a hint saying "Initializing Undercover"

 

I've been working on fixing this for days but have not had a single succes.
If anyone knows a solution or is willing to help would be awesome!

Share this post


Link to post
Share on other sites
3 minutes ago, jts_2009 said:

 

Thanks for the good luck wishes! Not sure if I need it.
This community seems really helpfull with this stuff so I guess it'll turn out great! :D

Share this post


Link to post
Share on other sites

The only point you could have a quick help is for markers. But without code... The jts_2009's answer is pertinent.

  • Like 1

Share this post


Link to post
Share on other sites
5 hours ago, gokitty1199 said:

you probably need to modify the script that we cant see

 

7 hours ago, pierremgi said:

The only point you could have a quick help is for markers. But without code... The jts_2009's answer is pertinent.

Well That's why I noted down the scripts I used. I'm also obviously not a regular here so I do not know what people want if I ask a question or seek help, wich makes jts's comment quite trolly and unhelpfull.
But that aside. What is it that you would like to see?
People tell me a marker script is easy as pie so I thaught people could help me with that instantly. I can post the line of code if you want?
And INCON_undercover is a known script here on the forums wich is a copy/paste script according to the topic.I didn't even edit much. Only a few pieces of equipment the script is supposed see as civilian clothing. It has quite a lot of code thus would make one hell of a large topic if I post all the code but i'll try my best.



initPlayerLocal.sqf

This is the initPlayerLocal script in wich there is a line for initialising the INCON_undercover script and also the hide/show markers script.

Quote

if (player getVariable ["isSneaky",false]) then {
    [player] execVM "INC_undercover\Scripts\initUCR.sqf";
};


private _markersToHide = "roadie","stuntracer"];
_markersToHide select {
    _x setMarkerAlphaLocal 0;
};

if (player == Roadie) then {
    private _markersToShow = ["roadie"];
    _markersToShow select {
    _x setMarkerAlphaLocal 1;
};

if (player == Stuntracer) then {
    private _markersToShow = ["stuntracer"];
    _markersToShow select {
    _x setMarkerAlphaLocal 1;
};

 

initUCR.sqf

This script I do not really understand. After the init this is probably supposed to run and initialise the script ingame when players try to go undercover.

Quote

/* ----------------------------------------------------------------------------
Name: initUCR

Description: Initiates undercover mode on the given unit and (if the unit is a player) on all group members of the unit.

Parameters:
0: Unit <OBJECT>

Returns: Nil

Examples:

[player] execVM "INC_undercover\Scripts\initUCR.sqf";

Author: Incontinentia
---------------------------------------------------------------------------- */

private ["_trespassMarkers","_civilianVests","_civilianUniforms","_civilianBackpacks","_civFactions","_civPackArray","_incogVests","_incogUniforms","_incogFactions"];

params [["_unit",objNull]];

waitUntil {!(isNull player)};

#include "..\UCR_setup.sqf"

//Can only be run once per unit.
if ((_unit getVariable ["INC_undercoverHandlerRunning",false]) || {(!local _unit)}) exitWith {};

_unit setVariable ["INC_undercoverHandlerRunning", true];
_unit setVariable ["INC_isCompromised", false];
_unit setVariable ["INC_suspicious", false];
_unit setVariable ["INC_cooldown", false];
_unit setVariable ["INC_shotAt",false];
_unit setVariable ["INC_firedRecent",false];

if ((isPlayer _unit) && {time < 60}) then {{_x setVariable ["INC_notDismissable",true]} forEach (units group _unit)};

_unit setVariable ["isUndercover", true, true]; //Allow scripts to pick up sneaky units alongside undercover civilians (who do not have the isSneaky variable)

sleep 1;

if (!isPlayer _unit) then {_unit setCombatMode "GREEN"};

if ((_debug) && {isPlayer _unit}) then {hint "Undercover initialising..."};

if (isNil "INC_asymEnySide") then {
    [player] call INCON_ucr_fnc_initUcrVars;
};

waitUntil {
    sleep 1;
    (missionNamespace getVariable ["INC_ucrInitComplete",false])
};

if (_racism) then {
    private ["_unitIDs","_looksLikeArray"];
    _unitIDs = ([[_unit],"getUnitIDs","full"] call INCON_ucr_fnc_ucrMain);
    _looksLikeArray = ([[_unitIDs,INC_civIdentities,INC_incogIdentities],"IDcheck"] call INCON_ucr_fnc_ucrMain);
    _looksLikeArray params ["_looksLikeCiv","_looksLikeIncog"];
    _unit setVariable ["INC_looksLikeCiv",_looksLikeCiv];
    _unit setVariable ["INC_looksLikeIncog",_looksLikeIncog];

    if ((_debug) && {isPlayer _unit}) then {
        diag_log format ["Player identities: %1", _unitIDs ];
        diag_log format ["Lookalike array: %1", _looksLikeArray];
    };
} else {
    _unit setVariable ["INC_looksLikeCiv",true];
    _unit setVariable ["INC_looksLikeIncog",true];
};

if ((_debug) && {isPlayer _unit}) then {
    diag_log format ["INC_ucr Racism checks active: %1",_racism];
    diag_log format ["Incon undercover variable INC_looksLikeCiv: %1", (_unit getVariable "INC_looksLikeCiv") ];
    diag_log format ["Incon undercover variable INC_looksLikeIncog: %1", (_unit getVariable "INC_looksLikeIncog") ];
};

sleep 0.5;

[_unit, true] remoteExec ["setCaptive", _unit]; //Makes enemies not hostile to the unit

if (isPlayer _unit) then {

    //Add respawn eventhandler so all scripts work properly on respawn
    _unit addMPEventHandler ["MPRespawn",{
        _this spawn {
            params ["_unit"];
            _unit setVariable ["INC_undercoverHandlerRunning", false];
            _unit setVariable ["INC_isCompromised", false];
            _unit setVariable ["INC_suspicious", false];
            _unit setVariable ["INC_cooldown", false];
            _unit setVariable ["INC_shotAt",false];
            _unit setVariable ["INC_firedRecent",false];
            sleep 1;
            [[_unit], "INC_undercover\Scripts\initUCR.sqf"] remoteExec ["execVM",_unit];
        };
    }];

    sleep 0.5;

    //Debug hints
    if (_debug) then {
        [player] spawn {
            params ["_unit"];
            sleep 5;

            waitUntil {
                sleep 1;
                _unit globalChat (format ["%1 cover intact: %2, comp f/v: %3 / %4",_unit,(captive _unit),(_unit getVariable ["INC_isCompromised",false]),((vehicle _unit) getVariable ["INC_naughtyVehicle",false])]);
                _unit globalChat (format ["%1 trespassing: %2",_unit,((_unit getVariable ["INC_proxAlert",false]) || {(_unit getVariable ["INC_trespassAlert",false])})]);
                _unit globalChat (format ["%1 suspicious level: %2",_unit,(_unit getVariable ["INC_suspiciousValue",1])]);
                _unit globalChat (format ["%1 weirdo check on: %2, value %3",_unit,(captive _unit),(round (_unit getVariable ["INC_disguiseValue",1]))]);
                _unit globalChat (format ["%1 dist multi on: %2, value i%3 / f%4",_unit,(captive _unit),(round (_unit getVariable ["INC_radiusMulti",1])),(round (_unit getVariable ["INC_disguiseRad",1]))]);
                _unit globalChat (format ["Enemy know about %1: t%2 / i%3 / a%4",_unit,(_unit getVariable ["INC_AnyKnowsSO",false]),([_unit,INC_regEnySide,true] call INCON_ucr_fnc_isKnownToSide),([_unit,INC_asymEnySide,true] call INCON_ucr_fnc_isKnownToSide)]);
                !(_unit getVariable ["isUndercover",false])
            };

            _unit globalChat (format ["%1 undercover status: %2",_unit,(_unit getVariable ["isUndercover",false])]);
        };
    };

    sleep 0.5;

    //Run a low-impact version of the undercover script on AI subordinates (no proximity check)
    [_unit] spawn {
        params ["_unit"];
        {
            sleep 0.2;
            [_x] execVM "INC_undercover\Scripts\initUCR.sqf";
            sleep 0.2;
            _x setVariable ["noChanges",true,true];
            _x setVariable ["isUndercover", true];
            sleep 0.2;
            [[_x,_unit],"addConcealActions"] call INCON_ucr_fnc_ucrMain;
        } forEach ((units _unit) select {
            !(_x getVariable ["isUndercover",false]) &&
            {!isPlayer _x}
        });
    };
};

sleep 1;

//Get the undercover loops running on the unit
[_unit] call INCON_ucr_fnc_UCRhandler;

sleep 1;

//Main loop
waitUntil {

    //Pause while the unit is compromised
    waitUntil {
        sleep 1;
        !(_unit getVariable ["INC_isCompromised",false]);
    };

    //wait until the unit is acting all suspicious
    waitUntil {
        sleep 1;
        (((_unit getVariable ["INC_suspiciousValue",1]) >= 2) || {!captive _unit});
    };

    //Tell them they are being suspicious
    if ((_debug) && {isPlayer _unit}) then {
        [_unit] spawn {
            params ["_unit"];
            hint "Acting suspiciously.";
            waitUntil {
                sleep 1;
                !((_unit getVariable ["INC_suspiciousValue",1]) >= 2)
            };
            hint "No longer acting suspiciously.";
        };
    };

    //Once the player is doing suspicious stuff, make them vulnerable to being compromised
    _unit setVariable ["INC_suspicious", true]; //Hold the cooldown script until the unit is no longer doing suspicious things
    [_unit, false] remoteExec ["setCaptive", _unit]; //Makes enemies hostile to the unit

    [_unit] call INCON_ucr_fnc_cooldown; //Gets the cooldown script going

    //While he's acting suspiciously
    while {
        sleep 1;
        (((_unit getVariable ["INC_suspiciousValue",1]) >= 2) && {!(_unit getVariable ["INC_isCompromised",false])}) //While not compromised and either armed or trespassing
    } do {
        if (
            ((_unit getVariable ["INC_suspiciousValue",1]) >= 3) &&
            {(_unit getVariable ["INC_AnyKnowsSO",false])}
        ) then {

            //Once people know exactly where he is, and that he is doing loads of suspicious stuff, make him compromised
            if (([_unit, INC_regEnySide,10] call INCON_ucr_fnc_isKnownExact) || {([_unit, INC_asymEnySide,10] call INCON_ucr_fnc_isKnownExact)}) exitWith {

                [_unit] call INCON_ucr_fnc_compromised;
            };
        };
    };

    //Then stop the holding variable and allow cooldown to commence
    _unit setVariable ["INC_suspicious", false];

    sleep 2;

    //Wait until cooldown loop has finished
    waitUntil {
        sleep 2;
        !(_unit getVariable ["INC_cooldown",false]);
    };

    (!(_unit getVariable ["isUndercover",false]) || {!(alive _unit)} || {!local _unit})

};

_unit setVariable ["INC_undercoverHandlerRunning", false];

 

 

UCR_setup.sqf

This is the setup scrip of the INCON_undercover script. Here I can edit all the options there are and what additional items I want the script to remember.
This is also the only piece of scripting I edited in the entire script.

Quote

/*

Setup options for INC_undercover undercover / civilian recruitment script by Incontinentia.

Please check each setting carefully otherwise the script may not function properly in your scenario. All classnames must have quotation marks ("Item_Random_F")

*/

//-------------------------Player settings-------------------------

_undercoverUnitSide = independent;             //What side is/are the undercover unit(s) on? (Can be east, west or independent - only one side supported)

//-------------------------General Settings-------------------------

_debug = true;                         //Set to true for debug
_fullAIfunctionality = true;            //Enable all checks on AI (may degrade performace very slightly for large groups, 15+)
_easyMode = true;                       //Disguise checks will also reveal if the player is compromised or not

_racism = true;                         //Enemies will notice if you aren't the race of the faction you're pretending to be (making you easier to detect if nothing is covering your face)
_racProfFacCiv = 1;                     //(Number) Multiplies the effect of racial profiling. Lower this number to simulate more multicultural civilian population
_racProfFacEny = 1;                     //(Number) Multiplies the effect of racial profiling. Lower this number to simulate more multicultural enemy forces

_regEnySide = east;                     //Units of this side will be classed as regular enemies (Side: can be east, west, independent) - if you don't need this, comment the line out (i.e. put // before _regEnySide, as in //_regEnySide = east;).
_regBarbaric = false;                   //(Bool - true or false) Will this side lash out on civilians if it takes casualties and doesn't know the attacker?
_regDetectRadius = 10;                  //Default detection radius for regular troops (this will expand and contract based on weather, time of day, and how the undercover unit is acting - civilians within this radius will be under much more scrutinty)

_asymEnySide = sideEmpty;             //Units of this side will be classed as asymetric enemies (Side: can be east, west, independent) - if you don't need this, comment the line out (i.e. put // before _asymEnySide, as in //_asymEnySide = east;).
_asymBarbaric = true;                   //(Bool - true or false) Will this side have a small chance of lashing out on civilians if it takes casualties and doesn't know the attacker?
_asymDetectRadius = 15;                 //Default detection radius for asym troops (this will expand and contract based on weather, time of day, and how the undercover unit is acting - civilians within this radius will be under much more scrutinty)

_trespassMarkers = [];                  //Names of additional markers for areas that would be considered trespassing (any with "INC_tre" - case sensitive - somewhere in the marker name will automatically be included)

//-------------------------Civilian Disguise settings-------------------------

_civFactions = ["CIV_F","CIV_F_TANOA"]; //Array of factions whose vests are safe for undercover units to wear

//(Array of classnames) Safe vests (on top of the specific factions above - useful if faction has randomisation script or to add items that are not used by the faction)
_civilianVests = ["rds_pistol_holster"];

//(Array of classnames) Safe uniforms (on top of the specific factions above - useful if faction has randomisation script or to add items that are not used by the faction)
_civilianUniforms = ["U_BG_Guerilla2_2","U_BG_Guerilla2_1","U_BG_Guerilla2_3","U_I_C_Soldier_Bandit_4_F","U_I_C_Soldier_Bandit_1_F","U_I_C_Soldier_Bandit_2_F","U_I_C_Soldier_Bandit_5_F","U_I_C_Soldier_Bandit_3_F","rds_uniform_assistant","rds_uniform_citizen1","rds_uniform_citizen2","rds_uniform_citizen3","rds_uniform_citizen4","rds_uniform_doctor","rds_uniform_Functionary1","rds_uniform_Functionary2","rds_uniform_Policeman","rds_uniform_priest","rds_uniform_Profiteer1","rds_uniform_Profiteer2","rds_uniform_Profiteer3","rds_uniform_Profiteer4","rds_uniform_Rocker1","rds_uniform_Rocker2","rds_uniform_Rocker3","rds_uniform_Rocker4","rds_uniform_schoolteacher","rds_uniform_Villager1","rds_uniform_Villager2","rds_uniform_Villager3","rds_uniform_Villager4","rds_uniform_Woodlander1","rds_uniform_Woodlander2","rds_uniform_Woodlander3","rds_uniform_Woodlander4","rds_uniform_Worker1","rds_uniform_Worker2","rds_uniform_Worker3","rds_uniform_Worker4","U_Competitor"];

//(Array of classnames) Safe headgear (will automatically include civilian headgear classes - useful if faction has randomisation script or to add items that are not used by the faction)
_civilianHeadgear = ["rds_rocker_hair1","rds_rocker_hair2","rds_rocker_hair3","rds_police_cap","rds_Profiteer_cap1","rds_Profiteer_cap2","rds_Profiteer_cap3","rds_Profiteer_cap4","rds_Woodlander_cap1","rds_Woodlander_cap2","rds_Woodlander_cap3","rds_Woodlander_cap4","rds_Villager_cap1","rds_Villager_cap2","rds_Villager_cap3","rds_Villager_cap4","rds_worker_cap1","rds_worker_cap2","rds_worker_cap3","rds_worker_cap4"];

//(Array of classnames) Safe backpacks (will automatically include civilian backpack classes - useful if faction has randomisation script or to add items that are not used by the faction)
_civilianBackpacks = ["B_FieldPack_blk","B_FieldPack_cbr","B_FieldPack_khk","B_FieldPack_oucamo","G_FieldPack_Medic","B_Carryall_cbr","B_Carryall_khk","B_Carryall_oucamo","B_TacticalPack_blk","B_TacticalPack_rgr","B_TacticalPack_oli","B_Kitbag_cbr","B_Kitbag_rgr","B_Kitbag_sgg","B_Respawn_Sleeping_bag_blue_F","B_Respawn_Sleeping_bag_brown_F","B_Respawn_TentDome_F","B_Respawn_TentA_F","B_Parachute","ACE_NonSteerableParachute","ACE_TacticalLadder_Pack"];

//(Array of classnames) Safe vehicles to drive in (automatically includes vehicles from the civilian factions above).
_civilianVehicleArray = ["RDS_Ikarus_Civ_01", "RDS_Ikarus_Civ_02", "RDS_Lada_Civ_01", "RDS_Lada_Civ_02", "RDS_Lada_Civ_03", "RDS_Lada_Civ_05", "RDS_Lada_Civ_04", "RDS_S1203_Civ_01", "RDS_S1203_Civ_02", "RDS_Gaz24_Civ_01", "RDS_Gaz24_Civ_02", "RDS_Gaz24_Civ_03", "RDS_Golf4_Civ_01", "RDS_Octavia_Civ_01,", "RDS_Zetor6945_Base", "RDS_Old_bike_Civ_01", "RDS_JAWA353_Civ_01", "RDS_TT650_Civ_01", "RDS_Van_01_fuel_F", "RDS_MMT_Civ_01", "rhsgref_ins_g_ural_work_open", "rhsgref_ins_g_ural_work"];

_HMDallowed = false; //(Bool - true or false) Are HMDs (night vision goggles etc.) safe to wear for units pretending to be civilians? Set to false if wearing HMDs will cause suspicion (must be stored in backpack).

_noOffRoad = true; //Civilian vehicles driving more than 50 meters from the nearest road will be considered hostile

//-------------------------Enemy Disguise settings-------------------------
_incogFactions = ["OPF_F","OPF_T_F"]; //Array of enemy factions whose items and vehicles will allow the player to impersonate the enemy

//(Array of classnames) Safe vests (on top of the specific factions above - useful if faction has randomisation script or to add items that are not used by the faction)
_incognitoVests = [];

//(Array of classnames) Safe uniforms (on top of the specific factions above - useful if faction has randomisation script or to add items that are not used by the faction)
_incognitoUniforms = [];

//(Array of classnames) Safe headgear (will automatically include incog headgear classes - useful if faction has randomisation script or to add items that are not used by the faction)
_incognitoHeadgear = [];

//(Array of classnames) Safe backpacks (will automatically include incog backpack classes - useful if faction has randomisation script or to add items that are not used by the faction)
_incognitoBackpacks = [];

_incogVehArray = []; //(Array of classnames) Additional incognito vehicles (vehicles from the faction above will automatically count)

//-------------------------Civilian recruitment settings-------------------------
/*
By enabling civilian recruitment, undercover can recruit any ambient civilians they see into their group (if their reputation allows / the civvy wants to join).
Civilians will operate under similar restrictions to the player.
You can also dismiss your new teammates and they will leave your group and carry on doing whatever it is they fancy doing (usually sitting cross-legged in the middle of a field).
*/

_civRecruitEnabled = false;          //(Bool - true or false) Set this to false to prevent undercover units from recruiting civilians
_armedCivPercentage = 70;           //(Number - 0 to 100) Max percentage of civilians armed with weapons from the array below, either on their person or in their backpacks (will only work if _civRecruitEnabled is set to true, otherwise this is ignored)

//Weapon classnames for armed civilians (array of classnames)
_civWpnArray = ["arifle_AKS_F","arifle_AKM_F","hgun_Pistol_01_F","hgun_Rook40_F","hgun_ACPC2_F","hgun_Rook40_F"];

//Items that civilians may carry
_civItemArray = ["ACE_Cellphone","ACE_Banana","ACE_Flashlight_KSF1","ACE_SpraypaintBlack","itemRadio","ACE_RangeCard","ACE_key_civ","ACE_key_lockpick","ACE_fieldDressing","IEDUrbanSmall_F","IEDUrbanSmall_F"];

//Civilian backpack classes (array of classnames)
_civPackArray = ["B_FieldPack_blk","B_FieldPack_cbr","B_FieldPack_khk","B_FieldPack_oucamo","B_Carryall_cbr"];

 

 

I hope this will make a clearer understanding of my problem.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
33 minutes ago, barto300 said:

Well That's why I noted down the scripts I used. I'm also obviously not a regular here so I do not know what people want if I ask a question or seek help, wich makes jts's comment quite trolly and unhelpfull.

 

It's usually helpful to be as detailed as possible, saying you have problems with 3 scripts made by 3 different authors doesn't really go far, besides people suggesting to contact the original authors.

Also depends on how you test this stuff. Locally hosted MP is something different than a dedicated server, especially when calling script from initServer.sqf or from init.sqf with the all too famous "if (!isServer) exitWith {}" followed by various "player" commands paradoxon.

 

Cheers

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Grumpy Old Man said:

 

It's usually helpful to be as detailed as possible, saying you have problems with 3 scripts made by 3 different authors doesn't really go far, besides people suggesting to contact the original authors.

Also depends on how you test this stuff. Locally hosted MP is something different than a dedicated server, especially when calling script from initServer.sqf or from init.sqf with the all too famous "if (!isServer) exitWith {}" followed by various "player" commands paradoxon.

 

Cheers

Yes when I googled testing in SP and MP I read that there was a difference but when the wiki starts explaining it, it just completely loses me, even with the examples they show.
I also already contacted the creator of the Undercover script but he's not been online in a month and is not answering. The marker script was given to me by someone whom is also not answering when I told him the markers didn't show.
I'll try to be more detailled next time if I have a problem.

Share this post


Link to post
Share on other sites

Additionally to  Grumpy Old Man's comments, may I suggest you read into multiplayer/local/single player differences and the impact it has on scripting. You'll find various good information sources online, I can suggest:

 

  • GoKitty's tuts are more recent, give them a try as well: 

 

Understanding how SQF works, especially the differences between MP & LOCAL/SP will help you understand the issues you are facing with the scripts you mentioned. 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 minute ago, whiztler said:

Additionally to  Grumpy Old Man's comments, may I suggest you read into multiplayer/local/single player differences and the impact it has on scripting. You'll find various good information sources online, I can suggest:

 

  • GoKitty's tuts are more recent, give them a try as well: 

 

Understanding how SQF works, especially the differences between MP & LOCAL/SP will help you understand the issues you are facing with the scripts you mentioned. 

 

Yes I was already working my way through some of those, thanks! :)

Share this post


Link to post
Share on other sites
On 11/07/2018 at 12:31 AM, barto300 said:

Show/hide certain markers to certain logged players: Semi works. Markers will hide but not re-appear.
INCON Undercover: Does not work. Will only show a hint saying "Initializing Undercover"

 

 

So, if I'm right, the only script referring to markers (to hide or not) is the initPlayerLocal one... with if then conditions. That means they are initialized (with their alpha), but nothing is scripted to make them "re-appear". Your question has no sense if you don't tell us what event should make them re-appear. We are not supposed to guess what you want to obtain, when.

 

Perhaps few people could help with INCOM Undercover. Users if skilled, author. For what I can see, I'm not a user, in initPlayerLocal.sqf, you have:

 

if (player getVariable ["isSneaky",false]) then {
    [player] execVM "INC_undercover\Scripts\initUCR.sqf";
};

 

That means you have to add :

this getVariable ["isSneaky",true]; 

in all init field of the playable units in editor. If not, there is no reason to have this condition set to true, then run the initUCR.sqf.

 

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

snip

Oh whoops. Sorry I thought I had the reason for reappear written down but that was in the other thread.
 

The markers are supposed to reappear when a player logs in. All players are able to play a certain character and every certain character has few markers specific to that character. However there are more characters than players so only the markers of the characters that are being played are supposed to be seen by everyone.

That little piece of code was all the code I had gotten when I asked if someone knew a good solution for this problem. It indeed hides the markers but if a player logs into the server and selects a character that character's specific markers do not pop up.


As far as the undercover script goes, I had done that to every character I want players be able to play. Even edited it down to every single clothing piece they are allowed to wear. When I test it in SP enviroment is also all works perfectly. The AI responds like it should. I can see my disguise status, I can see my AI squad members change from Independent to civilian when their undercover kicks in. But as soon as I test it in Multiplayer the only thing that works is the initial "Hint" telling me that the script is initialising, nothing happens after that.

Share this post


Link to post
Share on other sites
Quote

call compile preprocessFileLineNumbers "Engima\Traffic\Init.sqf";
call compile preprocessFileLineNumbers "Engima\Civilians\Common\Common.sqf";
call compile preprocessFileLineNumbers "Engima\Civilians\Common\Debug.sqf";

// The following constants may be used to tweak behaviour

ENGIMA_CIVILIANS_SIDE = civilian;      // If you for some reason want the units to spawn into another side.
ENGIMA_CIVILIANS_MINSKILL = 0.4;       // If you spawn something other than civilians, you may want to set another skill level of the spawned units.
ENGIMA_CIVILIANS_MAXSKILL = 0.6;       // If you spawn something other than civilians, you may want to set another skill level of the spawned units.

ENGIMA_CIVILIANS_MAXWAITINGTIME = 300; // Maximum standing still time in seconds
ENGIMA_CIVILIANS_RUNNINGCHANCE = 0.05; // Chance of running instead of walking

// Civilian personalities
ENGIMA_CIVILIANS_BEHAVIOURS = [
    ["CITIZEN", 100] // Default citizen with ordinary behaviour. Spawns in a house and walks to another house, and so on...
];

// Do not edit anything beneath this line!

ENGIMA_CIVILIANS_INSTANCE_NO = 0;

if (isServer) then {
    call compile preprocessFileLineNumbers "Engima\Civilians\Server\ServerFunctions.sqf";
    call compile preprocessFileLineNumbers "Engima\Civilians\ConfigAndStart.sqf";
};

This is the init.sqf but it has only code to a ambient civilian script

Share this post


Link to post
Share on other sites

In all the stuff you gave, there is a code:

waitUntil { sleep 1;  (missionNamespace getVariable ["INC_ucrInitComplete",false]) };

 

but nowhere else to make this variable set to true...

So the question is, where, when do you have a :

missionNameSpace setVariable ["INC_ucrInitComplete",true];

 

Not found so far. And your script seems to be stuck here.

 

Share this post


Link to post
Share on other sites

Hmmm the problem does seem to be in that area. I had true changed to false and suddenly the script started working again. I was again able to become undercover along with NPC squadmates. I tested it with some enemies and getting in and out of cover via picking up weapons and wrong clothing.

But it did seem like a temporary solution. I had a bombardment of error all pointing towards a variable called trespassmarker, and upon game restart I was no longer able to go undercover even though I didn't change anything.
Might it be a problem on my side like UPNP? I mostly test on LAN connection but also on via internet there is no change. But it still works in SP

Share this post


Link to post
Share on other sites

Ok. I found out something. After poking around I got the idea to change up the spawn mechanic. Sometimes I noticed that clones would be floating in the water at the corner of the map. I once set my respawn timer to 0 second and I would not be spawned at the spawnpoint but instead be that guy in the water. So I tried to replicate the Singleplayer style spawning. I completely disabled respawning and instead activated singleplayer death screen but I still tested in MP and it seems to have fixed it. The entire script is working with no errors. But now I have to find out how to still enable respawn but without screwing up the script.

Share this post


Link to post
Share on other sites

So turns out it was the respawn timer that screwed things up. I have to set the respawn timer to about 25 seconds to give the script time to initialize, otherwise it will not work.
Now I only need to tackle the issue with markers not re-appearing.

Share this post


Link to post
Share on other sites
9 hours ago, barto300 said:

Yes when I googled testing in SP and MP I read that there was a difference but when the wiki starts explaining it, it just completely loses me, even with the examples they show.
I also already contacted the creator of the Undercover script but he's not been online in a month and is not answering. The marker script was given to me by someone whom is also not answering when I told him the markers didn't show.
I'll try to be more detailled next time if I have a problem.

i have not read the replies after this post, but a simple way to explain it is like this.

SP, you are the server, any script that runs PERIOD runs on your machine, you know everything.

MP(hosted through arma 3) you are the server, any script that runs PERIOD runs on your machine, you know everything again, so one thing may work differently for you than it does for example your friend who joined the server.

DEDICATED, its the same as if you join a random wasteland server, you are just another client because the server running the mission handles its own data separately from you and deals with critical information that you dont want clients to deal with generally. in this case the server is what you would think of, just a server and your just a client playing on it unlike MP.

Share this post


Link to post
Share on other sites
11 hours ago, gokitty1199 said:

i have not read the replies after this post, but a simple way to explain it is like this.

SP, you are the server, any script that runs PERIOD runs on your machine, you know everything.

MP(hosted through arma 3) you are the server, any script that runs PERIOD runs on your machine, you know everything again, so one thing may work differently for you than it does for example your friend who joined the server.

DEDICATED, its the same as if you join a random wasteland server, you are just another client because the server running the mission handles its own data separately from you and deals with critical information that you dont want clients to deal with generally. in this case the server is what you would think of, just a server and your just a client playing on it unlike MP.

Yeah thanks, I was already working through those tutorials and I knew a bit about the differences. But the undercover problem has been fixed, see my last reply, it got broken because of the respawn timer. Now I only have to fix the character specific markers that need to appear and dissapear when a player is logging in and out on a specific character. But this problem is active on both Singleplayer and Multiplayer.

Share this post


Link to post
Share on other sites
On 7/13/2018 at 3:22 AM, barto300 said:

Yeah thanks, I was already working through those tutorials and I knew a bit about the differences. But the undercover problem has been fixed, see my last reply, it got broken because of the respawn timer. Now I only have to fix the character specific markers that need to appear and dissapear when a player is logging in and out on a specific character. But this problem is active on both Singleplayer and Multiplayer.

are you trying to get those markers to appear on the map? can you share the script and explain how you want it to work.

Share this post


Link to post
Share on other sites
On 15-7-2018 at 8:55 PM, gokitty1199 said:

are you trying to get those markers to appear on the map? can you share the script and explain how you want it to work.

Sorry, was away for a few days.
I think you were in the same post where a guy was friendly enough to post the script I use. This is the script:

 

Quote


private _markersToHide = ["ExampleMarker1","ExampleMarker2","ExampleMarker2"];
_markersToHide select {
    _x setMarkerAlphaLocal 0;
};

if (player == NAMEOFUNIT) then {
    private _markersToShow = ["ExampleMarker1","ExampleMarker2"];
    _markersToShow select {
    _x setMarkerAlphaLocal 1;
};
 


And this is the script after I edited it.

Quote

private _markersToHide = ["roadie_h","stuntracer"];
_markersToHide select {
    _x setMarkerAlphaLocal 0;

};

if (player == Roadie) then {
    private _markersToShow = ["roadie_h"];
    _markersToHide select {
    _x setMarkerAlphaLocal 1;
};

if (player == Stuntracer) then {
    private _markersToShow = ["stuntracer"];
    _markersToShow select {
    _x setMarkerAlphaLocal 1;
};


I've currently got it written down in my initPlayerServer.sqf

but i've also had it in initPlayerLocal.sqf

It does not seem to matter in wich one I put it. Both seem to work for 50%


So I'm no code man but this script is supposed to hide/show markers for specific characters. The idea is that I have a set of specific characters available for my players to choose between. These characters all have unique (civilian) backgrounds like firefighter, policeman, priest, fisher, farmer, mail delivery man, roadie, stuntracer, etc, etc.
In the scenario all player's characters are friends and live somewhere in the country, when suddenly a russian invasion starts. The players will have to play a bit like Antistasi. They have to acquire weapons, vehicles and support for the resistance.

At the start of the game the characters that are being played have unique features like for instance: The policeman starts with a pistol, The journalist has secret contacts that can give the group support in trade for evidence, the stuntracer starts with a bike, the hunter has hunting weapons and ammo at his home, the priest can help recruit civilians to the resistance cause, etc.
All of these things are supposed to be marked on the map but ONLY if the corresponding character is being played. If the hunter is not being controlled by a player then his markers should also not show up. This is supposed to go for every playable character to give them all something unique within the group at the start of the game.


So if I look at the code the first set of code seems to work. The markers roadie_h and stunracer are being hidden. But something has to go wrong with the next set of code. When I join in as a roadie or stuntracer than the corresponding markers do not appear on the map like they should do even though there are no errors or complications.

 

Thanks for the help!

Share this post


Link to post
Share on other sites
10 hours ago, barto300 said:

Sorry, was away for a few days.
I think you were in the same post where a guy was friendly enough to post the script I use. This is the script:

 


And this is the script after I edited it.


I've currently got it written down in my initPlayerServer.sqf

but i've also had it in initPlayerLocal.sqf

It does not seem to matter in wich one I put it. Both seem to work for 50%


So I'm no code man but this script is supposed to hide/show markers for specific characters. The idea is that I have a set of specific characters available for my players to choose between. These characters all have unique (civilian) backgrounds like firefighter, policeman, priest, fisher, farmer, mail delivery man, roadie, stuntracer, etc, etc.
In the scenario all player's characters are friends and live somewhere in the country, when suddenly a russian invasion starts. The players will have to play a bit like Antistasi. They have to acquire weapons, vehicles and support for the resistance.

At the start of the game the characters that are being played have unique features like for instance: The policeman starts with a pistol, The journalist has secret contacts that can give the group support in trade for evidence, the stuntracer starts with a bike, the hunter has hunting weapons and ammo at his home, the priest can help recruit civilians to the resistance cause, etc.
All of these things are supposed to be marked on the map but ONLY if the corresponding character is being played. If the hunter is not being controlled by a player then his markers should also not show up. This is supposed to go for every playable character to give them all something unique within the group at the start of the game.


So if I look at the code the first set of code seems to work. The markers roadie_h and stunracer are being hidden. But something has to go wrong with the next set of code. When I join in as a roadie or stuntracer than the corresponding markers do not appear on the map like they should do even though there are no errors or complications.

 

Thanks for the help!

this may be of help, it what i made to show markers of group members when the player opens the map.

_color = ([side player, true] call BIS_fnc_sideColor);
_name = name player;

_group = units group player;
_marks = [];//create a multidimensional array storing the players name and a reference to the player/unit
{
	_data = [];
	_name = name _x;//get the name of the player
	_mark = createMarkerLocal [_name, position _x];//create a marker on the map for that player
	_name setMarkerShapeLocal "ICON";
	_name setMarkerTypeLocal "mil_dot";
	_name setMarkerTextLocal _name;//set the marker text to the units name
	_name setMarkerPosLocal position _x;//and position it to the player that it is on
	_name setMarkerColorLocal _color;
	_data pushback _name;
	_data pushback _x;
	_marks pushback _data;//pushes the name and the reference to the player/unit to the array marks
} forEach _group;

while {!isNull (findDisplay 12)} do
{//runs a loop while the map is open, then reads the marker(_markName is actually the marker(bad naming on my part) gets a reference to the player/unit -  
	{//in _markPlayer and sets the markers position to that player. it does this for each unit
		_markName = _x select 0;
		_markPlayer = _x select 1;
		_markName setMarkerPosLocal position _markPlayer;
	} forEach _marks;
	sleep 0.1;
};

inside the loop you could simply have your check such as if player is this then createMarker and set the markers shape/color and such.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×