View Full Version : Urgent problem with creating GUARDED BY waypoints through "createTrigger"
fabrizio_T
Jul 12 2009, 10:34
Hello,
i need some urgent help here. I am trying to spawn some "GUARDED BY ..." triggers as guard points via scripting.
The basic idea is creating a mission in which units with a GUARD waypoint will move to dynamically spawned "GUARDED BY ..." triggers.
The problem is that these units are actually ignoring any of my spawned triggers. No errors whatsoever in ArmA2.rpt.
Here is the pretty basic .sqf code i use for creating a "GUARDED BY BLUFOR" trigger:
_trg = createTrigger["EmptyDetector", position player];
_trg setTriggerArea[50,50,0,false];
_trg setTriggerType "WEST G";
On a sidenote:
i checked "triggerType" for a "GUARDED BY BLUFOR" trigger put directly onto the map in editor and it is blank ... I think it should have been "WEST G" ?
Hope somebody can help ...
Starlight
Jul 15 2009, 15:49
Trigger type is wrong
See Wiki (http://community.bistudio.com/wiki/setWaypointType)
Should be:
wp1 setWaypointType "GUARD"
for example wayponts setting I have in an external script
wp1 = GroupA10 addWaypoint [(getmarkerpos "A10Target"), 0];
wp1 setWaypointSpeed "NORMAL";
wp1 setWaypointType "SAD";
fabrizio_T
Jul 16 2009, 07:33
Hi Starlight,
i am sorry, i am talking about TRIGGERS, not waypoints.
The problem being with "setTriggerType" and "TriggerType", not "setWaypointType".
Sickboy
Jul 16 2009, 08:11
Copied from CA\missions\MPScenarios\MP_Paradrop.Chernarus\spawnunits.sqf (thanks to kju for the note at BIKI)
if (_waypointtype == "GUARD") then
{
_trg=createTrigger["EmptyDetector",getmarkerpos _targetmarker];
_trg setTriggerArea[_targetmarkerX,_targetmarkerY,_targetmarkerdir,true];
call compile format [" _trg setTriggerActivation[""%1"",""%1 D"",true]; ", _side];
call compile format [" _trg settriggertype ""%1 G"" ",_side];
_trg setTriggerStatements["this", "", ""];
};
Seems you are missing setTriggerActivation and setTriggerStatements
fabrizio_T
Jul 16 2009, 09:27
Copied from CA\missions\MPScenarios\MP_Paradrop.Chernarus\spawnunits.sqf (thanks to kju for the note at BIKI)
if (_waypointtype == "GUARD") then
{
_trg=createTrigger["EmptyDetector",getmarkerpos _targetmarker];
_trg setTriggerArea[_targetmarkerX,_targetmarkerY,_targetmarkerdir,true];
call compile format [" _trg setTriggerActivation[""%1"",""%1 D"",true]; ", _side];
call compile format [" _trg settriggertype ""%1 G"" ",_side];
_trg setTriggerStatements["this", "", ""];
};
Seems you are missing setTriggerActivation and setTriggerStatements
Thx Sickboy (and kju ;)),
that's precious info, i'll try that and hope it works.
I thought setTriggerActivation and setTriggerStatements were not mandatory after reading the info about guarded by triggers in the wiki (http://community.bistudio.com/wiki/ArmA:_Mission_Editor#Triggers_Mode_.28F3.29):
- The trigger's centre point will define a point to be guarded [ ... ]Guarded triggers do not activate, they only define guard points.
So maybe it's just a documentation issue.
Thanks again.
fabrizio_T
Jul 18 2009, 07:47
Hello again,
this problem is giving me an headache.
I took the quoted piece of code of BIS and just tweaked it a little bit to fit my needs. Problem is it still does not work.
MISSION SETUP:
I've put in editor:
- a marker named "Pavlovo" on the map and placed there an OPFOR unit (This should not be really needed, but see below ...)
- a BLUFOR group with a GUARD waypoint nearby (> 200 mt. from marker)
And here is the code for the "init.sqf" i wrote:
// Create a GUARDED BY BLUFOR trigger in Pavlovo
_marker = "pavlovo";
_side = WEST;
_enemyside = EAST;
_trg = createTrigger["EmptyDetector", getMarkerPos _marker];
_trg setTriggerArea[50, 50, 0,true];
call compile format [" _trg setTriggerActivation[""%1"",""PRESENT"",true]; ", _enemyside];
call compile format [" _trg settriggertype ""%1 G"" ",_side];
_trg setTriggerStatements["this", "hint('trigger activated')", "hint('trigger deactivated')"];
Since GUARDED BY triggers do not activate, then "setTriggerActivation" should be a simple placeholder and the OPFOR unit i've put there won't make any difference, right ?
Quoted from Wiki: "Guarded triggers do not activate, they only define guard points"
MISSION RESULT:
On mission load i see the hint 'trigger activated' appearing. Why ???
It means to me the trigger is just behaving like a "ordinary" trigger, not quite a "GUARDED BY" trigger.
Also, more important, my BLUFOR group does not move to the created guard point (= position of marker "Pavlovo").
Changing "setTriggerActivation" parameters does not help (and this -theoretically- makes sense).
So ... can anybody help me ?
fabrizio_T
Jul 19 2009, 09:51
ok, i suspect it being a bug since nobody seems to be able to provide a working solution.
Posted to bugtracker:
http://dev-heaven.net/issues/show/2907
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.