Jump to content
HonzaVinCZ

setMarkerAlpha for one side

Recommended Posts

Hello, I'm working with editor placed markers and I need to set marker alpha to 1 just for BLUFOR when OPFOR enters trigger area and then to 0 when OPFOR leaves the area. I have done it by trigger but marker alpha is set to all players and that's what I don't want. I have script that sets the marker alpha for BLUFOR and OPFOR on the mission init, here it is:

if (!isDedicated) then 
{
{_x setMarkerAlphaLocal 0} forEach ["OMHQ_1M","BMHQ_1M","iedfacm_1","weapfacm_1","weapfacm_2","bluM_1","bluM_2","bluM_3","bluM_4","bluM_5","bluM_6","bluM_7","opfM_1","opfM_2","opfM_3","opfM_4","opfM_5","opfM_6","opfM_7","bluMZ_1"];
waitUntil {!isNull player};
switch (side player) do 
{
	case WEST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["BMHQ_1M","bluM_1","bluM_2","bluM_3","bluM_4","bluM_5","bluM_6","bluM_7","bluMZ_1"];
	};
	case EAST: 
	{
		{_x setMarkerAlphaLocal 1} forEach ["OMHQ_1M","opfM_1","opfM_2","opfM_3","opfM_4","opfM_5","opfM_6","opfM_7","iedfacm_1","weapfacm_1","weapfacm_2"];
	};
};
};

but it works only to markers that doesn't change their own alpha. Marker zone I want to make is called "bluMZ_1". 

Share this post


Link to post
Share on other sites

If you edited your markers, they are global. This way, you can't have local markers with local alpha.

You must createMarkerLocal , then always use the local commands like setMarkerAlphaLocal.

Share this post


Link to post
Share on other sites
4 minutes ago, pierremgi said:

If you edited your markers, they are global. This way, you can't have local markers with local alpha.

You must createMarkerLocal , then always use the local commands like setMarkerAlphaLocal.


I'm not sure how to create that local marker or more markers just for OPFOR, could you tell me please?  It's a mp mission so players are going to join and leave. 

Share this post


Link to post
Share on other sites

Follow the BIKI link. For positions, you can pick them on editor by a simple right click.

Share this post


Link to post
Share on other sites
6 minutes ago, pierremgi said:

Follow the BIKI link. For positions, you can pick them on editor by a simple right click.


Well, thank you. But I still don't know how to set that alpha just for one side. 

Share this post


Link to post
Share on other sites
6 hours ago, pierremgi said:

If you edited your markers, they are global. This way, you can't have local markers with local alpha.

You must createMarkerLocal , then always use the local commands like setMarkerAlphaLocal.

 

Not correct, you can adjust local alpha on editor markers.  To my understanding, all markers are local and the difference between createMarker and createMarkerLocal, and their other associated commands, is that the markerLocal commands won't propagate across the network, whereas the other command does propagate to all machines.

 

I just tested this to verify:

If you have two machines -

- Place a Blufor and Opfor unit on map, player and playable.  Name one unit bob and the other bill.

- Place two flag markers on map, "flag1" and "flag2".

- Place a Radio Alpha trigger, with OnActivation: if (player == bob) then {"flag1" setMarkerAlphaLocal 0;};

- Launch in multiplayer and join on both machines, go to map and view the markers.  Markers appear on both machines.

- Call the radio trigger.  Flag1 marker disappears on Bob's machine but not on Bill's machine.

 

7 hours ago, HonzaVinCZ said:

I need to set marker alpha to 1 just for BLUFOR when OPFOR enters trigger area and then to 0 when OPFOR leaves the area.

 

Check your trigger OnActivation and onDeactivation codes.

 

You probably want something like:

if (!isDedicated && hasInterface) then {if (side player == West && getMarkerType "bluMZ_1" != "") then {"bluMZ_1" setMarkerAlphaLocal 1;};};

 

and,

if (!isDedicated && hasInterface) then {if (side player == West && getMarkerType "bluMZ_1" != "") then {"bluMZ_1" setMarkerAlphaLocal 0;};};

 

  • Like 1

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

×