OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Inkompetent on 25 Jun 2009, 17:11:42

Title: [SOLVED] Repeating trigger doesn't repeat
Post by: Inkompetent on 25 Jun 2009, 17:11:42
Hallo there!

Got a lil' problem with a trigger that is supposed to continously count how many OPFOR are left on the map.

At the moment I have an 'East Present' repeating trigger covering the mission area, that is to count people with a simple 'eastCount = east countSide thisList' line.

However when running the mission I got issues, and debugging messages in sideChat shows it only fires once at the start of the mission, and that's it. I've tried with the condition for activation being 'this', 'true', 'east countSide thisList > 6', but nothing of them makes it trigger more than once.

Anyone that can shed some light on what I'm doing wron?
Title: Re: Repeating trigger doesn't repeat
Post by: nominesine on 25 Jun 2009, 17:23:42
A trigger only triggers when the condition changes to true. The key word here is change.

The condition changes to true from start since all units are present. The only way to make it do another count is if all eastern units leave the trigger area (condition changes to false) and enters it again (changes back to true once more)

The same goes for your > 6 solution. Either there's more than six units present in the list or not. The condition can only be met once, unless all east sided units leave the trigger area and then returns.

SWEDISH NOTE: Jag kan tänka ut en fungerande lösning åt dig om du vill, men oftast är det ju roligare att hitta lösningarna själv  ;)
Title: Re: Repeating trigger doesn't repeat
Post by: JamesF1 on 25 Jun 2009, 17:49:54
This caught me out a little earlier today... as using "true" as a condition used to allow indefinite repeating (or is my memory just foggy?).  Either way, this is a sensible improvement... albeit one that puzzled me for a little while today!
Title: Re: Repeating trigger doesn't repeat
Post by: Inkompetent on 25 Jun 2009, 18:41:58
Okay. As far as I recalled this, or some form of it, have worked before.

I guess that it comes down to by a looping script create and delete triggers doing the above if I really have to do it that way. I think I'll have easier workarounds for my current mission though, but good to know non the less.
Title: Re: Repeating trigger doesn't repeat
Post by: F2kSel on 26 Jun 2009, 01:42:18
I place a game logic and in the init field set a variable, lets say trig=true


in a trigger set the following

Condition  trig
on Act     trig=false
on Dea     trig=true

you still need to set the trigger to repeat aswell.


That's how I do it if I don't want to script it, assuming I understand the question.
Title: Re: Repeating trigger doesn't repeat
Post by: Sparticus76 on 26 Jun 2009, 03:06:16
I had a similar problem.
I made one trigger like yours and then made another with a counter.

Create a logic object and put in init line....TriggerLister = false.

- create a repeating trigger initiates by.. !TriggerLister. On activation..TriggerLister = true..count down 10 seconds or whatever in your min, med and max.

- create a second repeating trigger initiated by (east present and TriggerLister).
- on activation, get the triggers list and TriggerLister = false.

Have tested it and it works.
Title: Re: Repeating trigger doesn't repeat
Post by: Inkompetent on 26 Jun 2009, 11:40:47
Ahhh, thanks for the solutions, both of ya! Typical me to make things more advanced than they have to be.

Edit: Tried the solution given by Sparticus76, and the mission now works like a charm. Wonderful!