Home   Help Search Login Register  

Author Topic: Help with triggers  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

Offline redmotion

  • Members
  • *
Help with triggers
« on: 16 Oct 2010, 12:09:10 »
I'd like to create a trigger in script that is put down in the location of a marker (placed in the editor). And that can only be activated by the player. Thing is, I can't even work out what type of trigger to create.

The script below runs without errors but doesn't give me a trigger that works. I've tried numerous versions of this - changing the type and activation options - but with no success.

Code: [Select]
_pos = getMarkerPos "BaseMarker5";

basetrigger = createTrigger ["SWITCH", _pos];
basetrigger setTriggerActivation ["WEST", "PRESENT", false];
basetrigger setTriggerArea[100,100,0,false];
basetrigger setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];

Thanks for you time.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Help with triggers
« Reply #1 on: 16 Oct 2010, 13:23:14 »
Try using:
Code: [Select]
basetrigger = createTrigger ["EmptyDetector", _pos];That's the 'default' trigger type.

Can't see anything else that would be problematic :)

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Help with triggers
« Reply #2 on: 16 Oct 2010, 22:15:01 »
 :scratch:

The trigger will get activated by all WEST units that enter the area:
Quote
basetrigger setTriggerActivation ["WEST", "PRESENT", false];
...
basetrigger setTriggerStatements ["this", "hint 'trigger on'", "hint 'trigger off'"];

If I got you right, this is not what you want. Try something like this:

1. Make the trigger report any unit who enters the area (setTriggerActivation).
2. Only activate if the player is one of the units that got reported (setTriggerStatements)

Code: [Select]
basetrigger = createTrigger ["EmptyDetector", getMarkerPos "BaseMarker5"];
basetrigger setTriggerActivation ["Any", "Present", false];
basetrigger setTriggerArea [100, 100, 0, false];
basetrigger setTriggerStatements ["player in thisList", "hint 'trigger on'", "hint 'trigger off'"];
« Last Edit: 16 Oct 2010, 22:31:58 by Worldeater »
try { return true; } finally { return false; }

Offline redmotion

  • Members
  • *
Re: Help with triggers
« Reply #3 on: 20 Oct 2010, 21:52:55 »
@Worldeater: Thank you so much. That worked straight away. That has been killing me for a week! Thanks again.