need help with Zeus

  1. 8 years ago
    Edited 8 years ago by maquez [Q-Net]

    hello,

    I am the head developer of this mission: ALiVE RHS | Cold War

    I need help with Zeus, the mission has for each faction a Zeus and my goal is to make the Zeus faction sided so that he can see and edit units only from his own faction.

    Chaotic BI wiki is not really very help full and more a pain. Researches on google also gave me no real results.
    I would be really very thank full if anybody could help me with this.

    kind regards
    maquez [Q-Net]

  2. So basically you need to have units that are spawned by ALiVE added to the curator editable objects for each side?

    Probably an event handler that on group spawn will add the group to the appropriate side using addCuratorEditableObjects

  3. ALIVE should be doing that already ^. I think he wants only units of one side being added as curator editable objects. In that case you would still run an EH but instead remove the unit from being editable if they are of a certain side.

  4. If it's possible, I would like to know it too. I tried to remove units of a different side from zeus' interface by adding, using one of your useful script snippets inside your wiki, a script inside the init of all units spawned by alive, which checks if a unit is in another side and, if true, removes it using removecuratoreditableobject (if {side _this == east} then (code ...)). Unfortunately, it does not work; maybe because of another script used by the mod to add, instead, all units to the zeus interface?

  5. Edited 8 years ago by dixon13

    description.ext

    #define QUOTE(var1) #var1
    class Extended_Init_EventHandlers { 
        class CAManBase { 
     		serverInit = QUOTE(_this call compile preprocessFileLineNumbers 'fnc_handleUnit.sqf'); 
        }; 
    }; 

    fnc_handleUnit.sqf

    params [["_unit",objNull]];
    curatorModule removeCuratorEditableObjects [[_unit],true];

    ^In the above code, change the variable "curatorModule" to the name of the Zeus module in your mission. Easy way to do this would be to name the Zeus module in the editor. That name would be what would replace the variable "curatorModule".

    *Note: The command, "removeCuratorEditableObjects", has to be ran on the server, hence why in the description.ext, the init for the XEH is "serverInit".

  6. Firstly, thank you very much for your support, Dixon!
    Secondly (unfortunately) I'm testing your code right now, and it seems it doesn't work. Sorry for my ignorance, but I don't understand how it could check units' side.. do I have to complete it?

  7. @Legend117 whoops forgot about that part. As soon as I am done with this customer at work, I will update the script.

  8. Where are your priorities, Dixon? ARMA first! :)

  9. Edited 8 years ago by Legend117

    Thank you again, you're very kind! If it's not too much to ask, is it also possible through your script to make it working with more than one zeus module (for example, a blufor zeus which needs hidden opfor and indfor units, and an opfor zeus which needs hidden blufor and indfor units)?

  10. fnc_handleUnit.sqf

    params [["_unit",objNull]];
    if (side _unit == EAST) then {
        curatorModule removeCuratorEditableObjects [[_unit],true];
    };
  11. Edited 8 years ago by maquez [Q-Net]

    wow, thank you very much! Will try this.

    I have only few questions still remaining regarding "fnc_handleUnit.sqf".
    I have three factions in my mission with a Zeus module for each side named:

    "z_west", "z_east" and "z_guer"

    so how do I need edit the "fnc_handleUnit.sqf" script that it does handle all three factions?

    what I did try to script myself so far is follow:

    description.ext

    #define QUOTE(var1) #var1
    class Extended_Init_EventHandlers { 
        class CAManBase { 
     		serverInit = QUOTE(_this call compile preprocessFileLineNumbers 'fnc_handleUnitWest.sqf,fnc_handleUnitEast.sqf,fnc_handleUnitGuer.sqf');
        }; 
    };

    fnc_handleUnitWest.sqf

    params [["_unit",objNull]];
    if (side _unit == EAST) then {
        z_west removeCuratorEditableObjects [[_unit],true];
    };
    if (side _unit == RESISTANCE) then {
        z_west removeCuratorEditableObjects [[_unit],true];
    };

    fnc_handleUnitEast.sqf

    params [["_unit",objNull]];
    if (side _unit == WEST) then {
        z_east removeCuratorEditableObjects [[_unit],true];
    };
    if (side _unit == RESISTANCE) then {
        z_east removeCuratorEditableObjects [[_unit],true];
    };

    fnc_handleUnitGuer.sqf

    params [["_unit",objNull]];
    if (side _unit == WEST) then {
        z_guer removeCuratorEditableObjects [[_unit],true];
    };
    if (side _unit == EAST) then {
        z_guer removeCuratorEditableObjects [[_unit],true];
    };

    could you have a look at this and tell me if I scripted bullshit
    and if answer is yes, correct what I did wrong?

    had no time to test what I scripted...

    thanks in advance
    maquez [Q-Net]

  12. Cleaned up your code and everything is in one file.

    description.ext

    #define QUOTE(var1) #var1
    class Extended_Init_EventHandlers { 
        class CAManBase { 
     		serverInit = QUOTE(_this call compile preprocessFileLineNumbers 'fnc_handleUnit.sqf'); 
        }; 
    }; 

    fnc_handleUnit.sqf

    params [["_unit",objNull]];
    switch (side _unit) do {
        case WEST: {
            z_east removeCuratorEditableObjects [[_unit],true];
            z_guer removeCuratorEditableObjects [[_unit],true];
        };
        case EAST: {
            z_west removeCuratorEditableObjects [[_unit],true];
            z_guer removeCuratorEditableObjects [[_unit],true];
        };
        case RESISTANCE: {
            z_west removeCuratorEditableObjects [[_unit],true];
            z_guer removeCuratorEditableObjects [[_unit],true];
        };
        default { diag_log format ["fnc_handleUnit: Side is civilian. No objects were removed for the curator."]; };
    };
  13. Deleted 8 years ago by maquez [Q-Net]
  14. Edited 8 years ago by maquez [Q-Net]

    I did test it in editor and on dedicated, it did not work I was still able to edit and see all sides.

    may I have to explain better my goals:
    my mission is a TVT/PVP mission with three playable Zeus and my goal is to remove
    the editable objects and visible units of the opposite sides for each zeus.

    z_west: should be able only to edit WEST objects, RESISTANCE and EAST should be invisible, not editable
    z_east: should be able only to edit EAST objects, RESISTANCE and WEST should be invisible, not editable
    z_guer: should be able only to edit RESISTANCE objects, EAST and WEST should be invisible, not editable

    z_west is synced to squad leader WEST
    z_east is synced to squad leader EAST
    z_guer is synced to squad leader RESISTANCE

    all three zeus are playable at the same time by different players (TVT/PVP mission)

    damn, sorry my english... not my native language hope you can understand

    kind regards
    maquez [Q-Net]

  15. I tested it too, and I'm sorry to confirm it doesn't work, unfortunately ..

  16. Can anyone else chime in on this. I'm at work and can't test, unless I install Arma on this computer lols.

  17. Edited 8 years ago by maquez [Q-Net]

    I enabled functions logging to rpt during testing script.
    The function does not get loaded if this help.

    I would really appreciate any help I'm out of ideas and BI wiki is a bad joke instead of any use full information.

  18. Edited 8 years ago by maquez [Q-Net]

    another try...
    script seems to work at least
    I can see and edit every freaking stuff of mission
    but still I can edit and see enemy sides, damn this drives me soon crazy...

    please anyone can have a look at this and help me?

    I soon get headaches and a big hate on BI wiki,
    most useless crap I ever seen.

    init.sqf

    if (isServer) then {
    [] execVM "zeus.sqf";
    }; 

    zeus.sqf

    if (!isServer) exitWith{};
    
    sleep 60;
    {
    	z_west addCuratorEditableObjects [[_x],true];
    	z_east addCuratorEditableObjects [[_x],true];
    	z_guer addCuratorEditableObjects [[_x],true];
    } foreach (allMissionObjects "All");
    
    while {true} do {
          sleep 30; {
    	    if ((side _x) == west || (side _x) == east || (side _x) == independent) then {
    			z_west addCuratorEditableObjects [[_x],true];
    			z_east addCuratorEditableObjects [[_x],true];
    			z_guer addCuratorEditableObjects [[_x],true];
    	     };
           }foreach allUnits;
    };	
    
    case WEST: {
    	if ((side _x) == east || (side _x) == resistance) then {
    		z_west removeCuratorEditableObjects [[_x],true];
    	};
    };
    case EAST: {	
    	if ((side _x) == west || (side _x) == resistance) then {
    		z_east removeCuratorEditableObjects [[_x],true];
    	};
    };
    case RESISTANCE: {	
    	if ((side _x) == west || (side _x) == east) then {	
    		z_guer removeCuratorEditableObjects [[_x],true];	
    	};
    };

    link to BI forum where the code is better readable: BI Forum

    kind regards
    maquez [Q-Net]

  19. Edited 8 years ago by maquez [Q-Net]

    problem solved

    a special thank towards all those that helped me in this case

    specially to mention are belbo and spyderblack723 for outstanding help

  20. Edited 8 years ago by dixon13

    Glad you figured it out @maquez Q-Net. Could you please post your solution as well for future reference if someone is browsing and stumbles across this forum post.

  21. Newer ›
 

or Sign Up to reply!