wontial 10 Posted August 3, 2011 (edited) I'm trying to make a mission where there are several groups, and I am implementing a script called 'marker.sqf' that displays a dot and player name on map, as shown below. waituntil {(alive player)}; _unit = player; _nameP = name _unit; _markerobjp = createMarker [_namep,[0,0]]; _markerobjp setMarkerShape "ICON"; _markerobjp setMarkerType "mil_dot"; _markerobjp setMarkerColor "ColorGreen"; _markerobjp setMarkerText _nameP; _markerobjp setMarkerSize [1,1]; while {alive _unit} do { _markerobjp setmarkerdir (getdir _unit); _markerobjp setMarkerPos (getPos _unit); _markerobjp setMarkerText _nameP; sleep 1; }; deleteMarker _markerobjp; [] execVM "marker.sqf"; exit; Currently every players' marker appear on the map. I would like to change it so that the person belonging to a group can see only their group player's markers and hide any markers that are not in their group. So, for example Player1 in 'ALPHA' group can see markers of player2, and player3 that are in the same group, but can't see the marker of player4 who are in 'BRAVO' group. Hoping for some solutions. Thanks in advance~! --- I've made a mistake in the threat title - should've been marker instead of maker. Is there anyway to change it? I'm not really used to these forums...I can't even seem to delete my thread...hm... Edited August 3, 2011 by wontial Share this post Link to post Share on other sites
kylania 568 Posted August 3, 2011 (edited) Add local to all your marker commands. waituntil {(alive player)}; _unit = player; _nameP = name _unit; _markerobjp = createMarkerLocal [_namep,[0,0]]; _markerobjp setMarkerShapeLocal "ICON"; _markerobjp setMarkerTypeLocal "mil_dot"; _markerobjp setMarkerColorLocal "ColorGreen"; _markerobjp setMarkerTextLocal _nameP; _markerobjp setMarkerSizeLocal [1,1]; while {alive _unit} do { _markerobjp setmarkerdirLocal (getdir _unit); _markerobjp setMarkerPosLocal (getPos _unit); _markerobjp setMarkerTextLocal _nameP; sleep 1; }; deleteMarkerLocal _markerobjp; [] execVM "marker.sqf"; Don't need "exit;" that's an SQS command - it does nothing in SQF. You'd want to loop the marker creation code for each member of their group too. Or just make one for current group leader. Or just use STHud. :) Edited August 3, 2011 by kylania Share this post Link to post Share on other sites
wontial 10 Posted August 3, 2011 Wow, that was really quick! Thank you for the help kylania! But I'm not sure I understand what you mean by making a loop for the marker creation code. Do you mean in the sense that it should be looped in certain time intervals so that the marker appears on the map as the player moves?? Because when I run this script in int.sqf it seems to attach to players as they move automatically. Share this post Link to post Share on other sites
kylania 568 Posted August 3, 2011 Well, your code as written just puts a marker on the player himself, as you noticed. You could change it to put it on the group leader of the player's group instead very easily so you can track the group "as a whole". Putting it on each unit in a group though might get messy, especially since you probably will already see them on the map anyway. :) So, did you want the marker on the player, the player's group leader or really all members of the group? Share this post Link to post Share on other sites
wontial 10 Posted August 3, 2011 Hm...I didn't think about that before, but hearing from you now I think you're right. It would be much neater and less messy if I have the marker on the leader only. So yeah, I think having the marker on the group leader would be nice. :) Share this post Link to post Share on other sites
kylania 568 Posted August 3, 2011 Just need 1 word extra. ;) waituntil {(alive player)}; _unit = leader player; _nameP = name _unit; _markerobjp = createMarkerLocal [_namep,[0,0]]; _markerobjp setMarkerShapeLocal "ICON"; _markerobjp setMarkerTypeLocal "mil_dot"; _markerobjp setMarkerColorLocal "ColorGreen"; _markerobjp setMarkerTextLocal _nameP; _markerobjp setMarkerSizeLocal [1,1]; while {alive _unit} do { _markerobjp setmarkerdirLocal (getdir _unit); _markerobjp setMarkerPosLocal (getPos _unit); _markerobjp setMarkerTextLocal _nameP; sleep 1; }; deleteMarkerLocal _markerobjp; [] execVM "marker.sqf"; Share this post Link to post Share on other sites
wontial 10 Posted August 3, 2011 GREEAAT. Thanks again, its been a big help! Share this post Link to post Share on other sites