Jump to content

rkemsley

Member
  • Content Count

    73
  • Joined

  • Last visited

  • Medals

Posts posted by rkemsley


  1. 45 minutes ago, pierremgi said:

    probably because the removeCuratorEditableObjects must run on server.

    There is no reason to run your script from initPlayerLocal.sqf as you write something for allCurators.

     

    Try your code from initServer.sqf

    I thought because it adds the EventHandler to the Curator Module, I thought that it would need to be added when a player joins the game, so their Curator Module will also have the piece of code.

     

    I originally had it in my "initServer.sqf", but it still didnt work when I was testing it using the "arma3server_x64.exe".

    Edit: I have also tried it in the "init" of the Curator Modeles in the Eden editor.

    Spoiler

    this addEventHandler [ "CuratorObjectPlaced", {

        params [ "_curator", "_entity" ];

        if ( ( _entity isKindOf "ModuleMine_APERSBoundingMine_F" ) || ( _entity isKindOf "ModuleMine_APERSMine_F" ) || ( _entity isKindOf "ModuleMine_ATMine_F" ) ) then {

            [ _curator, [ [ _entity ], false ] ] remoteExec [ "removeCuratorEditableObjects ", 0, true ];

            };

        }

    ];

    ...and it still doesn't work (still able to edit the explosives after they have been placed).


  2. How would I turn this short script global.

     

    Basically, I need these mines, when placed by any Curator on the map, to lose the ability to be edited by the Curator who placed it.

    Spoiler

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            if ( ( _entity isKindOf "ModuleMine_APERSBoundingMine_F" ) || ( _entity isKindOf "ModuleMine_APERSMine_F" ) || ( _entity isKindOf "ModuleMine_ATMine_F" ) ) then {

                _curator removeCuratorEditableObjects [ [ _entity ], true ];

                };

            }

        ];

    } foreach allCurators;

    Currently, I have this short piece of code located in my "initPlayerLocal.sqf", however, when I test my multiplayer map using the "arma3server_x64.exe", it doesn't remove the ability for me to edit the mines after they are placed.

     

    Please help!


  3. 4 minutes ago, killzone_kid said:

    deletevehicle is global command why do you want to use remoteexec? it already can be executed from any client or server

     

    1 hour ago, rkemsley said:

    When used by any player, the trigger just removes the question mark from the map and nothing else. I think I need to use remoteExec for the deleteVehicle part and the addCuratorPoints, but I do not know how to use that function.

    When a player uses the BIS_fnc_holdActionAdd, the boxes are not removed and CuratorPoints are not added.


  4. I have some boxes (Weapon's Cache) scattered across my map.

     

    They can be "retrieved" by any BLUFOR player (BLUFOR player has to use the hold action), which removes the box, adds CuratorPoints to all BLUFOR Curators and removes the question mark from the map (where the box is located).

     

    They can also be "destroyed" by any Independent unit (Independent player and AI has to use the hold action), which removes the box and removes the question mark from the map (stopping the BLUFOR Curators from gaining CuratorPoints).

    I currently have this in the init of all the boxes scattered across the map.

    Spoiler

    [

        this,

        "retrieve weapons cache.",

        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",

        "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",

        "_this distance _target < 4 && side _this == west && isPlayer _this",

        "_caller distance _target < 4 && side _this == west && isPlayer _this",

        {},

        {},

        { _this call {

            { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

            { _x addCuratorPoints 0.1 } foreach [ ZeusBLUFOR1_1_Curator, ZeusBLUFOR1_2_Curator, ZeusBLUFOR1_3_Curator, ZeusBLUFOR1_4_Curator ];

            deleteMarker "Zeus_M_Unknown1_1";

            }; 

        },

        {},

        [],

        4,

        0,

        true,

        false

    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

     

    [

        this,

        "destroy weapons cache.",

        "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",

        "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\destroy_ca.paa",

        "_this distance _target < 4 && side _this == independent",

        "_caller distance _target < 4 && side _this == independent",

        {},

        {},

        { _this call {

            { deleteVehicle _x } forEach ( getMissionLayerEntities "WeaponCache1_1" select 0 );

            deleteMarker "Zeus_M_Unknown1_1";

            }; 

        },

        {},

        [],

        4,

        0,

        true,

        false

    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

    When used by any player, the trigger just removes the question mark from the map and nothing else. I think I need to use remoteExec for the deleteVehicle part and the addCuratorPoints, but I do not know how to use that function.
     

    Please help!


  5. 1 hour ago, pierremgi said:

    Yes, use the game master modules! Don't forget to specify the owner, but you have to do more!


    Like this, that can't work for two reasons already mentioned:

    1 - As you can see in your console results, the non-played units are not defined if you disable AI. Only the played one(s) is/are. So, the non-played owner(s), even if you wrote them in owner field of the module, are not defined.

    2 - Owners are not still defined for another reason: even if you let the slots AI enabled (so the units are present/exist, hidden or not), BI decided to mask the owner in its function, until you play as him. To be more precise, here are the lines which ruin your attempt:
     

      Hide contents

     

       FROM   BIS_fnc_moduleCurator

    .....

    //--- Get curator owner
      _ownerVar = _logic getvariable ["owner",""];
      _ownerUID = parsenumber _ownerVar;
    .....

      if (_ownerUID > 0 && !ismultiplayer) then {
        _ownerVar = player call bis_fnc_objectvar;
      };
      _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted";

      //--- Wipe out the variable so clients can't access it
      _logic setvariable ["owner",nil];

    .....

     

    you can find the complete script via function viewer from console, and the way BI manages the owner once the player is present (owner played).

     

     

    The reason why I suggested you:
    - never disable AI for Zeus slots;
    - write an array of couples  [curator,owner] to catch everything you need, especially side of the playable units.

     

    You can also set an extra variable, just f..king BI "owner" one, like:

    ZeusBLUFOR002_Curator setVariable ["myHolyOwner",BLUFOR_Player002,TRUE] ;

     

    But, I do insist:   BLUFOR_Player002 MUST be present/exist/non-disabled in lobby!! (you can hide/invincible him if you wish)

     

     

     

    Hmm, this begins a new set of problems for my win conditions.

     

    I have one piece of code (currently attached to an Eden Editor trigger) fires when my named Military Cargo Tower is destroyed.

    Spoiler

    Type: None

    Activation: None

    Activation Type: N/A

    Repeatable: "Uncheck"
    Server Only: "Uncheck"

    Condition: !alive Military_Cargo_Tower;
    On Activation: independent addScoreSide -( scoreSide independent ); west addScoreSide 250; "SideScore" call BIS_fnc_endMissionServer;

    The other piece of code (also attached to an Eden Editor trigger) fires when all BLUFOR Curator players are killed.

    Spoiler

    Type: None

    Activation: None

    Activation Type: N/A

    Repeatable: "Uncheck"
    Server Only: "Uncheck"

    Condition: ( { ( alive _x ) and ( side _x == west ) } count playableUnits ) < 1
    On Activation: independent addScoreSide 250; west addScoreSide -( scoreSide west ); "SideScore" call BIS_fnc_endMissionServer;

    If I hide and disable all BLUFOR playable units at the start, then unhide/enable them when a player joins and plays as one, the rest of the hidden and disabled units still need to be killed for Independent to win.


  6. 1 hour ago, sarogahtyp said:

    I dont know what the problem is, I can't see a mistake but you can try to add this at the very beginning of the code:

     

    
    waitUntil {sleep 1; not isNull player };

    if this is not helping then just delete the line after testing.

    Hmm, that just delays the error message.

     

    Would you suggest not using the Eden Editor Curator Module and instead add the Curator to players using scripts?

     

    Edit: Strangely, if I play as BLUFOR_Player001 and disable AI for all other player slots, I don't get the message. I also don't get the message if I disable AI, then add one AI player into BLUFOR_Player001 and I play as BLUFOR_Player002.

     

    It only seems to show the error if I disable AI and have no one playing as the first BLUFOR player in the list...


  7. 29 minutes ago, sarogahtyp said:

     

     

    pls get not too specific I may not be able to handle it

    I have edited the previous response to be more specific!

     

    Edit: I sorted out the problem, I changed the "onPlayerRespawn.sqf" to an "initPlayerLocal.sqf" because it can also fire the script if a player joins in progress.

    The moving Curator Editing Area is now working correctly. Thanks for your help!

     

    Edit : Edit: So, if I have it located in a "onPlayerRespawn.sqf" nothing happens, the Curator Editing Area never shows and it seems the script doesn't exist at all.

    If I have it located in an "initPlayerLocal.sqf" I get this error message:

     

    " '..."_areaID";

     

    switch ( player ) do {

    case |#|BLUFOR_Player001: { _ZeusCurator = ZeusB...'

    Error undefined variable in expression: blufor_player001

    File C:\Users\"me"\bla\bla\Arma3\missions\AI_Tests.VR\initPlayerLocal.sqf..., line 7 "

     

    Oddly, I don't get this message if I am playing as BLUFOR_Player001, it only appears if I player one of the other three BLUFOR players.


  8. 11 hours ago, sarogahtyp said:

    I did not check every command of your script in biki because this is your own job but something like this should do what you want.

    Put it in  onPlayerRespawn.sqf and read those event scripts description in biki.

     

    
    private _zeus_curator = objNull;
    private "_areaID";
      
    switch (player) do
    {
     case BLUFOR_Player001: { _zeus_curator = ZeusBLUFOR001_Curator; _areaID = 1; };
     case BLUFOR_Player002: { _zeus_curator = ZeusBLUFOR002_Curator; _areaID = 2; };
     case BLUFOR_Player003: { _zeus_curator = ZeusBLUFOR003_Curator; _areaID = 3; };
     case BLUFOR_Player004: { _zeus_curator = ZeusBLUFOR004_Curator; _areaID = 4; };
    };
    
    if (isNull _zeus_curator) exitWith {};
    
    while { alive player } do 
    {
     if ( { _x distance2D player < 40 && side _x isEqualTo independent } count allUnits > 0 ) then 
     { _zeus_curator removeCuratorEditingArea _areaID; } else 
     { _zeus_curator addCuratorEditingArea [ _areaID, (position player), 40 ]; };
     sleep 0.5;
    };

     

    I seem to be having a problem with this (it shouldn't have anything to do with "respawnOnStart" because the default is 1 and I haven't changed it to do anything else).

     

    This just doesn't seem to be working for some reason.

     

    Edit: added this to a newly created onPlayerRespawn.sqf. However, the Curator Editing area does not show up in-game, I also don't receive any error message.

    Spoiler

    // onPlayerRespawn.sqf

     

    private _zeusCurator = objNull;

    private "_areaID";

      

    switch ( player ) do {

        case BLUFOR_Player001: { _zeusCurator = ZeusBLUFOR001_Curator; _areaID = 1; };

        case BLUFOR_Player002: { _zeusCurator = ZeusBLUFOR002_Curator; _areaID = 2; };

        case BLUFOR_Player003: { _zeusCurator = ZeusBLUFOR003_Curator; _areaID = 3; };

        case BLUFOR_Player004: { _zeusCurator = ZeusBLUFOR004_Curator; _areaID = 4; };

        };

    if ( isNull _zeusCurator ) exitWith {};

     

    while { alive player } do {

        if ( { _x distance2D player < 40 && side _x == independent } count allUnits != 0 ) then {

            _zeusCurator removeCuratorEditingArea _areaID;

                } else {

                    _zeusCurator addCuratorEditingArea [ _areaID, position player, 40 ];

                    sleep 0.05;

            };

    };

     

    My description.ext just incase that could be the problem (which I don't think it is).

    Spoiler

    // description.ext

     

    dev = "rkemsley";

    author = "rkemsley";

    OnLoadName = "AI_Tests";

    onLoadMission = "";

    overviewText = "";

    overviewTextLocked = "";

    overviewPicture = "";

     

    class Header

    {

        gameType =  ZvZ;    // Game type

        minPlayers =  2;    // minimum number of players the mission supports

        maxPlayers = 5; // maximum number of players the mission supports

    };

     


  9. 2 hours ago, pierremgi said:

    Yes, but you don't describe what you are doing exactly in the editor or script:
    - are you using modules (Game master, probably), logics like I_virtualCurator_F and/or playable units...  How are you creating your Zeus???

    and in lobby:

    - are your disabling AIs  as playable role in lobby?

     

    As test, and it's my third question (thanks for answering the previous ones), write these watch lines in the console, at the game start (say first minute), and share the result for:
    allCurators apply {[_x,owner_x,side _x, side owner _x]}

    allPlayers apply {[_x,side _x]}
    playableUnits apply {[_x,side _x]}

    allCurators apply {[_x,owner_x,side _x]}

    [[ZeusIndependent001_Curator,any,LOGIC],[ZeusBLUFOR001_Curator,any,LOGIC],[ZeusBLUFOR002_Curator,any,LOGIC],[ZeusBLUFOR003_Curator,any,LOGIC],[ZeusBLUFOR004_Curator,any,LOGIC]]

     

    (I had to change it from "allCurators apply {[_x,owner_x,side _x, side owner _x]}" because I was getting errors).

     

    allPlayers apply {[_x,side _x]}
    [[BLUFOR_Player001,WEST]]

    playableUnits apply {[_x,side _x]}
    [[BLUFOR_Player001,WEST],[BLUFOR_Player002,WEST],[BLUFOR_Player003,WEST],[BLUFOR_Player004,WEST],[Independent_Player001,GUER]]

     

    Edit: I edited my earlier response to answer your earlier questions.


  10. 15 hours ago, pierremgi said:

     

    Difficult to follow you. I wanted the player unit to be created when a player decides to play that role. What does that mean? Disabling AI in lobby? DON'T for what you are trying to do.

     

    Players have to choose one of the playable units in lobby, so the role if you want.

    Playable units are defined or not, along with:

    - played slot: unit is defined;

    - non-played slot: unit is defined as AI if <disable AI> option is not ticked in lobby,... but not defined if <disable AI> is ticked in lobby (in this case playableUnits is same as allPlayers, even more:   isNil "anyNonPlayedUnit"  returns true)

     

    Example: you play BLUFOR_Player001 but your BLUFOR_Player002,   BLUFOR_Player003... are not yet played...

    If they are not present (as AIs) BLUFOR_Player002 and BLUFOR_Player003 doesn't exist! isNil "BLUFOR_Player002" returns true...

    but, on the other hand,

    if you don't disable AI in lobby, the non-played units are AIs til you play them, so exist! You can hide them and disable simulation on them and you can run scripts with BLUFOR_Player001 ,BLUFOR_Player002, BLUFOR_Player003,.. These variables are OK.

    Furthermore, the while {alive BLUFOR_Player001 } loop can exit if you respawn at start. But it seems to be a secondary problem here.

    Ok, I guess I need to give more context to my multiplayer map.

     

    Basically, two teams (BLUFOR and Independent) are against each other. There are four player slots for BLUFOR (FIA) and one player slot for Independent (AAF) (every player has Curator access). The Independent player is permanently in Curator mode and doesn't have a character on the map and their editing zone is around their military base. The BLUFOR players can swap from Curator mode and character mode whenever they like and their editing zone follows their character around the map. The win condition for the BLUFOR team is to destroy the big military tower in Independent's base. The win condition for the Independent team is to kill all of the BLUFOR players.

     

    (I am still in the process of thinking about how points should be awarded to each team, I just want to get the basics of the mission working properly, then think about the other mechanics).

     

    So it's basically a Guerilla Warfare Zeus vs Zeus map.

     

     

    I have the win conditions working on the map, however, if I don't spawn BLUFOR with AI playing in the player slots, I can't test my code (because the game will just end with a win). When it's actually ready to be played, I need it so that players can join/leave the BLUFOR player slots and it won't affect the script which makes their Curator Editing Zone follow them around.

     

    Edit: In the editor, I am using the Curator Modules and linking them to the players. I am using the modules for both BLUFOR and Independent because for the Independent player, I want him to pick from the Independent side rather than going into the Zeus player slot which is added if you use the Curator Player Module.

     

    I am currently disabling the AI as a playable role for testing, but when I am ready to test with other players, I will disable the AI for players in the Multiplayer drop down in the Eden Editor.


  11. 34 minutes ago, sarogahtyp said:

    Thats what initPlayerLocal.sqf is for.

    Ok, so this is my initPlayerLocal.sqf

    Spoiler

    //initPlayerLocal.sqf

     

    [] spawn {

        while { alive BLUFOR_Player001 } do {

            if ( { _x distance2D BLUFOR_Player001 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR001_Curator removeCuratorEditingArea 1;

                    } else {

                        ZeusBLUFOR001_Curator addCuratorEditingArea [ 1, position BLUFOR_Player001, 40 ];

                        sleep 0.05;

                    };

            };

    };

     

    [] spawn {

        while { alive BLUFOR_Player002 } do {

            if ( { _x distance2D BLUFOR_Player002 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR002_Curator removeCuratorEditingArea 2;

                    } else {

                        ZeusBLUFOR002_Curator addCuratorEditingArea [ 2, position BLUFOR_Player002, 40 ];

                        sleep 0.05;

                    };

            };

    };

     

    [] spawn {

        while { alive BLUFOR_Player003 } do {

            if ( { _x distance2D BLUFOR_Player003 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR003_Curator removeCuratorEditingArea 3;

                    } else {

                        ZeusBLUFOR003_Curator addCuratorEditingArea [ 3, position BLUFOR_Player003, 40 ];

                        sleep 0.05;

                    };

            };

    };

     

    [] spawn {

        while { alive BLUFOR_Player004 } do {

            if ( { _x distance2D BLUFOR_Player004 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR004_Curator removeCuratorEditingArea 4;

                    } else {

                        ZeusBLUFOR004_Curator addCuratorEditingArea [ 4, position BLUFOR_Player004, 40 ];

                        sleep 0.05;

                    };

            };

    };

    I am still getting the same error regarding the other players who haven't joined the game yet.

     

    I am still not sure how to use this


  12. Hi all,

     

    I have created a short piece of code that makes the Curator Editing Area follow the Curator player around the map.

    Spoiler

    [] spawn {

        while { alive BLUFOR_Player001 } do {

            if ( { _x distance2D BLUFOR_Player001 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR001_Curator removeCuratorEditingArea 1;

                    } else {

                        ZeusBLUFOR001_Curator addCuratorEditingArea [ 1, position BLUFOR_Player001, 40 ];

                        sleep 0.05;

                    };

            };

    };

    I have four potential Curator players (BLUFOR_Player001 to BLUFOR_Player004) who all have the exact same code linked to them except for their names and Curator Editing Area code.

     

    Each of the four BLUFOR Curator players are not created on map initialisation. Instead, I wanted the player unit to be created when a player decides to play that role. I initially had my script in the init.sqf, however, when testing, I would get errors saying that the other BLUFOR Curators did not exist (because I was only playing as BLUFOR_Player001).

     

    What I am wondering is how/where do I place my script so that it is added to every new BLUFOR player when they join the game (It must be unique to them, see below).

    Spoiler

    [] spawn {

        while { alive BLUFOR_Player001 } do {

            if ( { _x distance2D BLUFOR_Player001 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR001_Curator removeCuratorEditingArea 1;

                    } else {

                        ZeusBLUFOR001_Curator addCuratorEditingArea [ 1, position BLUFOR_Player001, 40 ];

                        sleep 0.05;

                    };

            };

    };

    Spoiler

    [] spawn {

        while { alive BLUFOR_Player002 } do {

            if ( { _x distance2D BLUFOR_Player002 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR002_Curator removeCuratorEditingArea 2;

                    } else {

                        ZeusBLUFOR002_Curator addCuratorEditingArea [ 2, position BLUFOR_Player002, 40 ];

                        sleep 0.05;

                    };

            };

    };

    Spoiler

    [] spawn {

        while { alive BLUFOR_Player003 } do {

            if ( { _x distance2D BLUFOR_Player003 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR003_Curator removeCuratorEditingArea 3;

                    } else {

                        ZeusBLUFOR003_Curator addCuratorEditingArea [ 3, position BLUFOR_Player003, 40 ];

                        sleep 0.05;

                    };

            };

    };

    Spoiler

    [] spawn {

        while { alive BLUFOR_Player004 } do {

            if ( { _x distance2D BLUFOR_Player004 < 40 && side _x == independent } count allUnits != 0 ) then {

                ZeusBLUFOR004_Curator removeCuratorEditingArea 4;

                    } else {

                        ZeusBLUFOR004_Curator addCuratorEditingArea [ 4, position BLUFOR_Player004, 40 ];

                        sleep 0.05;

                    };

            };

    };

     


  13. On 6/6/2021 at 4:34 AM, pierremgi said:

    You could try that:
     

    
    {
      _x addEventHandler ["CuratorObjectSelectionChanged", {
        params ["_curator", "_entity"];
        if (side getAssignedCuratorUnit _curator != side _entity && side _entity != civilian) then {
          _curator removeCuratorEditableObjects [[_entity],true]
        } else {
          if !(_entity in curatorEditableObjects _curator) then {
            _curator addCuratorEditableObjects [[_entity],true]
          }
        };
      }];
    } forEach allCurators;

     

    Ok, so I took what you did here and expanded on it to get a pretty reliable script.

     

    Spoiler

    // Remove "things" from Curator when placed

     

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            if ( ( _entity isKindOf "Thing" ) ) then {

                _curator removeCuratorEditableObjects [ [ _entity ], true ];

                };

            }

        ];

    } forEach allCurators;




     

    // Add units to allied Curators or add empty "AllVehicles" to everyone

     

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            if ( ( ( side _entity ) == west ) ) then {

                ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _entity ], true ];

                };

            if ( ( ( side _entity ) == independent ) ) then {

                ZeusIndependent001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                };

            if ( ( ( side _entity ) == civilian ) && ( _entity isKindOf "AllVehicles" ) && !( _entity isKindOf "Man" ) ) then {

                ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusIndependent001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                };

            }

        ];

    } forEach allCurators;




     

    // Add "GetInMan" to all "Men" placed

     

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            {

                _entity addEventHandler [ "GetInMan", {

                    params [ "_unit", "_role", "_vehicle", "_turret" ];

                    if ( ( ( side _unit ) == west ) ) then {

                        ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusIndependent001_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                        };

                    if ( ( ( side _unit ) == independent ) ) then {

                        ZeusBLUFOR001_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR002_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR003_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR004_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusIndependent001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        };

                    }

                ];

            } forEach allUnits + vehicles;

            }

        ];

    } forEach allCurators;




     

    // Add "GetOutMan" to all "Men" placed

     

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            {

                _entity addEventHandler [ "GetOutMan", {

                    params [ "_unit", "_role", "_vehicle", "_turret" ];

                    if ( ( { alive _vehicle } count crew _vehicle == 0 ) ) then {

                        ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusIndependent001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        };

                    }

                ];

            } forEach allUnits + vehicles;

            }

        ];

    } forEach allCurators;




     

    // Add "GetOut" to all "AllVehicles" placed then add "GetInMan" and "GetOutMan" to all "Men" attachedObject

     

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            {

                _entity addEventHandler [ "GetOut", {

                    params [ "_vehicle", "_role", "_unit", "_turret" ];

                    {

                        _unit addEventHandler [ "GetInMan", {

                            params [ "_unit", "_role", "_vehicle", "_turret" ];

                            if ( ( ( side _unit ) == west ) ) then {

                                ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusIndependent001_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                                };

                            if ( ( ( side _unit ) == independent ) ) then {

                                ZeusBLUFOR001_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR002_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR003_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR004_Curator removeCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusIndependent001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                };

                            }

                        ];

                    } forEach allUnits + vehicles;

                    {

                        _unit addEventHandler [ "GetOutMan", {

                            params [ "_unit", "_role", "_vehicle", "_turret" ];

                            if ( ( { alive _vehicle } count crew _vehicle == 0 ) ) then {

                                ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                ZeusIndependent001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                                };

                            }

                        ];

                    } forEach allUnits + vehicles;

                    if ( ( { alive _vehicle } count crew _vehicle == 0 ) ) then {

                        ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        ZeusIndependent001_Curator addCuratorEditableObjects [ [ _vehicle ], true ];

                        };

                    }

                ];

            } forEach allUnits + vehicles;

            }

        ];

    } forEach allCurators;

     


  14. Spoiler

     

    17 hours ago, pierremgi said:

    The problem is curator unit (getAssignedCuratorUnit) is null (and side unknown) till a player choose to play the curator.

    If you place a playable unit named bob, then a curator module with bob as owner, you can work on curator (module) with the curator commands and EHs but not on the owner til he's played (can be at start or by JIP).

      Reveal hidden contents

    Furthermore, the owner variable (<logic module> getvariable "owner")  is not accessible by script because for safety reason (anticheat), BI decided to delete this variable once passed inside bis_fnc_moduleCurator.

    So no way to know the side of the owner before he is played....

     

    ... but one thing you can do, is to set an array, coupling [module,owner] along with you wrote in editor. For example:
    in init.sqf:
    private _curatorIds = [[curat1,ownr1], [curat2,ownr2],.....];  // where ownr1 is the unit owning the zeus module curat1....

    then:

    private _curatorWest = _curatorIds select {side (_x#1) == WEST} apply {_x#0};

     

    I couldn't get the array assignment working.

     

    I am a bit of a novice when it comes to coding, however, I found that this piece of code seems to be a pretty reliable substitute.

    Quote

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            if ( ( side getAssignedCuratorUnit _curator == west ) ) then {

                    ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                    ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _entity ], true ];

                    ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _entity ], true ];

                    ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _entity ], true ];

                }

            }

        ];

    } forEach allCurators;

     


  15. Quote

    {

        _x addEventHandler [ "CuratorObjectPlaced", {

            params [ "_curator", "_entity" ];

            if ( ( _entity in curatorEditableObjects ZeusBLUFOR001_Curator ) || ( _entity in curatorEditableObjects ZeusBLUFOR002_Curator ) || ( _entity in curatorEditableObjects ZeusBLUFOR003_Curator ) || ( _entity in curatorEditableObjects ZeusBLUFOR004_Curator ) ) then {

                ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _entity ], true ];

                ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _entity ], true ];

                }

            }

        ];

    } forEach allCurators;

    This script adds every unit placed, by one of the four BLUFOR Curators, to every BLUFOR Curator on the map.

     

    I was wondering how I would make it so that this script would add Curator-placed units to all allied Curators on the map. For example, if I had three teams, who are all enemies, (BLUFOR, OPFOR and Independent) and each team has three players (ZeusBLUFOR001_Curator for BLUFOR, ZeusOPFOR001_Curator for OPFOR and so on). How would I add these players to a "group" which can then be used in the above script to add each placed unit by one of the players to all their allies?

     

    Do I need to create three arrays and add the Curators (so if I plan to create or remove Curators, I can adjust appropriately), and if so, how?

     

    Something like:

     

    Array 1 - Curator_west

    Array 2 - Curator_east

    Array 3 - Curator_independent

     

    Then I was hoping I could write:

    Quote

            if ( ( _entity in curatorEditableObjects Curator_west ) || ( _entity in curatorEditableObjects Curator_east ) || ( _entity in curatorEditableObjects Curator_independent ) ) then {

    Then addCuratorEditableObjects to the Curators which are in their associated array (group).


  16. Spoiler
    
    if ( !isServer ) exitWith {};
    	while {true} do {
    		sleep 0.5;
    			{
    				if ( 
    					( { alive _x } count crew _x == 0 ) && ( _x isKindOf "AllVehicles" ) && !( _x isKindOf "Man" ) && ( alive _x ) ) then {
    					ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _x ], false ];
    					ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _x ], false ];
    					ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _x ], false ];
    					ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _x ], false ];
    					ZeusIndependent001_Curator addCuratorEditableObjects [ [ _x ], false ];
    					};
    				if ( ( ( side _x ) == west ) && ( _x call BIS_fnc_isCuratorEditable isEqualTo true ) && ( alive _x ) ) then {
    					ZeusBLUFOR001_Curator addCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR002_Curator addCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR003_Curator addCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR004_Curator addCuratorEditableObjects [ [ _x ], true ];
    					ZeusIndependent001_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					};
    				if ( ( ( side _x ) == independent ) && ( _x call BIS_fnc_isCuratorEditable isEqualTo true ) && ( alive _x ) ) then {
    					ZeusBLUFOR001_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR002_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR003_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR004_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusIndependent001_Curator addCuratorEditableObjects [ [ _x ], true ];
    					};
    				if ( ( !alive _x ) ) then {
    					ZeusBLUFOR001_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR002_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR003_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusBLUFOR004_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					ZeusIndependent001_Curator removeCuratorEditableObjects [ [ _x ], true ];
    					};
    		} foreach allUnits + vehicles;
    };

     

    So this script seems to be more or less working. I am just wondering if there is a better way of writing it.

    I was also wondering if there was a way to detect if a unit is editable by a certain Curator and give everyone on the said Curator's side the ability to also edit the unit. For example, if a BLUFOR Curator places a mine, I'd like to be able to give all other BLUFOR Curators access to the mine, while not allowing the Independent Curator access.


  17. On 6/7/2021 at 6:30 AM, mountjameson said:

    I do not quite understand your request, are you interested in how to do this through the code, or is it just an interesting question about the game? I will wait for an answer.

    I have attempted to do this through code, but it doesn't really work.

     

    Because there are probably hundreds of ways of doing what I want (some more efficiently some less), it would be useful to see another way of maybe writing the script.

     

    I am currently attempting to use a loop that checks the whole map for empty vehicles and adds them to all curators (no matter their side). I think I need another loop that then checks the map for vehicles which are no longer empty, and removes them from the curators which are not on the side of the now owned vehicle (e.g. BLUFOR curator orders a unit to enter an empty car, the car can no longer be edited by the Independent curator, and the marker on said unit disappears for the Independent curator).


  18. 11 hours ago, pierremgi said:

    You could try that:
     

    
    {
      _x addEventHandler ["CuratorObjectSelectionChanged", {
        params ["_curator", "_entity"];
        if (side getAssignedCuratorUnit _curator != side _entity && side _entity != civilian) then {
          _curator removeCuratorEditableObjects [[_entity],true]
        } else {
          if !(_entity in curatorEditableObjects _curator) then {
            _curator addCuratorEditableObjects [[_entity],true]
          }
        };
      }];
    } forEach allCurators;

     

    Gave this a try, it stops other players from moving entities around which are owned by the opposing team. However, they still appear on the Edit list, left of the screen, and can be told to dismount by the opposing team.

    The Zeus editor seems to have a problem with empty vehicles, civilian entities. It does not seem to register/follow the same custom of saying that all empty vehicles are civilian entities for some reason.


  19. In its simplest form, is to add/remove the ability for different curators to interact with man/unmanned vehicles.

     

    Let us say that the FIA player (BLUFOR) has placed a turret in the trees for an ambush on the AAF player (Independent). While the turret is controlled by the FIA player, the AAF player is unable to interact with it in curator mode. As soon as the FIA unit manning the turret dies (or is told to leave it), the turret can now be accessed by all curators on the map while they are in curator mode (e.g. moved, deleted…). If the AAF player decides that he wants to man the turret, while controlled by the AAF player, no other curator can interact with it while they are in curator mode.

     

    In simplest terms, an unmanned vehicle is shown to all curators with the yellow circle in-game. Once the vehicle’s ownership has changed, it no longer shows up to all curators until it is empty again.

    I have put together the start of the script, but my knowledge of scripting is limited (still learning really). Was wondering if anyone could give me a hand/advice?

     

    Quote

    //init.sqf

     

    if ( isServer ) then {

        [] spawn {

            while { true } do {

                {

                    _x addCuratorEditableObjects [ vehicles, false ];

                    sleep 0.5;

                } forEach allCurators;

            };

        };

    };

     

    if ( isServer ) exitWith{};

        [] spawn {

            while { true } do {

                sleep 0.5;

                    {

                        if ( side _x == independent ) then {

                            ZeusBLUFOR001_Curator removeCuratorEditableObjects [ [ _x ], true ];

                            ZeusBLUFOR002_Curator removeCuratorEditableObjects [ [ _x ], true ];

                            ZeusBLUFOR003_Curator removeCuratorEditableObjects [ [ _x ], true ];

                            ZeusBLUFOR004_Curator removeCuratorEditableObjects [ [ _x ], true ];

                        };

                    } foreach allUnits;

            };

    };

     

    if ( isServer ) exitWith{};

        [] spawn {

            while { true } do {

                sleep 0.5;

                    {

                        if ( side _x == west ) then {

                            ZeusIndependent001_Curator removeCuratorEditableObjects [ [ _x ], true ];

                        };

                    } foreach allUnits;

            };

    };

     


  20. 5 hours ago, 7erra said:

    Does this do what you want?

     

     

     

    I did some testing and have a system that seems to be working consistently.

     

    Quote

    Variable Name: Flag_001

    Init:

     

    Quote

    Variable Name: ZeusBLUFOR_T_Flag_CampTest

    Type: None

    Activation: BLUFOR

    Activation Type: Present

    Repeatable: "Check"
    Server Only: "Uncheck"

    Condition: this && (flagTexture Flag_001 == 'A3\Data_F\Flags\flag_AAF_CO.paa' || flagTexture Flag_001 == '')

    On Activation: 

    [      
     Flag_001,   
     "Capture",   
     "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\attack_ca.paa",   
     "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\attack_ca.paa",   
     "_this distance _target < 5 && side _this == west && (flagTexture _target == 'A3\Data_F\Flags\flag_AAF_CO.paa' || flagTexture _target == '')",   
     "_caller distance _target < 5 && side _this == west && (flagTexture _caller == 'A3\Data_F\Flags\flag_AAF_CO.paa' || flagTexture _caller == '')",   
     {},   
     {},   
     { _this call   
     {   
       Flag_001 setFlagTexture "A3\Data_F\Flags\flag_FIA_CO.paa";   
     };   
     },   
     {},   
     [],   
     2,   
     0,   
     true,   
     false   
    ] remoteExec ["BIS_fnc_holdActionAdd", 0, Flag_001];

     

    I would like to have the flag change effect which side owns the sector. I have done some capturing sector missions in the past, but they have always been captured using units, rather than taking a flag. I am not even sure if it is possible.

     

    I have also managed to link the curator edit zone to change owner depending on which flag is flying. I just can not do it for sectors.


  21. What I am trying to do is create a flag capturing system using the BIS_fnc_holdActionAdd.

     

    So I am currently testing to see if, while playing as an FIA BLUFOR unit, I can take an AAF flag down from a flagpole and swap it with an FIA flag. I am hoping I can get the animation of the flag coming down the pole, then once it has reached the bottom, swap with an FIA flag, then rise back up the pole, all while using the hold action button. If the unit lets go of the action button, the flag goes back to the top as if nothing has changed. If the flag is already an FIA flag, then the hold action button should not appear.

     

    This should be the same if I am playing an AFF Independent unit, except it is only FIA flags that can be captured.

     

    I currently have the hold action working, I am just not sure about how to use the BIS_fnc_animateFlag to move the flag down, swap it, then move it back up to the top.

     

    Quote

    Init: 


     this, 
     "Capture", 
     "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\attack_ca.paa", 
     "\a3\ui_f_oldman\data\IGUI\Cfg\holdactions\attack_ca.paa", 
     "_this distance _target < 5", 
     "_caller distance _target < 5", 
     {}, 
     {//Code executed on every progress tick, I am going to assume that the flag movement part will need to be entered here.}, 
     {// Code executed on completion}, 
     {// Code executed on interrupted, I am going to assume that I need something here to send the original flag back to its starting position here.}, 
     [], 
     2, 
     0, 
     true, 
     false 
    ] remoteExec ["BIS_fnc_holdActionAdd", 0, this];

     


  22. Done!
    This (Has not been tested in multiplayer) has had consistent success...

    Quote

    Zeus_T_ZoneRestriction%1
    Type: None

    Activation: Anybody

    Activation Type: Present

    Repeatable: "Check"
    Server Only: "Uncheck"

    Condition: this && round ( time %1 ) == 1
    On Activation:
    {
        if
     ( alive _x && [ _x ] call BIS_fnc_isCuratorEditable isEqualTo true ) then {
           
            _x setDamage 1;
        }
    } forEach thisList;

     


  23. Update to anyone who is interested.

    I have made some progress and have a trigger which differentiates between Curator editable units and none Curator editable units.

    Quote

    On Activation:

    {
        if ( alive _x && [ _x ] call BIS_fnc_isCuratorEditable isEqualTo true && _x in thisList ) then {
           
            _x setDamage 1;
        }
    } forEach allUnits;


    It currently does not seem to recognise Curator editable vehicles and will ignore them completely.

    Any advice would be very much appreciated!


  24. Does anyone have any idea how to use the function "BIS_fnc_isCuratorEditable" to kill curator editable units when they enter a trigger.

     

    I am trying to create a restriction zone around my map which kills the player and curator units when they enter the zone but will allow none curator units to pass through (so I can simulate reinforcements entering the region after a certain amount of time).

    I have been running some tests to get an idea on how the "BIS_fnc_isCuratorEditable" function works. I currently have four triggers around the map which tell me through a hint whether a unit is curator editable or not.

    Quote

    Zeus_T_ZoneRestriction%1
    Type: None

    Activation: Anybody

    Activation Type: Present

    Repeatable: "Check"
    Server Only: "Uncheck"

    Condition: this && round ( time %1 ) == 1
    On Activation: hint str ( { [ _x ] call BIS_fnc_isCuratorEditable } forEach thisList );


    I am now trying to work out how to change it from giving me a hint which is either true or false, to killing the unit if true or allow the unit through if false.

    Something along the lines of...

    Quote

    On Activation: { { [ _x ] call BIS_fnc_isCuratorEditable } forEach thisList; _x setDamage 1 } forEach thisList;


    Just can not seem to work it out.

    Also tried this to no avail...

    Quote

    On Activation:

    {
        if ( alive _x && [ _x ] call BIS_fnc_isCuratorEditable == true && _x in thisList ) then {
           
            _x setDamage 1;
        };
    } forEach allUnits;

     

×