Jump to content
Sign in to follow this  
Redfist

Does anyone know how to hide markers from opposition in a PVP game.

Recommended Posts

Hi all,

Trying to make a pvp map and I would like to hide 1 side's markers from another. So, the enemy cannot know where friendly Mortars are etc.

Is it possible? :)

Share this post


Link to post
Share on other sites

Thanks guys, but I have no idea what to do with the information on those links. :(

Share this post


Link to post
Share on other sites

Then how are you creating the markers in the first place?

My answer is the command to use to create a marker that only a player (or players on a side, depends on your logic) can see rather than using createMarker which creates them globally.

shk's answer is the command you can use to make existing markers invisible to whoever.

Share this post


Link to post
Share on other sites

I thought markers aren't synchronized anyway, so a "global" marker can have its attributes changed locally?

Share this post


Link to post
Share on other sites
I thought markers aren't synchronized anyway, so a "global" marker can have its attributes changed locally?

Yep, that's what my suggestion is based on. Both commands will do the job, but changing alpha locally is IMHO easier as you can place all the markers in editor. If you create them locally you have to bother with positions etc in the script.

Anyway...

waituntil {!isNull player};
switch (side player) do {
 case EAST: {
   {_x setMarkerAlphaLocal 0} foreach ["markerWestMortar1","markerWestMortar12"];
 };
 case WEST: {
   {_x setMarkerAlphaLocal 0} foreach ["markerEastMortar1","markerEastMortar1"];
 };
};

If you are using the briefing template, you can just put those foreach lines into that.

Share this post


Link to post
Share on other sites

was hoping somebody could help me out, struggling with preventing markers to display for a specific side after I move them. (PVP format with side spawn & JIP)

I have 3 markers (6 total) for each team which display target locations.

Those are Destroy1,Destroy2,etc below.

Hiding them from the opposing team is working, until I move the markers into their new positions. They are moved into new positions because the target locations are selected by invisible Hs with large placement radius so it's random.

waitUntil { !isNull player };
waitUntil { player == player };
player createDiaryRecord["Diary", ["Known Issue", "Spetnaz - Do not issue any orders until you are on land from automatic dismount.  Once your team's three boats reach shore order all to disembarck."]];
player createDiaryRecord["Diary", ["Victory Conditions", "Intended use: PVP or COOP. USA (3 slots) vs Russia (3 slots).<br/>RUSSIA and USA: Recover documents in order locate the three main power generators and destroy them. The team which knocks out the power grid first will claim victory. If your team cannot find any documents, they may have to track the opposing team if at all possible."]];
player createDiaryRecord["Diary", ["Add-Ons Used", "@CBA;@ACE;@ACEX;@ACEX_SM;<br/>Bon's Advanced Artillery (Spetnaz Only)<br/>Bon's Touchbuddy (lftctrl)<br/>Kronzky's UPS Script"]];
player createDiaryRecord["Diary", ["Mission Summary - Utes Special Forces PVP", "The small island of Utes has fallen into political chaos. The United States and Russia have deployed Special Forces within the region. Two weeks ago Neo-Nationalists took control in an attempt to ransom off this mineral rich island to the highest bidder. Powerful armies now converge upon these thugs.<br/>The prize : which rich nation comes out the savior and starts drilling for oil."]];
switch (side player) do {
 case EAST: {
   {_x setMarkerAlphaLocal 0} foreach ["InsertionWest"];
 };
 case WEST: {
   {_x setMarkerAlphaLocal 0} foreach ["InsertionEast"];
	  };
};
switch (side player) do {
 case EAST: {
   {_x setMarkerAlphaLocal 0} foreach ["Destroy1","Destroy2","Destroy3"];
 };
 case WEST: {
   {_x setMarkerAlphaLocal 0} foreach ["Destroy4","Destroy5","Destroy6"];
	  };
};

player addEventHandler ["killed", 
{ 
	[] spawn {
		waitUntil { alive player };
		[] execVM "briefing.sqf";
}];

I just don't understand why after I set them to not appear and they weren't, that attributes would change even if I moved them.

Complete script nooblet so if there's anything wrong please let me know.

Share this post


Link to post
Share on other sites

Create all markers that are player-specific locally, aka createMarkerLocal and all its "friends". Then only the machine that created the marker will display it and move it. Keep in mind, though, that the client then needs to move all markers with a client-side script, you can't just move the marker on the server.

Share this post


Link to post
Share on other sites
Create all markers that are player-specific locally, aka createMarkerLocal and all its "friends". Then only the machine that created the marker will display it and move it. Keep in mind, though, that the client then needs to move all markers with a client-side script, you can't just move the marker on the server.

thanks for the advice, I appreciate it. I'm not really a scriptor, so I don't understand enough to where I can follow an explanation unless it has examples of code included unfortunately.

Can't I just make a script which would make the above code activate again when the markers are moved?

Within the init of the trigger that moves the markers:

null = [] execVM "scripts\markerdelete.sqf";

markerdelete.sqf

switch (side player) do {
 case EAST: {
   {_x setMarkerAlphaLocal 0} foreach ["Destroy1","Destroy2","Destroy3"];
 };
 case WEST: {
   {_x setMarkerAlphaLocal 0} foreach ["Destroy4","Destroy5","Destroy6"];
	  };
};

the problem I run into is not knowing if anything is working since I'm making it by myself but for multiplayer. So I wouldn't know if this is working for me.

Share this post


Link to post
Share on other sites

The problem in multiplayer is that you will get some trouble if you try mess with markers that were already created in the editor as it's the same marker for everyone, and some of the things you change about it will be changed for all machines (though not all of them).

Instead of creating the markers in the editors and then "deleting" them, just create them with createMarkerLocal only where they are needed (that is, where you would normally delete the EAST markers is where you should be creating the WEST markers instead).

The wiki's explanation of createMarkerLocal is rather straight-forward. Example would be:

createMarkerLocal ["mrkHQ1", getPos objHQ1];
"mrkHQ1" setMarkerShapeLocal "ICON";
"mrkHQ1" setMarkerTypeLocal "b_hq";
"mrkHQ1" setMarkerTextLocal "HQ";
"mrkHQ1" setMarkerColorLocal "COLORBLUE";

Of course all the other local marker manipulation commands do appear in the createMarkerLocal page at the botton (in "see also:")

Share this post


Link to post
Share on other sites
and some of the things you change about it will be changed for all machines (though not all of them).

Do you have any proof or example of that? I have hard time believing using local commands would update marker on other clients.

I doubt markers contain the info if they were created globally or locally. One hint for that is that their ID is just a string format name. Update range is determined by the used command. Once the client receives a command (local or global) it checks if a marker with given name exists and updates that. Thus, it doesn't matter how you create them, as long as you use local updates. That's just my guess, anyone is free to prove me wrong.

Share this post


Link to post
Share on other sites

I don't know exactly how it works, just that I had issues with some things that are updating globally for global markers when done in certain ways, and obviously the OP has ran into problems related to that. Using markers created locally with createMarkerLocal and then set their attributes with the other local commands solved it for me and will most likely solve it for him as well.

Your guess might work, may be worth trying, but I'm sure that my way works which is why I was suggesting it.

Share this post


Link to post
Share on other sites

I have kinda the same problem.

I have a PvP script.. I want to mark the US base with airfield with a marker. So the us side knows where "Main" is

Same for the East Side.. I want to mark the base and the airfield..

But then :) US should not see german and viceversa

Share this post


Link to post
Share on other sites

All you need is written in the posts above. So read and do it!

:p

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
Sign in to follow this  

×