Home   Help Search Login Register  

Author Topic: script created "guarded by" triggers ignored by guard AI?  (Read 2754 times)

0 Members and 1 Guest are viewing this topic.

Offline _William

  • Members
  • *
Hi,

I'd like to create a dynamic defense of a village based on "guard waypoint-ed" units and dynamically created (and removed) "guarded by" triggers.
In a simple test mission, the AI groups obviously move to mission created "guarded by" triggers. However, adding a script created "guarded by" trigger (even when all mission created triggers are removed) doesn't affect the AI groups at all. The trigger is active, no errors in the arma2.rpt.

I'm using the following to create the trigger (title effect and trigger activation shouldn't be necessary, the trigger does fire).
Code: [Select]
_trg = createTrigger["EmptyDetector", [3379.0, 4363.0, 17.0]];
_trg setTriggerType "WEST G";
_trg setTitleEffect ["TEXT", "PLAIN DOWN", "WEST G trigger fires"];
_trg setTriggerActivation ["LOGIC", "true", true];

Anyone able to spot something wrong? Anybody with experience in script generated "guarded by" triggers?

William

Offline Loyalguard

  • Former Staff
  • ****
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #1 on: 11 Mar 2010, 00:57:41 »
For a scripted trigger to work properly I think createTrigger, setTriggerArea, setTriggerActivation, and setTriggerStatements must be included even if they are not pertinent (at least that is the way I have always done it).

The best way to figure out which statements/values to use is to place a trigger in the editor and set it up how you want the scripted one to work (Guarded by BLUFOR and the like, etc.).  Save your mission and then open the mission.sqm and see how the trigger is configured within.  Then, when you write the code to create your trigger in the script mimic the values in the mission.sqm (except position because I think z, and y are reversed in the .sqm).  Just make sure to delete the trigger in the editor before testing your scripted one.

Good luck!

Offline _William

  • Members
  • *
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #2 on: 11 Mar 2010, 01:35:22 »
I started out by copying the settings from a mission defined trigger (which doesn't define much and works):
Code: [Select]
class Item0
{
position[]={3454.5898,35.81736,4544.2939};
interruptable=1;
type="WEST G";
age="UNKNOWN";
};

I tried to explicitly set an area and statements for the trigger but to no avail.
« Last Edit: 11 Mar 2010, 01:41:10 by _William »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #3 on: 13 Mar 2010, 08:05:00 »
I don't think Guarded By triggers can have an activation - they're active from the start, no matter what you put into the condition lines etc. I don't think it fires either, so you can't have a text saying anything when it 'activates'. Unless you've tried this with regular triggers to see if it works?

Anyway, have you made sure it doesn't work in-game as well, e.g. place a group with a Guard waypoint and then create the Guarded By trigger and see if they move up to it?

Then again, it might just not work  :( Certain things don't, sadly.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #4 on: 15 Mar 2010, 10:55:21 »
Quote
I don't think Guarded By triggers can have an activation - they're active from the start

Correct.

And I think your created guarded by trigger works. ArmA2 AI will move to the guarded by triggers in the exact order they were placed on the map. If you have more guarded by triggers than guard groups, then no one will move to the last trigger, regardles if it was editor placed or not.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline _William

  • Members
  • *
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #5 on: 15 Mar 2010, 21:20:55 »
And I think your created guarded by trigger works. ArmA2 AI will move to the guarded by triggers in the exact order they were placed on the map. If you have more guarded by triggers than guard groups, then no one will move to the last trigger, regardles if it was editor placed or not.

Thanks for your reply. I've considered that. I used a test mission with two groups with a guard waypoint each, one static 'guarded by' trigger and another dynamically created trigger. I also ran the mission without the static trigger. The groups never responded to the dynamically created trigger. I also used an additional move waypoint for the groups, so the dynamically created 'guarded by' trigger would be created before the groups try to guard.

I've found a similar issue reported at dev-heaven.net by fabrizioT: http://dev-heaven.net/issues/2907
The example mission there also doesn't work for me. Confusingly, that issue is now closed 'working properly'.

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #6 on: 18 Mar 2010, 07:56:27 »
Always possible to reopen a ticket in the CIT, if the issue is still valid.  :)

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #7 on: 18 Mar 2010, 12:32:00 »
The groups never responded to the dynamically created trigger.

I did a similar test, and it seems as if I was wrong, and you are right. Guard triggers are probably initiated within the first split second following mission start. After that they seem to be set in stone. Have you tried to move a pre placed guard trigger around after mission start? I never had time to try that.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: script created "guarded by" triggers ignored by guard AI?
« Reply #8 on: 18 Mar 2010, 15:56:26 »
I'm not surprised, really. I did a study back in OFP days on how Guard WPs and Guarded By triggers worked, and they (among other things) had a scaling level of importance - the first placed Guarded By trigger was the most important, with the others trailing after. So if you had three Guarded By triggers and one Guard group, the group would always head to the GB trigger placed first (and if you had two groups and the one guarding GB 1 was killed, then the one guarding GB 2 would abandon GB 2 to go to GB 1, etc etc).

So I'm guessing they don't allow this order to be messed up any longer after the initial placement. Oh well. Maybe we can work around it someway, if you'd tell us what your purpose is?

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"