Need some help lowering hositlity

  1. 4 years ago

    Hello,

    I'm trying to incorporate ACEXs humanitarian rations into my alive mission. I want players to be able to give civilians humanitarian rations for a slight reduction in local hostility. The central programmatic premise is simple enough and I can easy add hooks to detect civilians spawning and adding the ability to give them the rations.

    However, I can't seem to lower the hostility. I've been running the mission locally using the debug console and the hostility refuses to lower.

    When I run the following script a strange array is returned.
    Script:
    [getPos player, [side player], -20] call ALIVE_fnc_updateSectorHostility;

    Array:
    ["#CBA_HASH#",["nodes","clusterID","center","size","type","priority","debugColor","debug","hostility","casualties","sectors","posture"],[[963023: wall_indfnc_pole.p3d,1419307c100# 962940: mil_guardhouse.p3d],"c_320",[4394.11,10902.7],150,"CIV",0,"ColorGreen",false,["#CBA_HASH#",["EAST","WEST","GUER",WEST],[0,130,0,-20],any],0,["4_10"],130],any]

    And when I run the following script to gauge local hostility it always shows 130 even when I attempt to lower the hostility.

    ALiVE_fnc_getNearestClusterHostilityBySide = {
    private ["_allClusters","_sectorsByDistance","_nearestSector","_clusterHostility","_clusterHostilityToSide"];
    params ["_pos","_side"];

    _allClusters = ([ALiVE_clusterHandler,"clusters"] call ALiVE_fnc_hashGet) select 2;
    _sectorsByDistance = [_allClusters,[_pos],{_input0 distance ([_x,"position"] call ALiVE_fnc_hashGet)},"ASCEND"] call ALiVE_fnc_SortBy;
    _nearestSector = _sectorsByDistance select 0;

    _clusterHostility = [_nearestSector, "hostility"] call ALIVE_fnc_hashGet;
    _clusterHostilityToSide = [_clusterHostility,_side, 0] call ALIVE_fnc_hashGet;

    _clusterHostilityToSide
    }; [getPos player, "WEST"] call ALiVE_fnc_getNearestClusterHostilityBySide;

    I have been using the server execute function of debug console but that shouldn't be a factor given that the mission is running locally. I'm sure I'm forgetting something really simple.

    Thanks for your time.

  2. Hey I know JD Wang was trying to accomplish some similar stuff. Here’s a link to our Discord channel. I’d say maybe ping him and get his take?

    https://discord.gg/gaZg49h

 

or Sign Up to reply!