Jump to content
Sign in to follow this  
Brute

Trigger - Create a marker?

Recommended Posts

Basically i am trying to tigger the creation of a marker after a task completed and the deletion of the previous one? I am not sure how to code to accomplish this?

Share this post


Link to post
Share on other sites

This is one example to create a marker. You can write this as a script or in the activation of an trigger.

_marker = createMarker ["YourMarker", position player ];
"YourMarker" setMarkerType "Warning";
"YourMarker" setMarkerSize [1, 1];
"YourMarker" setMarkerDir 0.93884;
"YourMarker" setMarkerText "Your text";
"YourMarker" setMarkerColor "ColorRed";
"YourMarker" setMarkerPos getMarkerPos "Marker1";

YourMarker is created at players position and set it to the position of Marker1. Marker1 is an empty marker.

And here are more infos to create markers.

Share this post


Link to post
Share on other sites
This is one example to create a marker. You can write this as a script or in the activation of an trigger.

_marker = createMarker ["YourMarker", position player ];
"YourMarker" setMarkerType "Warning";
"YourMarker" setMarkerSize [1, 1];
"YourMarker" setMarkerDir 0.93884;
"YourMarker" setMarkerText "Your text";
"YourMarker" setMarkerColor "ColorRed";
"YourMarker" setMarkerPos getMarkerPos "Marker1";

YourMarker is created at players position and set it to the position of Marker1. Marker1 is an empty marker.

And here are more infos to create markers.

Very helpful, thank you :) I want the marker type to be the rough drawning like objective symbol however if i enter "Objective" it cannot find it?

---------- Post added at 09:29 PM ---------- Previous post was at 07:32 PM ----------

Anyone?

Edited by Brute

Share this post


Link to post
Share on other sites

I tried those samples and their´re working fine exept the creation of shapes like an Ellipse. The Wiki ressource is absolutely incomplete. It says to create a shape use:

"Marker1" setMarkerShape "RECTANGLE"

but nothings happens if resp. trigger gets executed.

The example given above with additional line with or without setMarkerType doesnt work either.

So is it possible to create a shape, in his case an Ellipse, with a predefined size and color at a certain position?

regards

Memphis

Share this post


Link to post
Share on other sites

All the commands work just fine. Two different ways to refer to the created marker, both work:

m = createmarker ["mymarker",getpos player];
m setmarkershape "RECTANGLE";
m setmarkersize [20,20];
m setMarkerColor "ColorGreen";

m = createmarker ["mymarker",getpos player];
"mymarker" setmarkershape "RECTANGLE";
"mymarker" setmarkersize [20,20];
"mymarker" setMarkerColor "ColorGreen";

Share this post


Link to post
Share on other sites

I have a question about setting the created marker position. I'm trying to get the player to spawn at marker 1(M1) on top of a building, not where the player is as in this and the BIKI example.

I've tried this:

via trigger the script is activated:

_marker = createMarker ["M1", position [2088.84, 2516.07, 39.9]];

_somegroup = createGroup resistance;
"ACE_Ins_2_3" createUnit [getMarkerPos "M1", _somegroup,"dude= this", 0.5, "corporal"];
dude doWatch (markerPos "M2");
dude setdir 90;

But this doesn't work. How can I get the marker and unit, or just the unit to spawn at the position above. It's on top of a building again.

Does anyone have any suggestions for getting this sniper to spawn. I need him to shoot at my Army officers a few hundred yards a way.

Share this post


Link to post
Share on other sites

Just setpos/setposatl/setposasl it after creation, just like you dowatch and setdir it.

Share this post


Link to post
Share on other sites

I created a script for dynamic creation of markers. Especially for UPS.:bounce3:

Can someone useful:)

// Ðвтор: [sARMAT] PIONEER
// Создарие маркеров, тип еллипÑ
// s=["str",player,50,50] execVM "create_mar.sqf"

_mar_name = _this select 0;
_pos = _this select 1;
_x = _this select 2;
_y = _this select 3;

_mar_name = createMarker [_mar_name, position _pos];
_mar_name setMarkerShape "ELLIPSE";
_mar_name setMarkerBrush  "GRID";
_mar_name  setMarkerSize [_x,_y];
if (true) exitWith {};

Share this post


Link to post
Share on other sites
Just setpos/setposatl/setposasl it after creation, just like you dowatch and setdir it.

I've tried that but it never seemed to work. If someone could show me the proper code it would be much appreciated. I'm lost as to why other ways won't work either. I realize setpos, etc is the way to go, I just can't get it to work. Hence I asked here.

Share this post


Link to post
Share on other sites

_marker = createMarker ["M1", [2088.84, 2516.07, 39.9]];
_marker setmarkershape "ICON";
_marker setmarkertype "Empty";
_u = (createGroup resistance) createUnit ["ACE_Ins_2_3", (getmarkerpos "M1"), [], 0, "NONE"];
_u setvehiclevarname "dude";
_u dowatch (getmarkerpos "M2");
_u setdir 90;
_u setposatl 123;

But, I think the problem might just be in your marker creation. Not sure if creation works without settings type and shape and another thing thats certainly looks wrong is the position. You use command position to get the number array from an object, you dont need to use it in this case, because info is in an array already.

Share this post


Link to post
Share on other sites
_marker = createMarker ["M1", [2088.84, 2516.07, 39.9]];
_marker setmarkershape "ICON";
_marker setmarkertype "Empty";
_u = (createGroup resistance) createUnit ["ACE_Ins_2_3", (getmarkerpos "M1"), [], 0, "NONE"];
_u setvehiclevarname "dude";
_u dowatch (getmarkerpos "M2");
_u setdir 90;
_u setposatl 123;

But, I think the problem might just be in your marker creation. Not sure if creation works without settings type and shape and another thing thats certainly looks wrong is the position. You use command position to get the number array from an object, you dont need to use it in this case, because info is in an array already.

Thanks bud. I'll give that a try. I appreciate the help.

EDIT:

Alright I'm very confused. I can't get that to work either. It seems I can't get the marker to spawn where I want it in any format. Instead of spawning a marker could this work with a game logic instead? I've been trying to figure out how to replace the M1 marker with a GL instead but I can't seem to get that right either.

If I take away the create marker part of the code any just place a marker named M1 on the map I cant get the unit to spawn on the marker just in front of me. I can't seem to get the marker to move above the ground, on the building roof.

Edited by Manzilla

Share this post


Link to post
Share on other sites

Can someone please help me to understand where this string of numbers is coming from? Where do I get them? (from the example above)

_marker = createMarker ["M1", [2088.84, 2516.07, 39.9]];

I've made it as far as using a trigger to get my marker to show up, but it's not in the right place. According to the GPS, it's showing up at 000,999. :confused:

So, I feel like I'm most of the way there. Trigger gets activated, marker shows up, it's just not in the right spot, and I can't figure out how to get it where it needs to go.

Since I don't know where those numbers are coming from, I tried to use other idea I read in a post, and I placed a gamelogic where I want marker to be, and gave it a name, and tried to use that. Here's what I have

_marker = createMarker ["Take Five", position tfive]; "Take Five" setMarkerType "Warning"; "Take Five" setMarkerSize [1, 1]; "Take Five" setMarkerDir 0.93884; "Take Five" setMarkerText "Take Five"; "Take Five" setMarkerColor "ColorRed"; "Take Five" setMarkerPos getMarkerPos "tfive";

And that actually gets me a marker to show up, just in the wrong spot. Help would be appreciated.

Share this post


Link to post
Share on other sites
Can someone please help me to understand where this string of numbers is coming from? Where do I get them? (from the example above)

It's a position. The format is [x,y,z], where x and y are from bottom left corner of the map and z is height (number depends on if its taken from sea level or terrain level).

_marker = createMarker ["Take Five", position tfive]; "Take Five" setMarkerType "Warning"; "Take Five" setMarkerSize [1, 1]; "Take Five" setMarkerDir 0.93884; "Take Five" setMarkerText "Take Five"; "Take Five" setMarkerColor "ColorRed"; "Take Five" setMarkerPos getMarkerPos "tfive";

And that actually gets me a marker to show up, just in the wrong spot. Help would be appreciated.

Do you have a marker named "tfive"?

Share this post


Link to post
Share on other sites
It's a position. The format is [x,y,z], where x and y are from bottom left corner of the map and z is height (number depends on if its taken from sea level or terrain level).

Well, Ok. I tried to use the position that the GPS gave me, and I put something like 007,023. But those are always just two 3 digit numbers, and you guys keep having these numbers that have all those digits. Plus the z axis. Just couldn't understand where you're getting it from.

Do you have a marker named "tfive"?

Well sir, no I don't. I have a game logic named tfive, that I was trying to refer to, to place my marker.

I thought I was creating a marker named Take Five (that does not yet exist, until my trigger is activated).

Share this post


Link to post
Share on other sites

GPS is just the grid position, not the actual position (the one the game engine works with). For testing, just do in player's init field:

hint str getpos player

You will see the actual position. But for scripts using "getpos someObject" is better method.

The reason why I asked is, you are trying to get a position from a marker called "tfive". If you don't even have such a marker, then using "getmarkerpos" command is kind of useless.

Share this post


Link to post
Share on other sites
For testing, just do in player's init field:

hint str getpos player

You will see the actual position.

That tip (combined with your previous help to the other poster) was all I needed to make it work.

The reason why I asked is, you are trying to get a position from a marker called "tfive". If you don't even have such a marker, then using "getmarkerpos" command is kind of useless.

Yes, I see what you mean. I guess I was just plain confused, and I have removed that part.

Thank you for being so generous with your time/talent. :cheers:

Share this post


Link to post
Share on other sites
GPS is just the grid position, not the actual position (the one the game engine works with). For testing, just do in player's init field:

hint str getpos player

You will see the actual position. But for scripts using "getpos someObject" is better method.

That worked for me last time, but now I'm working on a different mission (still in Takistan), and I keep getting the result of 0,0,0. :confused:

I can't figure out what I'm doing differently. It's probably something obvious and silly, but I can't figure it out. Does anyone know why I'd be getting nothing but 0's for this?

(I want to use it so I can learn how to use the spawn group business in UPSMON)

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  

×