Jump to content

Recommended Posts

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;

        };

};

 

Share this post


Link to post
Share on other sites

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;

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
On 6/5/2021 at 6:15 AM, rkemsley said:

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 like this aussie online casino. 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?

 

 

 

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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

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

×