Jump to content
Sign in to follow this  
A-SUICIDAL

Don't show enemy on map?

Recommended Posts

Is there a way to be able to use your map, but have it so enemy do not appear on the map? For any skill level? It would be nice to be able to see players on same team on the map, as well as markers, but I would like it so the enemy do not appear on the map. Any help with this would be much appreciated.

Share this post


Link to post
Share on other sites

The server can be setup to allow that in it's configuration.

Share this post


Link to post
Share on other sites

No, not possible, at least not using extended map info, which is all or nothing. But extended info does simulate the knowledge your own squad have on the situation (but I only use it with AI due lack of communication skill), not everything else. There is Blue Force Tracking simulation used in some missions (using military markers) that is shared among groups, but this isn't something that is easily enabled by will (needs scripting).

Share this post


Link to post
Share on other sites

If you disable all markers on the server options or whtever, like CarlGustaffa mentioned.

You can paste this into the initline of any playable unit, or run it via a script in a foreach command for all player units.

it will create a marker with a dynamic name, and position it on the unit every 1 seconds until its dead, then its deleted.

you can add a respawned eventhandler and run the same code on the respawned unit to start it again if needed, but then you would need OA i think, not sure..

_null = this spawn {
waitUntil {isPlayer _this};
_mName = format["player_%1_marker",_this];
_marker = createMarker[_mName,[0,0]];
_marker setMarkerShape "ICON";
_marker setMarkerColor "ColorBlue";
_marker setMarkerType "DOT";

while {alive _this} do {
	_marker setMarkerPos (getPos _this);
	sleep 1;
};
deleteMarker _marker;
};

you can ofc change setMarkerType and setMarkerColor to whatever you want.

Share this post


Link to post
Share on other sites

Thanks, I will definitely try that. I actually have a marker that stays on the team leader all thru the mission using a simple loop script, but I thought it might be overkill to apply it to each player, plus I didn't know how to get it to show the actual player names. I am also using a revive script that marks players positions when they are incapacitated, and I kinda didn't want at those moments for incapacitated players to have 2 markers, unless I can make different color text and make sure the text overlaps accurately, then it would still kind of look like 1 marker, if that makes any sense.

When you mentioned "adding a respawned eventhandler and run the same code on the respawned unit to start it again", I'm not sure how to do that exactly. I do know that the Marker that I have for the leader stays on him until he dies and then returns to his position when he respawns, but if the leader left the game, I would imagine that the marker would remain in the game where he last died before he left the game. That's why your script seems to make better sense and also sounds more helpful to have actual player name markers since my leader marker just says "Leader".

Share this post


Link to post
Share on other sites

i did some more research into this, and came up with this:

_null = this spawn {
if (_this != player) exitWith {};
waitUntil {isPlayer _this};
_mName = format["player_%1_marker",_this];
_pName = format["%1",(name player)];
_marker = createMarker[_mName,[0,0]];
_mName setMarkerShape "ICON";
_mName setMarkerColor "ColorBlue";
_mName setMarkerType "DOT";
_mName setMarkerText _pName;

while {!isNull player} do {
	_mName setMarkerPos (getPos player);
	sleep 1;
	[b]if (!alive player) then {
		_mName setMarkerAlpha 0;
		waitUntil {alive player};
		_mName setMarkerAlpha 1;
	};[/b]
};
deleteMarker _mName;
};

Note: the higlighted text will hide the marker when player is dead, and show the marker again when the player have respawned (he is alive), delete the whole highlighted area and the marker will stay visible on the dead bodu until player has respawned, then it will go to player.

this could be useful for locating corpse of player etc...

also i checked some of the commands and they are global, so i tweaked the snippet and added player name text on marker to be shown on map.

Only tested on client(own pc) in multiplayer with respawn, but i asume it shall work for all in a dedi server setting.

also should be JIP compatible since marker is deleted when player leaves the game and the snippet will be run on any eventual new players that join since its in init field of unit.

Share this post


Link to post
Share on other sites

I have so much stuff in each players init already they're all about to pop, lol.

You mentioned...

"run it via a script in a foreach command for all player units".

Can you show me how to do this? Sounds simple the way you explained it, but I don't know how to do it.

---------- Post added at 08:46 AM ---------- Previous post was at 08:43 AM ----------

I was using this for just the leader, but now I want to add it to 13 other playables.

Share this post


Link to post
Share on other sites

Untested but should work in theory, the how is:

1: whenever a player joins a game, he runs the init.sqf for all playableUnits.

2: if a marker with player name is not present(isNil), he willl create one, else do nothing.

3: once he leaves game, marker is deleted and the the marker name is removed again(set to nil).

place this in your init.sqf.

	_null = playableUnits execVM "trackPlayers.sqf";

save this as trackPlayers.sqf and place in your mission folder.

	
{
waitUntil {isPlayer _x};
if (_x != player) exitWith {};
_mName = format["player_%1_marker",_x];
_pName = format["%1",(name player)];
if (isNil (_mName)) then {
	_marker = createMarker[_mName,[0,0]];
	_mName setMarkerShape "ICON";
	_mName setMarkerColor "ColorBlue";
	_mName setMarkerType "DOT";
	_mName setMarkerText _pName;

	while {!isNull player} do {
		_mName setMarkerPos (getPos player);
		sleep 1;
		if (!alive player) then {
			_mName setMarkerAlpha 0;
			waitUntil {alive player};
			_mName setMarkerAlpha 1;
		};
	};
	deleteMarker _mName;
	_mName = nil;
};
} foreach _this;

Edited by Demonized
corrected misplaced _this to _x

Share this post


Link to post
Share on other sites

I'm not sure if I'm doing something wrong, it's not working for me yet.

Share this post


Link to post
Share on other sites

there was a misplaced _this instead of a _x in the markernamepart.

maybe that was the issue, previous post fixed.

if not try this, small change same effects.

Untested but should work in theory, the how is:

1: whenever a player joins a game, he runs the init.sqf for all playableUnits.

2: if a marker with player name is not present(isNil), he willl create one, else do nothing.

3: once he leaves game, marker is deleted and the the marker name is removed again(set to nil).

place this in your init.sqf.

_null = player execVM "trackPlayers.sqf";

save this as trackPlayers.sqf and place in your mission folder.

	
waitUntil {!isNull player};
if (_this != player) exitWith {};
_mName = format["player_%1_marker",_this];
_pName = format["%1",(name player)];
if (isNil (_mName)) then {
_marker = createMarker[_mName,[0,0]];
_mName setMarkerShape "ICON";
_mName setMarkerColor "ColorBlue";
_mName setMarkerType "DOT";
_mName setMarkerText _pName;

while {!isNull player} do {
	_mName setMarkerPos (getPos player);
	sleep 1;
	if (!alive player) then {
		_mName setMarkerAlpha 0;
		waitUntil {alive player};
		_mName setMarkerAlpha 1;
	};
};
deleteMarker _mName;
_mName = nil;
};

Share this post


Link to post
Share on other sites

It's working perfectly. I think that was the last thing on my checklist, except for the paa mission start pic I now need to make. Thanks again Demonized ;)

Share this post


Link to post
Share on other sites

I had 1 bug when I tested in multiplayer. I had AI disabled in the description.ext. I tested with a friend and he was playing as an AT specialist and then my friend went back to the lobby to choose a different player and came back as a sniper, then I noticed that an AI had taken his place when he left to got to the lobby and on the map, both the AI and my friend had the same marker name. So the real problem I am having is... how do I get the AI to stay out of the mission and not take the place of players that leave?

Share this post


Link to post
Share on other sites

Strange, i thought disableAI in description.ext would remove all non player ai from playableUnits.

try putting this in the while code:

if (!isPlayer _this) exitWith {};

now have your friend do the same and the marker should be deleted.

Edited by Demonized

Share this post


Link to post
Share on other sites

omg I've been trying to figure out why my AI keep taking the place of players that leave or join back in another slot when I have the mission set as disableAI = 1;

After several more attempts to fix this, I noticed that in my description.ext file the line said disabledAI = 1;

I have no idea how the "d" got in there, or how long it's been in there. This problem only started to occur like a week ago. It never gave me any errors and the AI were disabled at mission start without having to click the button to turn them off. I feel like my computer has gremlins.

Share this post


Link to post
Share on other sites

No, it is supposed to have a "d" in it. For a moment I got it confused with the other kind of disable, like when you disable their movement:

s1 disableAI "MOVE";

So my problem still exists.

My description says:

disabledAI = 1;

and yet when players leave the server an AI takes their spot. It's driving me crazy. lol. This never used to happen.

Share this post


Link to post
Share on other sites

oh, I changed the the icon from "dot" to "mil_start" and set the size to 0.5 and also added a setMarkerDir of the player. Now it shows the players direction on the map, which is actually kind of helpful at times.

waitUntil {!isNull player};
if (_this != player) exitWith {};
if (!isPlayer _this) exitWith {};
_mName = format["player_%1_marker",_this];
_pName = format["%1",(name player)];
if (isNil (_mName)) then {
_marker = createMarker[_mName,[0,0]];
_mName setMarkerShape "ICON";
_mName setMarkerSize [0.5, 0.5];
_mName setMarkerColor "ColorBlue";
_mName setMarkerType "mil_start";
_mName setMarkerText _pName;

while {!isNull player} do {
	_mName setMarkerPos (getPos player);
	_mName setMarkerDir (direction player);
	sleep 1;
	if (!alive player) then {
		_mName setMarkerAlpha 0;
		waitUntil {alive player};
		_mName setMarkerAlpha 1;
	};
};
deleteMarker _mName;
_mName = nil;
};

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

I had a friend in my server that kept aborting to lobby to pick a different player slot and rejoin the battle. A little later when I was looking at the map I noticed that there were like 4 markers on the map that showed his name and only one of the markers was moving around on the map, the rest were left behind from the moment he died and decided to abort to lobby and pick a different player. There was also another marker left behind from another friend that left the game suddenly to go eat dinner.

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  

×