Jump to content
Sign in to follow this  
ledhead900

Display a map marker via trigger

Recommended Posts

I am trying to use a trigger to make a couple map markers used as a visual zone border.

The mission I am working on has the squad move up towards a town, you get a new task and then I needed a couple of pre placed map markers to become visible. The markers must remain hidden until this trigger is tripped.

I thought the below method may work, I have not tried it yet.

1. Place the trigger down grouped to player, sync the trigger to a map marker?

Other possible method is using the INIT section with a hide and show function synced to the trigger much like how get hostages to work.

Share this post


Link to post
Share on other sites

Check out marker commands like setMarkertype and setMarkerAlpha. You can have the marker be of the 'empty' (invisible) type initially, but then use the trigger to set it to a visible type. Or set its alpha to 0 on startup, then set it to 1 when you want it visible.

Share this post


Link to post
Share on other sites

That should do it both those methods you posted look good, thanks. Eventually I won't have to ask so much newbie stuff lol

Share this post


Link to post
Share on other sites

Or you can create a Marker tied to an object.

Works great for things that are on-the-move.

Change Sleep to update how fast you want.

1. Setup Trigger how you want.

2. In On Act box activate the script:

nul=[]execVM "crashsite.sqf"

crashsite.sqf

_markerDP1 = createMarker["F18jet1Marker",getPos F18jet1];
"F18jet1Marker" setMarkerShape "ICON";
"F18jet1Marker" setMarkerType "hd_objective";
"F18jet1Marker" setMarkerColor "ColorRed";
"F18jet1Marker" setMarkerText "CSAR - F-18 CRASH SITE";
"F18jet1Marker" setMarkerAlpha 1;
[] spawn {
while{not isnull F18jet1} do {"F18jet1Marker" setMarkerPos getPos F18jet1; sleep 999;};
};

Share this post


Link to post
Share on other sites
Or you can create a Marker tied to an object.

Works great for things that are on-the-move.

Change Sleep to update how fast you want.

1. Setup Trigger how you want.

2. In On Act box activate the script:

nul=[]execVM "crashsite.sqf"

crashsite.sqf

_markerDP1 = createMarker["F18jet1Marker",getPos F18jet1];
"F18jet1Marker" setMarkerShape "ICON";
"F18jet1Marker" setMarkerType "hd_objective";
"F18jet1Marker" setMarkerColor "ColorRed";
"F18jet1Marker" setMarkerText "CSAR - F-18 CRASH SITE";
"F18jet1Marker" setMarkerAlpha 1;
[] spawn {
while{not isnull F18jet1} do {"F18jet1Marker" setMarkerPos getPos F18jet1; sleep 999;};
};

Oh nice, so this is for things that move around so say I wanted the marker to be positioned on a dead player I would setup the trigger to check if he was dead and then the above would put a marker where the object was at the time?. I don't have a use for that right now but thanks.

I ended up with the this code tied to the trigger "On Act" and the trigger group bound to the team leader and set to groups of units works well for my purposes. When the group in question walk over the trigger it counts down from 5 and then displays circles in yellow just as I wanted.

"Zone1" setMarkerBrush "SOLID";
"Zone2" setMarkerBrush "SOLID";
"Zone1" setMarkerAlpha 0.5;
"Zone2" setMarkerAlpha 0.5;
"Zone1" setMarkerShape "ELLIPSE";
"Zone2" setMarkerShape "ELLIPSE";
"Zone1" setMarkerSize [200, 200]; 
"Zone2" setMarkerSize [100, 100];

Edited by ledhead900

Share this post


Link to post
Share on other sites

this may also help someone else in the future

makes a marker the same size as a trigger

/*    File: markerToTrigger.sqf
   Author: Mika Hannola

   Description:
   Makes an existing or new marker cover a trigger area.

   Parameter(s):
   _this select 0: <string> marker name - if no marker uses the name, a marker will be created
   _this select 1: <object> trigger that will be covered by the marker
   _this select 2 (Optional): <boolean> changes are local (default: false)

   Returns:
   Marker name (string). Returns empty string if a marker couldn't be moved or created.

   How to use:
   _marker = ["marker1", trigger1] call BIS_fnc_markerToTrigger;
*/

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  

×