[Tutorial] Advanced Triggers: Conditions

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] Advanced Triggers: Conditions

Post by President Obama »

Advanced Triggers: Conditions.

Welcome to another one of my unappreciated tutorials. No one except indica has bothered to respond to my other tutorials with a simple thanks or anything. That’s why this tutorial has been so delayed, I’ve feel that there is no real need or rush for it. This tutorial will probably end up being the biggest one yet if I put enough time into it seeming conditions are practically everything when it comes to triggers. I’ll show in these tutorial, things like kill metres and setting up traps etc.

General Information

Just some info about conditions. There are 2 types of conditions, 1 normal condition’s found under the conditions tab and 2 object conditions these are conditions that are objects with parameters. Normal conditions aren’t very common, only for things like kill meters, checking if a player has the right amount of resources and for checking chat. Not many uses for them. Now object conditions are used majorly like they are everything and are probably easiest to do as well. Object conditions are used for things like checking if things are alive, selecting things, checking if certain things are in areas, if a unit has the right amount of hp, preventing engineer mining and sooo many other uses.

Kill Meter

A kill meter uses normal conditions + effects. It’s very easy to do and now thanks to omegas patches you don’t have to spend the time worrying about variables and shit. First you got to go the conditions tab and make a new one. Leave it as is. Now select the box which should say stone and change it to units killed. In the box next to it which has = in it, change it to > not >=. Then click Player Attribute and then select Player 1 in the top box and the resource you would like to increase when a player gets a kill. Now head over to the effects tab and hit new, change the type of effect to player. Under where it says action click on the drop down box and select SAL (set attribute level). Change attribute to the resource you are using, so if you chose stone in conditions you would choose stone here. Then increase by 1. It doesn’t have to be 1. Head on to the triggers tab and hit new, simply in the conditions box select your condition and in the effects box select your effect and LOOP IT! Done you just made a kill counter for Player 1. If you wanted to do it to every play you would have to go though and do each one of them for each player and make a new trigger for each one.

Spawning a certain amount of units.

So you started spawning units and tasking them to an area like in bxing (the worse scenario ever) but couldn’t get them to stop right? Well here’s your solution, a simple normal condition. Make a new condition change the stone to “Current Pop” with the < sign, Select use player attribute change it to player 1 or whoever and the other box to Pop Cap. Now just add this to your trigger as a condition and your good to go.

Checking for speech commands.

This is quite easy but there’s a downside, you CANT detect chat from a certain person. This is why you see in a lot of scenarios you have to select something and type something. I’ll show both here. To just detect something written in chat all you got to do is change the type of the condition to “Chat message contains” and type in what you want. The chat detection isn’t case sensitive. Now to make it more player specific, you make certain objects have to be selected and that chat message appear for the effects to work. So you do what I just said then make a new object, select the object you want select then click in the box which says selected by and select who you want it to be selected by. Now head over to the triggers tab and make a new one. Add your chat condition then change end to and then select your object. Add your effects and you’re done.
How to defeat someone if there wonder or building or w/e is destroyed.
Very simple stuff, though I will say here instead of defeating someone, just delete all their units and buildings or turn off their spawning so then they can still talk to people in game. Make a new object; select whatever building/unit you want. Make your defeat effect. Go to triggers now go to conditions and select your object, then tick the box next to it under not. Add your effect and your good to go.

Checking if a unit is in a certain area.

Once again easy stuff. Go select an area in which you want something to happen. Now go to objects and make a new one, you can use either object spec or select a unit then tick the box “In area” then select your area. Add it to your conditions in a trigger and add your effects and your good once again.

Checking the hp of a unit (Or any other stat).

Make a new object, select whatever unit you want. Tick the box “has attribute” and select hit points. Make sure it has a tick, not a cross. A cross turns it into has not attribute. Now if you wanted self healing, you would set min to 100 and max to 120 and select percent. Add it to your trigger and tick the not box. Then you would add an effect to add hp to that unit and loop it. To da done.

Disabling Engineer Mining.

Now for the reason you’re probably reading this, how to stop engineer mining in all them role-play scenarios. It’s quite easy. You first make an object specification of an engineer for each player. Tick the has attribute box and change it to stone, gold or food. If you wanted to stop engineer mining for all of them you would have to do one for each one. Enter in the boxes min 1, max 5 or 1 doesn’t really matter. Make a new trigger for each object and then add an effect which would stop it. The most common one is to delete them, but that’s annoying to people. I like to make it even more annoying and set the engineers to explore hehehe. You can do lots of things, you could also just remove the resource before its added, so it looks like the engineer is mining but the player won’t get the resources to be even more annoying.

Right, this is the end of this tutorial. It’s not as large as the other ones but it contains pretty much everything to set you on your way. You can probably figure out everything else now. Now, I’m going to start writing ones up on specific things like how to make teleporters, tricks of the trade and glitch’s. There is a big time gap between this one and the last one I wrote, sorry about that guys but nobody has been saying thanks so it hasn’t given me any motivation to write. As it is, I’m purely writing this one out of pure boredness. I’m hoping more people will start making scenarios soon. Look out for my new one BullzEye, I’ve almost worked out all the bugs and glitch’s and general fuck ups lol. Till next time cya.

On a side note, I probably should make a scenario showing all this, I might do that in a minute. This is 1,258 words long and thats 2 pages long.

EDIT: Ok done it, heres the link Example Conditions
Image
This signature is only 17kb. That makes it ftw.

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] Advanced Triggers: Conditions

Post by President Obama »

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

Post Reply

Return to “Scenario Discussion”

Who is online

Users browsing this forum: No registered users and 9 guests