Need some help with Triggers

Talk about anything EE related and doesn't belong in another forum. Gameplay, chit-chat, or any questions you have -- it all belongs here.
Post Reply
User avatar
Minato
Basic Member
Posts: 29
Joined: Wed Aug 27, 2014 7:13 pm

Need some help with Triggers

Post by Minato »

Hi all
Anyone know how to do the trigger for this ?

I'm trying to make a little city ( walled and got houses inside it) and there are 30 swords in it ,, this city is an enemy for all players as long as no one control it , to control it you have to kill as least 20 swords then the castle turn to be yours and a new sword is out every 10 seconds and still you might lose it if another player do the same as you did .. oh and the swords who spawn in the city can't get out of it
I know I didn't give it a clear explanation but if you ever played " Dynasty Warriors " you should understand it easily ..


Sorry for poor English
Thanks for reading
You are free to choose, but you are not free from the consequences of your choice.

B1tchFight
Novice Member
Posts: 10
Joined: Tue Jul 12, 2016 6:49 pm
Lobby Username: B1tchFight

Re: Need some help with Triggers

Post by B1tchFight »

The Basic idea of what you want to do is pretty simple. The only thing I don't know if is this "Unit dies indie the wall". I did around 100 scens the last 12 years but never used something like that. I think that's done with

"Area_1"(The area inside the walls) "Object_1(any player) - selected from list - in area_1" "Condition - Object_1 unit lost == 20" "effect - Object_2 changes Team" (Object _2 will be the entire fortress selected on the map)
(Player X is here the Bot player that original occupy the fortress)
You can close the gates but in this case you can't go inside or leave with other troops. No other way to force a player to stay inside an area with specific units.

Like I said I am not sure about the "object died INSIDE a specific area". But from the logic aspect it should work. If you give me feedback here I could give it a try. Since the post is 2 weeks old I am not starting it without feedback. :P

The problem is that after the Fortress goes over to another player you need a trigger for this one as well. 2 ways: 1. having a trigger like this for all player always active and in a loop 2. after the first capture the fortress it starts the trigger for the others.


Since you don't want to leave the fortress with those soldiers you could make it WAY easier. Because the unit spawn trigger you want needs to be done for every single player as well.
"Player_X is enemy to all" "After Player_1 killed 20 units Player X switches to ally" Do the same trigger for each player. You can't control those units but you can set up that AI player to stand down in a def position. So he wouldn't leave the fortress.
My idea is about 10 times as fast to set up and has about the same purpose. ;)

User avatar
Minato
Basic Member
Posts: 29
Joined: Wed Aug 27, 2014 7:13 pm

Re: Need some help with Triggers

Post by Minato »

B1tchFight wrote:The Basic idea of what you want to do is pretty simple. The only thing I don't know if is this "Unit dies indie the wall". I did around 100 scens the last 12 years but never used something like that. I think that's done with

"Area_1"(The area inside the walls) "Object_1(any player) - selected from list - in area_1" "Condition - Object_1 unit lost == 20" "effect - Object_2 changes Team" (Object _2 will be the entire fortress selected on the map)
(Player X is here the Bot player that original occupy the fortress)
You can close the gates but in this case you can't go inside or leave with other troops. No other way to force a player to stay inside an area with specific units.

Like I said I am not sure about the "object died INSIDE a specific area". But from the logic aspect it should work. If you give me feedback here I could give it a try. Since the post is 2 weeks old I am not starting it without feedback. :P

The problem is that after the Fortress goes over to another player you need a trigger for this one as well. 2 ways: 1. having a trigger like this for all player always active and in a loop 2. after the first capture the fortress it starts the trigger for the others.


Since you don't want to leave the fortress with those soldiers you could make it WAY easier. Because the unit spawn trigger you want needs to be done for every single player as well.
"Player_X is enemy to all" "After Player_1 killed 20 units Player X switches to ally" Do the same trigger for each player. You can't control those units but you can set up that AI player to stand down in a def position. So he wouldn't leave the fortress.
My idea is about 10 times as fast to set up and has about the same purpose. ;)
Great ! I'm actually not really good in triggers but do you think it's possible? I have no clue how to do it..
sure we can change a lot of things if necessary :D

Never expected someone to actually care about this post :thumbsupr:

Oh and about the units who can't get out of the castle , if it's hard to do then ..uhm

When player1 kills 20 swords inside the walls , the castle will be controlled by a certain computer who is an ally to Player1 , I think it can be easier if the computer units can't get out of the castle area ( I mean we don't have to care about Exceptions , all the units who belong to that computer ,, can't get out of area1)
Shouldn't that be a bit easier?
You are free to choose, but you are not free from the consequences of your choice.

B1tchFight
Novice Member
Posts: 10
Joined: Tue Jul 12, 2016 6:49 pm
Lobby Username: B1tchFight

Re: Need some help with Triggers

Post by B1tchFight »

As far as I know there is no such a trigger that says "don't leave area".

But the AI can be set up to stand down as I said. Or you can just put every spawned unit into a guard position. They wouldn't move away. And if they do they go back after they lost or killed the target.

You know... the difficult part about what you want to do is clearly the fact that the fortress is switching players all over again. That means end up with a really complicated endless loop. I think it would take a while to dig into it. Anyway... if you play against AI they would suck that up :P So forget about it. Stick with the ally mechanic! That's the best solution I can offer you. I am not aware of another idea.

If you need help with the actual trigger, just ask... ;)

User avatar
Minato
Basic Member
Posts: 29
Joined: Wed Aug 27, 2014 7:13 pm

Re: Need some help with Triggers

Post by Minato »

Actually YEAH ! I'm totally Newbie to the triggers thing , it would be great if you can give me some samples like if a unit leave area1 then another unit spawn in area1 or anything else can be good
You are free to choose, but you are not free from the consequences of your choice.

B1tchFight
Novice Member
Posts: 10
Joined: Tue Jul 12, 2016 6:49 pm
Lobby Username: B1tchFight

Re: Need some help with Triggers

Post by B1tchFight »

All you have to do is to understand the logic. For me it was as simple as my native language because I started programming with 8 years. Actually 6 but HTML is just a Markup Language. :D

I will try to shorten it. So please tell me if this is to short: ^^

Area - new - select a point or area on the map, name it Area1, save. Do it again and call it Area2

Object - new - object specification (right side drop down menu) Player1 - any family - class: Long sword - object none.
In the same object you check the "area" checkbox right below the list of objects - select Area1 (this will be your spawn area) Name this object "P1_Long_Sword"

Effect: NEW - (type: object) Creat - "P1_Create_Long_Sword"
Effect: NEW - (type: object) Task Area - "P1_Creat_Long_Sword" - "Area2" - "Attack Move" Name it: P1_Long_Sword_Move

Condition: (Type: Player attributes) Player1 - Current Pop <= use value 5 (name it P1_Spawn_Pop_Limit)

The trigger is also pretty simple. The 1st value is the condition the one below the effect. If you put 2 condition with an ampersand then both needs to be true. Put it with a "OR" operator and only 1 of them needs to be true.
Same happens with the effect. & (all will start) OR(one of them will) You can also mix them up. 1&2 OR 3&4

Trigger: New - Trigger ON - Condition TRUE (just the wait time until it goes off after the conditions are reached) For that test you want to put in 5 Seconds! - Looping (it's obvious or not? ^^)

First condition field: P1_Spawn_Pop_Limit
First Effect field: P1_Create_Long_Sword >>>>>AND<<<<< Second Effect: P1_Long_Sword_Move

DONE

Now you can quick save and test it. After the units spawned select them DEL(to self kill) and keep watching how they spawn! Let's check what we basically set up:

We have an area1 to spawn a unit in and a object set up from the LIST to spawn in an area1. The Effect will spawn the object WITH the area1 >>> IF <<< The current pop is Lower OR same as <= 5 AND they move to the Area2 you created as destination.

To make your triggers easier, try to write those things down in text form. You need to know what you want to build up before you start.

If you like you can add me on Skype or join my TS Server and we can talk: TS 3 Add: 178.33.77.80:1280 NO PW (just poke me there!)

It might better to lead you step by step. Maybe with teamviewer if you know that.

User avatar
Minato
Basic Member
Posts: 29
Joined: Wed Aug 27, 2014 7:13 pm

Re: Need some help with Triggers

Post by Minato »

I tried it and it worked perfectly , so what should I do to complete it? I mean the next step is to make this base an enemy base then I have to kill an amount of the swords to make it belong to me, do you know how to do that one?
BTW :arrow: Thanks :thumbsupl:
You are free to choose, but you are not free from the consequences of your choice.

B1tchFight
Novice Member
Posts: 10
Joined: Tue Jul 12, 2016 6:49 pm
Lobby Username: B1tchFight

Re: Need some help with Triggers

Post by B1tchFight »

Edit: Most important thing about EE Scenario building is that you CAN'T play a map in Multiplayer if you created it from scratch in the Editor. I never managed a way to work it out. So I am happy if someone can help me. If you want a scenario playable in Multiplayer together with friends you >>> NEEEEEED <<< to modify a save game. That means you start a match with someone, save it, go into the save game folder, "show file extensions", rename it from .ees into .scn and copy paste the file into the scenario folder. You can change everything inside the editor now. Map, # of bots, names and so on. But the amount of real player AND the names of real player ALWAYS STAY! Once you are done you save it, rename it back to .ees and put it into the save game folder. Important thing here is that the player in the lobby are FORCED to have the same name as they had when the map the first time started. Also the same amount. Otherwise you can't start. So before you do anything you have to be sure about the player number and the player names. Those are not changeable (tell me if you know how once you learned it) This is the reason why basically all known scenarios are made with names like: Player1 Player2 Player3 or GREEN, BLOO, PURPLE, YELLOW and so on. If you want, I can give you a 2 player scenario. Player Names are: GREEN and BLOO

Back to your Tutorial:

Just create the base with all the objectives you want the AI to have. (The AI should own it at the beginning)

First we go with the ally system because this one is way easier.

Important: If THIS base switches the allies to players then everything that belongs to that player is switching. So you might want to create some new AI players if you like to have more than just one fort. And just repeat all steps for the others.

I go with the very short one now without explanations this time since you got the last one. (PlayerX = AI Base) The mechanic with the variables can get confusing. Just set up as I say and I explain the meaning later if you don't get it yourself. It's a bit tricky. I hope I get it right.

Effect1: Type: player - Diplomacy - PlayerX - Player 1 - allied
Effect2: Type: player - Diplomacy - PlayerX - Player 2 - allied
Effect3: Type: player - set attribute Level - PlayerX - Variable 0 - exact 20
Effect4: Type: player - Diplomacy - PlayerX - Player 1 - Enemies
Effect5: Type: player - Diplomacy - PlayerX - Player 2 - Enemies

Condition1: Type: Player-Attribute - Player1 - units killed >= Use Player Attribute PlayerX Variable0
Condition2: Type: Player-Attribute - Player2 - units killed >= Use Player Attribute PlayerX Variable0

Trigger1: Trigger ON, Loop, no timer
Condition1
Effect 1 AND Effect 3 AND Effect 5

Trigger2: Trigger ON, Loop, no timer
Condition2
Effect 2 AND Effect 3 AND Effect 4


That should work.

We basically have a Condition1 now that says "If player1 has killed >= (Variable1) of enemies from playerX THAN Player X switches the Team to Player 1 AND and hostile to Player 2. Reverse on condition 2.

The Variable is set to inc. by 20. That means once the "unit kill counter" in Condition1 reaches 20 the effect starts. After that Effect3 says "Inc. the kill counter by 20. So the current counter is 20 and the next goal is 40 kills. +20 next goal 60 kills. But just in steps of 20. This variable thing took me some time to figure out myself.

Without testing I am not 100% sure if it works that way. Last time I used a function like that is quite a while ago. I mostly use simple killcounter and add Stone / Gold / Iron per kill to "buy" units. (love that function) Most of my scenarios are made with it.

Edit: I am not really sure if this works with the variables this way since both player using the same variable. But since you have a kill step of 20 each time it goes off it should be save. And since one of the player is always ally the kill number can't overwrite each other. Having more Actual player or bots then it will be difficult. You need one variable for each player / AI.

EDIT: I forgot to mention that you have to make this ally system for each way. Means PX becomes Ally with P1 AND P1 becomes Ally with PX. After P2 captures that fortress you have to do the same with P2 BUT breaking ally between P1 - Px AND PX - P1 Bit confusing :D

Post Reply

Return to “EE General Discussion”

Who is online

Users browsing this forum: No registered users and 12 guests