View Single Post
  #8  
Old 06-14-2011, 02:08 AM
TheEnlightenedFlorist TheEnlightenedFlorist is offline
Approved Member
 
Join Date: May 2011
Location: SLC, Utah, USA
Posts: 143
Default

Quote:
Originally Posted by Ribbs67 View Post
Thanks EF!
I will give it a shot. Are you using any triggers along with the scripts? I noticed that in some missions there were triggers..but no actions??.... I thought for a trigger to work it needed a "trigger and "action" both with the same name..could be wrong tho.

Also what does compile do..when you right click in the script tab box?

In one of my missions I have a Small battle going on in which I have like 4 different "triggers" with 4 different "actions. Now do the triggers have to happen in "order?, or can this be used as a random occurrence ?
IE ..2 110's take off to bomb an RAF airfield. if they ar successful in eliminating the target..(AAA and a Bedford) then a flight of 109's spawn and join the battle. if the player shoots down both 110's before they get the AAA then a flight of Hurri's spawn.
In the example above the 110's spawning the other 110.s is above the Spits spawning the Hurri's. My question is to you , if the spits shoot the 110's first..will they spawn the Hurri's or will it not happen because the first Trigger in line was not "triggered" so to speak.. I hope I didnt lose you on the example...heh

Ribbs
Triggers and actions are completely unrelated. Think of it like this: Triggers are a mission telling you that something has happened, actions are you telling a mission to do something.

When a trigger is triggered, all it does is call a certain method. In that method, you can determine what trigger was called and what, if anything, to do about it. In the examples you've seen, when a trigger was triggered, an action was called. Technically, they don't have to have the same name, it just makes the coding a bit easier. It doesn't always have to work that way, though. When a trigger is triggered, I could do anything I want like loading a mission, sending a message to players, or destroying an aircraft.

Likewise, an action can be called at any time like after a certain amount of time, a certain player joins, or a certain type of aircraft is spawned.

Triggers don't have to happen in any sort of order. If you have a trigger for when a certain group of aircraft is destroyed, it will be triggered whenever those aircraft are destroyed. It depends on nothing else.

Unfortunately, I've found that triggers aren't always reliable. At least in the two instances I was using them for in Operation Dynamo. I'm sure in time they will be improved, but for now I've managed to work around them.
Reply With Quote