Jump to content
weaponsfree

Markers only visible to one Side

Recommended Posts

So I'm losing my mind a little here. Been trying to get a marker to be visible only for civilian side. You'd think this would be an editor tick box kind of thing, but apparently it takes a degree in trigonometry (or intimate knowledge of Arma scripting which I don't have).

 

The three main solutions I've been playing around with are init.sqf scripts from these threads :
 

 

Haven't been able to make it work. Any help in finding the simplest possible solution would be much appreciated

 

 

 

 

Share this post


Link to post
Share on other sites

Are you talking about scripted or editor placed markers?

For editor placed markers you could simply run this in the initplayerlocal.sqf:

 

if (side player != civilian) {{deleteMarkerLocal _x} forEach allMapMarkers};

Not tested but should do the trick.

There might be a simpler editor specific solution but I wouldn't know since I barely use the editor functions, heh.

 

Cheers

Share this post


Link to post
Share on other sites

putting something like this in your init should work.

Then just add prefixes to the names of your markers depending on which side they should be visible for. All other markers will be visible to everyone.

 

CIV_mymarker

[] spawn {
    while { !isDedicated } do {
        waitUntil { sleep 1; alive player};
        {
            _arr = _x splitString "_";
            _pre = _arr select 0;
            if (_pre in ["WEST","EAST","GUER","CIV"]) then {
                if (format["%1",side player] == _pre) then {
                    _x setMarkerAlphaLocal 1;
                } else {
                    _x setMarkerAlphaLocal 0;
                };
            };
            
        } count allMapMarkers;
    };
};

 

  • Like 3

Share this post


Link to post
Share on other sites

Thanks for the quick reply Grumpy Old Man.

 

This is for editor placed markers. I have 1 marker placed, "marker_rally1" that needs to be seen only by civilian side. A bunch of other ones need to remain visible by all sides.

 

I think your line would delete all markers for non civilian units no?

EDIT: So maybe something like this?

if (side player != civilian) {deleteMarkerLocal marker_rally1};

EDIT 2 :
Trying some setMarkerAlphaLocal stuff too :
 

if (side player != civilian) {{"marker_rally1" setMarkerAlphaLocal 0;}};

 

To no effect (sorry for scripting nonsense, still quite green at it)

Share this post


Link to post
Share on other sites


@Tajin Thanks for the tip. Trying it out. I get a "missing ;" error when trying it. Any idea where that could be coming from?

My entire init.sqf looks like :
 

Spoiler

execVM "briefing.sqf";
waitUntil { !isNull player }; // Wait for player to initialize
rearm1 attachTo [rally1,[0,0,0]] ;
"CIV_marker_rally1" setMarkerPos getPos rally1;
"marker_target1" setMarkerPos getPos target1;

spawn {
    while { !isDedicated } do {
        waitUntil { sleep 1; alive player};
        {
            _arr = _x splitString "_";
            _pre = _arr select 0;
            if (_pre in ["WEST","EAST","GUER","CIV"]) then {
                if (format["%1",side player] == _pre) then {
                    _x setMarkerAlphaLocal 1;
                } else {
                    _x setMarkerAlphaLocal 0;
                };
            };
            
        } count allMapMarkers;
    };
};

 

 

Share this post


Link to post
Share on other sites

@pierremgi That was exactly it. Thank you!

 

So if anyone is curious :

 

In your init.sqf :

[] spawn {
    while { !isDedicated } do {
        waitUntil { sleep 1; alive player};
        {
            _arr = _x splitString "_";
            _pre = _arr select 0;
            if (_pre in ["WEST","EAST","GUER","CIV"]) then {
                if (format["%1",side player] == _pre) then {
                    _x setMarkerAlphaLocal 1;
                } else {
                    _x setMarkerAlphaLocal 0;
                };
            };
            
        } count allMapMarkers;
    };
};

 

And add the WEST, EAST, GUER, CIV, prefix to the markers you want to be visible only to that side.

Thanks  @Tajinmuch appreciated

  • Like 1

Share this post


Link to post
Share on other sites

Using the code from this post in init.sqf does make the markers visible only to the side they belong to when the mission is running. When you are in the initial briefing window, all sides can still see all map markers. Then when we click continue from initial briefing screen and enter the mission for the first time, the markers are only visible to the side they belong to. This is an issue only when seeing the opposing force's markers gives away intel or spoils the mission. Can anyone help with a method to segrate the markers at the initial briefing screen? Thanks. 

Share this post


Link to post
Share on other sites

create them locally (createMarkerLocal) in the initPlayerLocal.sqf, after waitUntil {getClientStateNumber > 9};

Share this post


Link to post
Share on other sites

Just to be sure here.

 

initPlayerLocal.sqf:

(createMarkerLocal) after waitUntil {getClientStateNumber > 9};

This does not make sense. But is this correct @pierremgi?

 

I have 2 markers placed with 3Eden and one for WEST HQ and one for EAST HQ. 

And ofc I do not want the Enemy force to see Friendly Marker.

 

Greenboy Cheering.

Share this post


Link to post
Share on other sites

It's not a code.

initPlayerLocal.sqf is a good place to run a code when player reaches the game.

waitUntil {getClientStateNumber >9}; is nothing else than waiting for the end  of briefing and ready to play, so the marker is not present during briefing.

The createMarkerLocal stays local, so not broadcast on other PCs but you need to use ALL marker command in their local version (setMarker...Local).

For more sense, have good readings.

Share this post


Link to post
Share on other sites

Use this in a txt file

{
    _x setMarkerAlphaLocal 0
} count (allMapMarkers select {
    private _marker = _x;
    !([east,west,civilian,resistance] select {_marker find toLower str _x != -1} isEqualTo []) &&
    {
        _x find toLower str playerSide == -1
    }
});

Save that as markers_side.sqf in you mission/scenario  folder

 

When you put a marker on the map use a prefix that fixes who can see it. east west guerilla civilian. Such as

east_marker_1.

 

Never made the civ or guerilla markers so  I do not know if you can abbreviate them to guer and civ or not.

 

In your init.sqf you put this

 

execVM "markers_side.sqf";

 

I cannot see the other sides markers at anytime using that. Oh wait, I never make briefings so maybe it can be seen there.

 

Edit: went and tested guer and civ work.

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

×