Jump to content

Recommended Posts

Hi guys!

Is it possible to create the marker for current side ? Multiplayer mission

My idea:

1) Start mission: creating a markers ( like on the screenshot ) but for side west
2) When players from east in area of this markers, this markers will be change the color, but this color also change only for west side

General: All, what connected with this markers, will be change on west side, including creaton

Screen: https://ibb.co/6Z1RjJs

Share this post


Link to post
Share on other sites

So, you want these gray markers to only be visible by WEST, and when EAST enters the marker area(s), they change color to red?

Share this post


Link to post
Share on other sites

An easy way to do this:

 

Place your markers in the editor, making them whatever color you want for the "clear" state (probably black or grey). Name your markers appropriately. Set the markers' alpha to 0% (maybe do this after the next step.)

 

Place a trigger for each marker such that they cover the same area as their associated marker.

 

XhJn0hd.png

 

Set your triggers to detect OPFOR PRESENT, Repeatable, server only .

 

In each trigger's On Activation field:

"<markername>" setMarkerColor "ColorOPFOR";

Where "markername" is the name of the trigger's associated marker. Make sure the marker's name is in quotes.

 

In each trigger's On Deactivation field:

"markername" setMarkerColor "ColorGrey";

Marker color names can be found in the config name column here: https://community.bistudio.com/wiki/Arma_3:_CfgMarkerColors

 

When OPFOR enters a trigger, the associated marker will turn OPFOR red. When a trigger is clear of OPFOR, the associated marker will turn grey.

 

But the markers are still invisible! We can fix that by placing this little bit in initPlayerLocal.sqf:

private _markers = ["markername1","markername21","markername3","markername4"];
if (side player == west) then {
	{
		_x setMarkerAlpha 1
	} forEach _markers
};

Now, each marker is still invisible (alpha 0) for everyone except WEST.

 

You could do it the other way around (leave the markers visible in editor, then make them invisble for everyone but WEST at init) but then everyone will see the markers during the briefing stage.

Share this post


Link to post
Share on other sites
56 minutes ago, Harzach said:

An easy way to do this:

 

Place your markers in the editor, making them whatever color you want for the "clear" state (probably black or grey). Name your markers appropriately. Set the markers' alpha to 0% (maybe do this after the next step.)

 

Place a trigger for each marker such that they cover the same area as their associated marker.

 

XhJn0hd.png

 

Set your triggers to detect OPFOR PRESENT, Repeatable, server only .

 

In each trigger's On Activation field:


"<markername>" setMarkerColor "ColorOPFOR";

Where "markername" is the name of the trigger's associated marker. Make sure the marker's name is in quotes.

 

In each trigger's On Deactivation field:


"markername" setMarkerColor "ColorGrey";

Marker color names can be found in the config name column here: https://community.bistudio.com/wiki/Arma_3:_CfgMarkerColors

 

When OPFOR enters a trigger, the associated marker will turn OPFOR red. When a trigger is clear of OPFOR, the associated marker will turn grey.

 

But the markers are still invisible! We can fix that by placing this little bit in initPlayerLocal.sqf:


private _markers = ["markername1","markername21","markername3","markername4"];
if (side player == west) then {
	{
		_x setMarkerAlpha 1
	} forEach _markers
};

Now, each marker is still invisible (alpha 0) for everyone except WEST.

 

You could do it the other way around (leave the markers visible in editor, then make them invisble for everyone but WEST at init) but then everyone will see the markers during the briefing stage.

Works good!

Thank you so much 

Share this post


Link to post
Share on other sites
On 2/8/2024 at 10:14 PM, Harzach said:

An easy way to do this:

 

Place your markers in the editor, making them whatever color you want for the "clear" state (probably black or grey). Name your markers appropriately. Set the markers' alpha to 0% (maybe do this after the next step.)

 

Place a trigger for each marker such that they cover the same area as their associated marker.

 

XhJn0hd.png

 

Set your triggers to detect OPFOR PRESENT, Repeatable, server only .

 

In each trigger's On Activation field:


"<markername>" setMarkerColor "ColorOPFOR";

Where "markername" is the name of the trigger's associated marker. Make sure the marker's name is in quotes.

 

In each trigger's On Deactivation field:


"markername" setMarkerColor "ColorGrey";

Marker color names can be found in the config name column here: https://community.bistudio.com/wiki/Arma_3:_CfgMarkerColors

 

When OPFOR enters a trigger, the associated marker will turn OPFOR red. When a trigger is clear of OPFOR, the associated marker will turn grey.

 

But the markers are still invisible! We can fix that by placing this little bit in initPlayerLocal.sqf:


private _markers = ["markername1","markername21","markername3","markername4"];
if (side player == west) then {
	{
		_x setMarkerAlpha 1
	} forEach _markers
};

Now, each marker is still invisible (alpha 0) for everyone except WEST.

 

You could do it the other way around (leave the markers visible in editor, then make them invisble for everyone but WEST at init) but then everyone will see the markers during the briefing stage.

But a new problem has appeared. Markers are not displayed when loading in multiplayer. I think it's a matter of checking in initPlayerLocal.sqf

Share this post


Link to post
Share on other sites

I may have made a locality error - try unchecking the "server only" box on the triggers. You might also have to edit initPlayerLocal.sqf slightly, by changing setMarkerAlpha to setMarkerAlphaLocal.

 

Sorry, I'm in the process of moving, so I can't test anything.

Share this post


Link to post
Share on other sites
19 hours ago, Harzach said:

I may have made a locality error - try unchecking the "server only" box on the triggers. You might also have to edit initPlayerLocal.sqf slightly, by changing setMarkerAlpha to setMarkerAlphaLocal.

 

Sorry, I'm in the process of moving, so I can't test anything.

So, maybe code will explain better: 
Maybe I made a mistake
 

// markers.sqf
markerBaseBlufor_01 = createMarker ["AreaRightBlufor", [9729.871, 2655.475, 0]];
markerBaseBlufor_01 setMarkerSize [50, 1100];
markerBaseBlufor_01 setMarkerDir 30.062;

markerBaseBlufor_02 = createMarker ["AreaLeftBlufor",[9211.766, 2951.124, 0]];
markerBaseBlufor_02 setMarkerSize [50, 1100];
markerBaseBlufor_02 setMarkerDir 30.062;

markerBaseBlufor_03 = createMarker ["AreaTopBlufor",[9996.434, 3709.761, 0]];
markerBaseBlufor_03 setMarkerSize [50, 250];
markerBaseBlufor_03 setMarkerDir 119.965;

markerBaseBlufor_04 = createMarker ["AreaLowBlufor",[8946.033, 1892.538, 0]];
markerBaseBlufor_04 setMarkerSize [50, 250];
markerBaseBlufor_04 setMarkerDir 119.965;

markersArray = ["markerBaseBlufor_01", "markerBaseBlufor_02", "markerBaseBlufor_03", "markerBaseBlufor_04"];
{
    _x setMarkerType "";
    _x setMarkerShape "RECTANGLE";
    _x setMarkerColor "ColorBlack";
    _x setMarkerBrush "Solid";
    _x setMarkerAlpha 0;
    
} forEach markersArray;

// initPlayerLocal.sqf

_markersBlufor = ["markerBaseBlufor_01", "markerBaseBlufor_02", "markerBaseBlufor_03", "markerBaseBlufor_04"];



if(playerSide == west) then
{
    {
     _x setMarkerAlphaLocal 1;
    } forEach _markersBlufor;
};

 

Share this post


Link to post
Share on other sites

You haven't set a markerType/markerShape for any of your markers.

 

The strings in markersArray do not match the names of the markers you have created. You have used the script handles instead. 

 

Check your commands on the wiki for proper syntax. 

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

×