[Tutorial] Basic Triggers

For discussion about scenarios! Post your scenarios, comment on others' scenarios, discuss triggers, and so on.
Post Reply
User avatar
President Obama
Full Member
Posts: 110
Joined: Wed Mar 17, 2010 8:13 am
Lobby Username: President Obama
Location: Watching you from outside your window.

[Tutorial] Basic Triggers

Post by President Obama »

Basic Triggers!
Welcome to another one of my extreme tutorials, you should have read my other one, General information on triggers, so I don’t have to explain myself. This tutorial will be about things like modifying attributes of buildings and units, spawning units, changing unit names, changing unit size, tasking a unit to an area, delete/remove units, giving players resources, make players win/loose, make messages pop up, change ownership of a unit/building and changing alliances. There’s a lot I will be covering in this tutorial, you will get most of it after you do like 1 effect, but I’m bored so I’m going to go through most of it. I may show 1 or 2 pictures for each trigger but I don’t think you really need it. At the end I will include a download link for a scenario, which contains all the triggers I have mentioned. I will go into more conditional triggers next tutorial. After that I will be just making separate tutorials on small things like teleporters, glitches etc.

Spawning Units
Spawning units is pretty easy. First you got to go to the objects tab in the triggers menu. Second click new, click object specification (selecting units on map won’t work) and choose a unit. Now go to the Area’s tab and click new, select the area on the map where you want your units/buildings to spawn. Go back to your object and tick the box next to area. A drop down box will appear select your area. Flick to the effects tab and hit new. Now under where it says object click on the box and select your unit/building you want to spawn. Head to the triggers tab and hit new, under where it says effect click on the drop down box and select your effect. BAM you’re done. This is practically the same concept throughout the rest of the tutorial. So for the rest of the triggers I’m going to be very brief, just follow this method.

Modifying Unit/Building Attributes.
You can modify a whole class or some of the attributes of the unit on the map. First you got to select your object, this can be an object specification or unit selected on the map. There are two ways to modify unit attributes, these are unit attribute and class attribute. Unit attribute only increase the stats of the units selected. Class attribute changes the stats of the entire class, so if you select one unit on the map and modify one of its stats with class attribute it will change the stat or the rest of that unit on the map for that player. There are two health options, 1 in each category. The health option in unit attribute increase the health of a unit of the left hand side, for example a units health is 900/900, is you increase unit attribute by 600 it will look like this 1500/900. The opposite is for class attribute, it will increase 900/900 to 900/1500. Be careful with class attribute when you increase with unit on the map, it doesn’t will the left hand side, it only expands the amount of hp a unit can have. This is why when you use health triggers you should use both these effects. Now just add it to your triggers and your set. Each of these menus has separate things, like class attribute has speed while unit attribute doesn’t.
If you want to make a unit shoot faster, use the option in unit attribute called reload time, now DONT increase this as it makes it slower, so make sure to select the option to decrease. The same rule used for the other attributes. Just look in the menus until you find the one you want. Just so you know to increase speed, increase max velocity in class attribute.

Changing Unit Names

Dam right simple, make a new effect, select the effect menu and choose class name. Now to make it so when you hover over the unit the name appears put a SPACE before whatever you type and this will make it so the units name comes up when you hover your mouse over it. Just add it to a trigger and your good. Don’t forget to make a new object of the unit’s name you want to change and select it.

Changing Unit Size
You can make units really big, until the point it crashes the game or make it so small no one can see it at all. I recommend you use percentages here or small whole numbers like 1, 2, and 3. Go to effects, and click unit attribute. Then click on graphic scale, put a number in and select your object. Add it to your triggers and your good. Object specification doesn’t work on graphic scale unless it’s looped and set on exactly, I think. You have to choose a unit on the map.

Tasking a unit to an area.
Area tasking can be very handy. You can use it to keep players out of certain areas by looping it so when they go into a certain area they are sent to a different area. First you need 1 or 2 new areas depends on what you want. If you simply want to task a unit to an area you only need one, if you want to have it so when a unit goes in an area it’s sent to a different area, you need 2. Now go to objects and either select the unit you want to move, or go to object specification. If you are doing the 2 areas one, tick the area box and select the area you DONT want your unit to go to. If your not don’t worry about anything else. Now go to effects, hit new, select task area. Select your object and your area you want it go to. Head over to triggers and click new. If you’re doing the 2 area one, you should loop the triggers, if not don’t loop otherwise the unit won’t be able to move out of the area.

Kill/Remove Units
Make an object of the unit you want to remove/kill. Choose the effect kill or remove (only difference is kill, kills the unit, remove makes it disappear) and select your object. Add it to your triggers and your good.

Giving Players Resources/Modifying Population level.

This is a bit different from the other types of triggers so far. This time select the drop down box under the name box called type of effect and select player. Under action, select Set-Attribute Level. Select the player you want to change resources or set pop then select from the small menu what you want to take or give to them. If you want to give more pop, add to pop cap. All the other resources are there. Now add it to your triggers and your good.

Victory/Defeat
Very easy, in the same menu as above instead of clicking on Set-Attribute Level, select either victory or defeat. You can then add these to the triggers. I wont show this in the included scenario.

Dialogue/chat messages
In effects, under types of effects, choose media. Under action either choose dialogue or chat message. Difference is dialogue pops up with that annoying ok box and scrolling text which seems everyone ignores. Chat message it just like someone was talking. People tend to pay more attention to these; Type in whatever you want and add it to a trigger and your good.

Changing Ownership of a unit.
I’ve never really used this effect, but I know how it works. It’s not very common. Make a new effect, click on owner in the drop down box. Make a new object and select some units to be given to another player. Back in the effect add that object and you’re good. Add it to triggers and you’re done.

Modifying Alliances
Make a new effect, change type of effect to player. Select from the drop down menu, diplomacy. Now just select which player you want to be allied to whom or hostile to. Add it to the triggers and once again you’re done. I wont show this in the included scenario.

Well that comes to another conclusion of another one my excellent tutorials. In this one you have learnt a lot about triggers, but this is only the basic stuff. Conditions are next; they are the other half of effects. Effects are boring without conditions. I will cover this all in my next tutorial. I did take a lot of knowledge for granted in this tutorial, but I’m sure you can figure it out it’s not that hard. If I figured nearly all the scenario editor out by myself I’m sure you can do it. I have a included an uploaded scenario file of all the used triggers in this tutorial. Have a look at it if you get confused with any of the triggers here. There's about 1500 words in this tutorial, thats about 2 and half pages.

Here is the download link for the scenario:
Example Triggers
Image
This signature is only 17kb. That makes it ftw.

User avatar
Trichome Indica
Global Moderator
Posts: 535
Joined: Sun Dec 21, 2008 5:12 am
Lobby Username: ΤŖĪÇĦŐΜĔҗ Į ŊĎįċą җ
Location: Kitchener, Ontario. Canada
Contact:

Re: [Tutorial] Basic Triggers

Post by Trichome Indica »

:scratch: I didn't know that. Thanks
Image
Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind. ~Dr. Seuss

User avatar
President Obama
Full Member
Posts: 110
Joined: Wed Mar 17, 2010 8:13 am
Lobby Username: President Obama
Location: Watching you from outside your window.

Re: [Tutorial] Basic Triggers

Post by President Obama »

bump
Image
This signature is only 17kb. That makes it ftw.

Grigor

Re: [Tutorial] Basic Triggers

Post by Grigor »

I'm trying to make mercenaries: If (player)'s gold send to Player6 = 100 give (unit) to (player)
but I can't manage to do it

I want to make a condition wich triggers when (player) gives 100 gold to player6.
I am able to make a this one "(player)'s Gold send =100"
and also "player6's gold recieved = 100"
Is it possible to combine these two into something like "(player)'s Gold send to player 6 = 100"?

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: [Tutorial] Basic Triggers

Post by Udolf »

Grigor:
Just upload the scenario and i will try to make a workaround.

Grigor

Re: [Tutorial] Basic Triggers

Post by Grigor »

Udolf wrote:Grigor:
Just upload the scenario and i will try to make a workaround.
How do I upload it?

Udolf
Full Member
Posts: 123
Joined: Tue May 12, 2015 12:01 pm
Lobby Username: Udolf

Re: [Tutorial] Basic Triggers

Post by Udolf »

When you make an answer, look underneath the text box. There is "Options" and "Upload attachment". Click on "Upload attachment".
Then click on "select file" and select your scn file. Like this:
Attachments
test.scn
(60.56 KiB) Downloaded 565 times

Post Reply

Return to “Scenario Discussion”

Who is online

Users browsing this forum: No registered users and 7 guests