Home   Help Search Login Register  

Author Topic: Alternative to "not present" trigger  (Read 587 times)

0 Members and 2 Guests are viewing this topic.

bluehand

  • Guest
Alternative to "not present" trigger
« on: 16 May 2005, 23:26:07 »
I got the message that "not present" triggers are the work of the devil, and lead to "hunt the last loon" problems.  What beats me is - what's the alternative?

I'm trying to set up a defence against 2 waves of attackers.  The 1st wave come in, and a (smallish) not present trigger detects when they are all dead or fled.

Then the 2nd wave trigger.  Obviously I can't just have a 2nd not-present trigger for them, or it would fire at once, so I make it conditional on an is-present trigger.  The 2nd wave is now defined to start when the bad guys get inside the perimeter, and end when they're all gone.

(actually the is-present zone is smaller, so you don't shoot the first loon and get an instant reward as wave 2 has been "defeated")

2 problems: 1) it uses a "not present" trigger (work of the devil), and 2) if you get a really hot tester, he takes out the 2nd wave before they ever get into the defence area, and the whole script gets stuck.

Any suggestions on how successful defence can be scripted better?

pazuzu

  • Guest
Re:Alternative to "not present" trigger
« Reply #1 on: 16 May 2005, 23:33:55 »
Name the enemy units then use this for condition in obj trigger:

"Alive _x" count [t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,12] == 0

t1,t2 etc are names of enemy units.

I dont know if this is the best way to do it but it works for me.

I'd like to see what the experts have to say...

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Alternative to "not present" trigger
« Reply #2 on: 17 May 2005, 08:26:48 »
I tend to use a trigger with a condition line looking something like this:

("fleeing _x" count units group >= east countside units group)

Which will trigger when either:
- All units in group are dead or;
- All remaining units in group are running away

Obviously, if used on a West group the east should be changed to west ;)

If you're using two groups (as in your situation), you may want to have a variable that triggers when the second attack starts (or the first attack finishes), and add that variable to the condition line. eg.

wave2 and ("fleeing _x" count units group >= east countside units group)

Try that and see how you go ;)

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Alternative to "not present" trigger
« Reply #3 on: 17 May 2005, 09:59:29 »
This is a very tricky little problem.

The trouble with pazuzu's solution is that if one loon flees to the other side of the island, the mission will never end.   You don't know to look for him and even if you did you'd never find him.  

Sui's solution is better but still has a number of flaws.   For example the mission could end when you are staring down the barrel of an enemy gun:  there's no way of telling that the loon is fleeing and unlikely to shoot your.    

My approach is to use a not present trigger, but to take control of the situation once the number of loons gets down to a certain number.     What I did once was detect when the loons got below 12:  at that point there were set to allowFleeing 0 and ordered to head to a certain, obvious place.    Those who couldn't stand up were healed sufficiently to allow them to walk.    When they got below 6, they were set allowFleeing 1 to make them run away.    The important thing is to keep them moving:  it makes them much easier to find.  Towards the end they have orders to leave the area, which makes the not present trigger much more efficacious.

However, one of the disadvantages of this solution is that if you have a loon trapped somewhere, you return to the original problem.     The answer to this, which is only appropriate in more complex and sophisticated cases, is to check the positions of the last few loons and, if they are not moving when they should be moving, do something about it with setPos.    By definition you don't have to worry about the player seeing the loon vanish because if the player had seen him he would have shot him.

However, by far the the simplest and most effective thing you can do is have the trigger covering the right area.    Careful examination of both the map and the ground is a good starting point, but you need to plenty of playtesting too.    It's not so much that "not present" triggers are the work of the devil per se.  It is poor use of them that is the work of the devil or, more likely, bad mission designers.

For this particular case, I suggest this.

  • 1st wave attacks
  • 2nd wave attacks when 1st wave all dead or all fleeing or reaches certain point
  • Mission ends when 1st wave all dead or all fleeing and 2nd wave all dead or all fleeing.     Mission end should not depend on whether the 2nd wave attack actually occurred.

Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Alternative to "not present" trigger
« Reply #4 on: 17 May 2005, 11:22:51 »
Dealing with the lost last loon can be a challenge.  I agree you need to take control of the situation.  In my latest mission once the enemy count is down to a handful (10-15) I get them all to drop their weapons and either runaway or surrender.

bluehand

  • Guest
Re:Alternative to "not present" trigger
« Reply #5 on: 19 May 2005, 00:11:46 »
Wow!  Thanks for all the advice, guys.  I'm going to try a couple of those ideas at once.
- wave 2 has important targets (the armour), which must be taken out (whether in the perimeter or not)
- the infantry only have to be reduced to a certain number, then can flee to regroup
- fleeing loons don't count as present

The defenders then move onto a counterattack, so the flee/regroup answer is ideal. The survivors will fall back on the same line as the counterattack.

Now I just have to work out how to mark this topic as solved.... ::)
« Last Edit: 19 May 2005, 00:13:40 by bluehand »