Jump to content
Sign in to follow this  
Kettlewell

Scripting triggers

Recommended Posts

I've been having issues with creating triggers ontop of my markers that are created dynamically and I wondered if anyone could help.

Marker Code (For some reason the marker didn't position right using X,Y instead it worked using X,Z)

_pos = _this select 0;

_name = "DZ" + str(DangerZones);
_marker = createMarkerLocal ["DZ" + str(DangerZones), [(_pos select 0),(_pos select 2)]];
_marker setMarkerTypeLocal "Empty";
_marker setMarkerShapeLocal "RECTANGLE";
_marker setMarkerSizeLocal [50, 50];
_marker setMarkerColorLocal "ColorRed";
_marker setMarkerBrushLocal "Solid";

_marker = createMarkerLocal ["DZ_Outline" + str(DangerZones), [(_pos select 0),(_pos select 2)]];
_marker setMarkerTypeLocal "Empty";
_marker setMarkerShapeLocal "RECTANGLE";
_marker setMarkerSizeLocal [50, 50];
_marker setMarkerColorLocal "ColorBlack";
_marker setMarkerBrushLocal "Border";

DangerZones = DangerZones + 1;

Attempt #1

_trigger = createTrigger["EmptyDetector",[(_pos select 0),(_pos select 1),(_pos select 2)]];
_trigger setTriggerArea [50, 50, 0, true];
_trigger setTriggerActivation["ANY","PRESENT",true];
_trigger setTriggerStatements["this", "{nul = [_x] spawn CheckDanger;}forEach thislist;", ""]; 

Attempt #2

[_pos, "AREA:", [50, 50, 0, true], "ACT:", ["CIV", "PRESENT", true], "STATE:", ["this", "{nul = [_x] spawn CheckDanger;}forEach thislist;", ""], "NAME:", "DZ_Trig" + str(DangerZones)] call CBA_fnc_createTrigger;

Share this post


Link to post
Share on other sites

Trigger does not activate?

Trigger is not created at all?

Trigger is created but in wrong place?

Trigger creation seems fine although...

[(_pos select 0),(_pos select 1),(_pos select 2)]
?

Share this post


Link to post
Share on other sites
Trigger does not activate?

Trigger is not created at all?

Trigger is created but in wrong place?

Trigger creation seems fine although...

?

It seems to be like the rest of it, X and Y aren't used on the 2D plane for creating it but X and Z.

The X,Y,Z was pulled directly from the mission.sqm, I made a marker the size and in the place then rounded it off so it was perfectly placed and took the position values and it seems like it is X,Z,Y the way the values are used. Had any experience of this?

Share this post


Link to post
Share on other sites

Position coordinates in the mission.sqm are like that.

createMarker and createTrigger use [x,y,z] order.

Problem with your script bits up there is mismatching coordinates.

If they are from same script, why not just use:

_trigger = createTrigger["EmptyDetector",(getMarkerPos _marker)];

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  

×