Jump to content
WaIdoZ

how to call area marker

Recommended Posts

I need help i am trying to make it where when a player step in a marker that has a trigger and when that trigger active it will replace the marker that has a trigger into a regular marker. I just dont know how to make it where the marker doesnt get called until the trigger is activate. i am still fresh with the sqf coding.

 

_trigArray = [

    [5782.864,10333.795],
    [12895.979,7353.194],
    [5517.676,9951.941],
    [1809.986,11952.15],
    [3051.818,11187.059],
    [9556.457,13465.348],
    [13416.808,12078.425],
    [8621.35,10250.979],
    [11852.628,2528.827],
    [11295.57,5227.608],
    [5482.726,4058.376],
    [7383.236,8253.998],
    [7910.444,7686.77]
    
];


_randomLA = selectRandom _trigArray;


nextA = createMarker 
    ["marker2", _randomLA];
    nextA setMarkerShape "ELLIPSE";
    "marker2" setMarkerColor "Colorred";
    "marker2" setMarkerSize [500, 500];
    "marker2" setMarkerBrush "SOLID";
    

_trg = createTrigger ["EmptyDetector", _randomLA];

_trg setTriggerArea [500, 500, 0, false];

_trg setTriggerActivation ["ANYPLAYER", "PRESENT", true];

_trg setTriggerStatements 
[
  "this",                
  "bob, deleteMarker nextA",        
  ""                    
];

bob = createMarker 
    ["marker1", _randomLA];
    bob setMarkerShape "ELLIPSE";
    "marker1" setMarkerColor "Colorblack";
    "marker1" setMarkerSize [500, 500];
    "marker1" setMarkerBrush "SOLID";

Share this post


Link to post
Share on other sites

You are recreating the same marker. Why?  You can just change the existing one. That's what commands like setMarkerColor are for.

 

_trigArray = [
	[5782.864,10333.795],
	[12895.979,7353.194],
	[5517.676,9951.941],
	[1809.986,11952.15],
	[3051.818,11187.059],
	[9556.457,13465.348],
	[13416.808,12078.425],
	[8621.35,10250.979],
	[11852.628,2528.827],
	[11295.57,5227.608],
	[5482.726,4058.376],
	[7383.236,8253.998],
	[7910.444,7686.77]
];

_randomLA = selectRandom _trigArray;
_mrk = createMarker ["marker1", _randomLA];
"marker1" setMarkerShape "ELLIPSE";
"marker1" setMarkerColor "ColorRed";
"marker1" setMarkerSize [500, 500];
"marker1" setMarkerBrush "SOLID";

_trg = createTrigger ["EmptyDetector", _randomLA];
_trg setTriggerArea [500, 500, 0, false];
_trg setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_trg setTriggerStatements 
[
	"this",                
	" 'marker1' setMarkerColor 'ColorBlack' ",        
	""                    
];

 

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Harzach said:

You are recreating the same marker. Why?  You can just change the existing one. That's what commands like setMarkerColor are for.

 


_trigArray = [
	[5782.864,10333.795],
	[12895.979,7353.194],
	[5517.676,9951.941],
	[1809.986,11952.15],
	[3051.818,11187.059],
	[9556.457,13465.348],
	[13416.808,12078.425],
	[8621.35,10250.979],
	[11852.628,2528.827],
	[11295.57,5227.608],
	[5482.726,4058.376],
	[7383.236,8253.998],
	[7910.444,7686.77]
];

_randomLA = selectRandom _trigArray;
_mrk = createMarker ["marker1", _randomLA];
"marker1" setMarkerShape "ELLIPSE";
"marker1" setMarkerColor "ColorRed";
"marker1" setMarkerSize [500, 500];
"marker1" setMarkerBrush "SOLID";

_trg = createTrigger ["EmptyDetector", _randomLA];
_trg setTriggerArea [500, 500, 0, false];
_trg setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_trg setTriggerStatements 
[
	"this",                
	" 'marker1' setMarkerColor 'ColorBlack' ",        
	""                    
];

 

well i was going to make it where you can see the area trigger on the map so i dont have to make another marker but not sure how i do that. so i script 2 areas marker so that one is to trigger the event and the other is the event. the reason why i dont use one marker is because I want it where you can look around the area before you walk into the trigger where the marker is located in the map  to activate the event. if there is a way to use one marker and just make it to change color when it is activate with the size is different. can you give me example how to do it.

Share this post


Link to post
Share on other sites
10 minutes ago, WaIdoZ said:

can you give me example how to do it.

 

I just did.

Share this post


Link to post
Share on other sites
7 minutes ago, Harzach said:

 

I just did.

oh lol sorry thank you 

Share this post


Link to post
Share on other sites

Okay I keep forgetting about the '___' when putting it in the "____". that the only thing i sometimes get confused about but now i slowly understand about it. but never thought about doing this way and this makes it more cleaner and less confusing, thank you.

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

×