You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Hygraffo's Introductory Guide to Triggers for Beginners
posted 04 October 2008 09:38 PM EDT (US)   

Hygraffo's Trigger Guide



This is a beginner’s guide to getting introduced to triggers, and a few experienced people might find it useful as a refresher course.

Please note this guide is for AoT users, as the editor is more versatile and better then AoM.

Anyway, first thing is first. What is a trigger? A trigger is a command of sorts, telling AoT what to do, how to do it and when to do it. Got that? When you open up the “Trigger” drop-down box, you get something very similar to this:



There are three main parts to this menu. They are: Number 1 is where all the triggers are going to be listed, number two is where you cycle between trigger options, conditions and effects. Number 3 is where you make changes to the options in Number 2. In other words:
1= Trigger List
2= Select what part of trigger
3= Modify the trigger part you selected

Simple enough?
Alright, now to business. To make a trigger, you must click on the “Insert button, highlighted here in red:


Once you click on that button, a trigger is created. You’ll end up with something like this:


As you can see, a trigger called “Trigger_268” was created, and as I have the “Triggers” menu selected, it shows me the options and overall summary of the trigger. It shows the name, which you can edit. It has three boxes beneath that, titled, “Active”, “Loop”, and “Run Immediately”. Beneath those three, it has a slider, called “Priority”.

The name part is self explanatory, so I won’t cover that. However, the checkboxes can be confusing for a first timer.
Active= The trigger is active from the moment you load the scenario. This means that once the condition is fulfilled, the trigger fires. This means, for example, if a player selects a certain unit, the trigger will fire immediately (if selecting a certain unit was that condition).If this button is not checked, it must be activated by another trigger. To do that, you must use the “Fire Event” effect, which will activate a trigger of your choosing. Once a trigger is active, the next time its condition is fulfilled, the effect will happen.

Loop= Once the Condition has happened, the effect will just keep repeating without the need for the condition to be fulfilled again. These triggers cause MAJOR lag, so it is advisable that you use three, or at most four, of these, unless you don’t want anyone to play your scenario.

Run Immediately= Checking this box will by-pass the condition. For example, if the condition was a timer, the trigger would skip the timer, do the effect, then start again, this time with the timer. It makes the effect happen twice, once instantly, the other after the effect.

The priority slider beneath those three boxes has three parts, as you can see. Those parts are: Low, Norm, and High. If a trigger is Low Priority, there will be a noticeable delay, especially if there are higher priority triggers going on at the same time.

High priority triggers on the other hand have barely a delay, but too many high priority triggers (especially at the same time) will lag or crash the game. To the right of all that is the overview of your trigger, with its conditions and effects.

Some people may not understand what “conditions” or “effects” are. To explain, I’ll use an analogy. We’ll say, you only eat if you are hungry. In this case, the “Conditions” is “you are hungry”, while the effect is, “eat”. This is similar to AoM/AoT triggers. If you have a Timer of 10 seconds with the effect of grant god power, the game knows “I will only grant a god power when the timer reaches ten seconds”.

Anyway, back to the picture. In this trigger summary, you can see that the condition is always, and the effect is SetIdleProcessing. A thing you need to learn. SetIdleProcessing means that it stops the game from processing information, or in other words, a crash. So you need to change that. Also, the condition “Always”, means that the condition happens immediately, similar to if I had checked the Run Immediately box.

If you go back to the “Trigger, Condition, Effect” box, and you check the “Conditions” box, you get a menu similar to this:


Number 1 is where you see all the conditions that you have added. Number 2 and 3 are check-boxes for Not and Or, while number 4 is where you select a trigger from the drop-down menu.

To elaborate on the NOT/OR principle, we’ll go back to the hungry analogy. Without those boxes ticked, the trigger is in “AND” mode, which means that for the effect to happen, ALL the conditions must be fulfilled. In “NOT” mode, ALL the conditions must not be fulfilled for the event to happen. In “OR” mode, you must have one OR another condition fulfilled. For example:
AND= I will eat if I am hungry AND there is food on the table.
NOT= I will eat if I am NOT bloated.
OR= I will eat if I am hungry OR there is food on the table.
Understand?

If you select the “Effects” box instead of the “Conditions” box, you get:


As you can see, this has less complexity then either the Conditions or Trigger box, but it is where 99.9% of trigger work happens.

Once again, it has a list of the effects, and the place where you can select those effects to change them.
Before the end of this, I’d like to add a list of some of the most important conditions and effects a starter uses and what they do.

EFFECTS:
Fire Event= Pretty much the most valuable effect. It activates inactive triggers, or restarts a trigger which has already done its job.

Army Move= Moves an army (look at some other guides to find out what armies are )

Kill= Kills a unit with the death animation

Destroy= Deletes the unit without the death animation

Modify Protounit= Change unit stats (I once made an Arcus which fires 50 arrow which can kill a Gaia in one hit. You don’t need to go so overboard, but it’s still fun)

Change Name= Changes the name of the unit

Send Chat= Sends a chat message to the selected player.

CONDITIONS:
Timer= Starts a countdown timer. When the timer is finished, the condition is fulfilled.

Chat contains= Checks if the chat contains a word/phrase. If it does, the condition is fulfilled.

Unit Selected= Checks if a unit(s) is selected, if it is, the condition is fulfilled.

Unit in LOS= Checks if a unit(s) is in a player’s (of your choosing) Line of Sight. If it is, the condition is fulfilled

Unit is Dead= Checks if a unit(s) is dead. If it is, the condition is fulfilled.

___________________________________________________________
Hopefully some people found this guide useful. Just remember:

USE THE BLOOMIN’ QUESTION THREAD!!!!


¨‘°ºO Oº°‘¨_.,-=~+"^'`*`'^"+~=-,._Hygraffo_.,-=~+"^'`*`'^"+~=-,._¨‘°ºO Oº°‘¨
׺°˜`°º×-=»«=-I am a ninja-=»«=-׺°˜`°º×
Home of the quoted
Reaaly I am in a Chinese nuclear sub- JDmino
Meh- Baske
Replies:
posted 04 October 2008 09:54 PM EDT (US)     1 / 16  
I was writing one!

Thats okay. Mine has a step-by-step tutorial in it.
posted 04 October 2008 09:57 PM EDT (US)     2 / 16  
Yea, I wrote one of these a year ago (Here)
Looks good, but could use a few examples...

Ăžųŗ§ƒ¡ŗë
--------------------
Scenario Scriptor for Reverie World Studios
-Forums-
posted 05 October 2008 02:04 PM EDT (US)     3 / 16  
your loop is wrong.. the definition you have for it.
without the need for the condition to be fulfilled again.
that is false, the condition DOES need to be fulfilled again.

say you had a trig that army deploys every 5 seconds, once it hits 5 seconds, it spawns, if it is loop, it takes 5 more seconds for the units to spawn again.
These triggers cause MAJOR lag, so it is advisable that you use three, or at most four, of these, unless you don’t want anyone to play your scenario.
i have never had major lag caused by my loop triggers.

also ive never had a game crash because i had a setidleprocessing
posted 05 October 2008 02:32 PM EDT (US)     4 / 16  
Other than the Loop thing, this is the most easy to understand triggers guide I have ever read.

°o.O O.o°
.o O°FYI: I DO NOT ABUSE DRUGS°O o.
.o O°My Seal°O o.
°O o..o O°Of Seriousness°O o..o O°
posted 05 October 2008 02:46 PM EDT (US)     5 / 16  
I always thought SetIdleProcessing was something along the lines of telling AI to do something with its units instead of just sitting there. -shrug-

And either I misread or you forgot that when OR and NOT are checked, just one of the conditions has to be false.

About triggers that loop in relation to crashes, as far as I have seen, the only time major lag or crashing occurs for a looped trigger is when the condition is instantaneously reached, or once reached, usually will be fulfilled continuously thereafter. A good example being 'always', as well as having a (rather static) Quest Var being value X.

And you might want to mention in triggers that require a target, such as Change Name or Kill, you need to select the unit first, THEN click the button labeled "Set Unit" or whatever it is, which is NOT like triggers that require an area, where you hit the "Set" button and then the area. Hitting "show" centers on the selected unit.

Something something a quarter of a century old.
posted 05 October 2008 03:29 PM EDT (US)     6 / 16  
SetIdleProcessing means that it stops the game from processing information, or in other words, a crash.
Are you sure about that? I've always been pretty sure that it did exactly nothing.
posted 05 October 2008 03:37 PM EDT (US)     7 / 16  
Yeah, it pretty much does nothing. As does the always condition.

I don't recommend this guide. Sorry. A lot of mistakes, and it's not even versatil enough to cover AoM? :s.

You should wait, gain more experience and knowledge only then create procede into elaborating a beginner guide. You should read the others out there and try to surprass them.

Do not make guides that contain information you might be uncertain of and flag it as beginners material..
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.
posted 05 October 2008 11:33 PM EDT (US)     8 / 16  
SetIdleProceessing doesn't crash. Why would it be the default effect?

It does nothing, simple as that.
posted 05 October 2008 11:47 PM EDT (US)     9 / 16  
SetIdleProcessing means that it stops the game from processing information, or in other words, a crash.
If that were true, every RMS containing a trigger would crash the game (some ES RM's, like sudden death, contain triggers). Yeah I think that there are too many errors in there also ~ Khan

<||=================================||>
Proud Member of Forgotten Empires
96Reviews KaS Dota2 Halo 5 Reach
{ "Work until your idols become your rivals" }
༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ

[This message has been edited by Steak And Khan (edited 10-05-2008 @ 11:52 PM).]

posted 06 October 2008 09:53 AM EDT (US)     10 / 16  
I bet SetIdleProcessing is similar to a DoEvents command in Visual Basic and also evidenced in windows Task Manager by the System Idle process. The game is busy running your scenario's commands but it has its own things to do and I figure this is a command that when the game is giving processing time to your commands you can give it this command that basically says, this time I don't need anything, get back to your stuff this processing cycle.

In all your science of the mind, seeking blind through flesh and bone
Find the blood inside this stone
Well, I know I've never shown what I feel, I've always known
I plan my vengeance on my own - and I was always alone
posted 10 October 2008 06:12 PM EDT (US)     11 / 16  
Alyssea, hopefully yours will help me better understand triggers. This one was ok, bu at some points I'm like "Huh". And no, I am not a noob. I've had Aom for a long time. I just didn't know triggers cuz I wasn't part of AomH and nobody taught me.
posted 11 October 2008 07:48 AM EDT (US)     12 / 16  
You know, you don't need to be part of AoMH to be able to do triggers. It is basic knowledge. Anybody who can speak english should know what a Condition and an Effect is, and it only takes about an hour in the editor to be able to understand almost all of the simpler triggers.

If you didn't understand QV's or coding then that doesn't make you a noob, but when you set up two threads asking Yeebaagooon to make a trigger guide even after someone else already did mainly me thinks for you and when there's a massive amount of already existing and perfectly good guides for you to browse through, it kind of does.

And for some reason the words "I am not a noob" combined with rather noobish behavior get to me. I'm not usually this mean. Honest.
posted 11 October 2008 08:26 AM EDT (US)     13 / 16  
When I was 12 years old and made some nooby aoe2 maps, I never understood the trigger system there.

But us soon as I got AoM a few years later and opened the editor, I was like, IS IT THAT EASY?

Once you grasp the general concept of triggers, you should try to figure out the other things yourself. Just try and keep trying if you're interested. That's still the best way to learn it. I never needed any guides to figure our most of what I know about now these days.

If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
posted 11 October 2008 09:08 AM EDT (US)     14 / 16  
I feel superior.

When I was twelve, I grasped the basics of AOK triggers for my shit maps.


░█▀▀ ░█▀█ ░█ ░█▀▀ ░
░█▀▀ ░█▀▀ ░█ ░█ ░░░
░▀▀▀ ░▀ ░░░▀ ░▀▀▀ ░
posted 11 October 2008 09:17 AM EDT (US)     15 / 16  
once i started out, i got the simple trigs easy. i had no clue on like QVS and stuff like that. now i just need to learn arrays, some strings, and coding
posted 11 October 2008 09:40 PM EDT (US)     16 / 16  
I feel superior.

When I was twelve, I grasped the basics of AOK triggers for my shit maps.
Ditto ~ Steak (Hate to burst your bubble, however it did take me a while to learn how to make triggers in AoM)

<||=================================||>
Proud Member of Forgotten Empires
96Reviews KaS Dota2 Halo 5 Reach
{ "Work until your idols become your rivals" }
༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
Age of Mythology Heaven » Forums » Scenario Design » Hygraffo's Introductory Guide to Triggers for Beginners
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames