Map design - TRIGGERS (eg. if the hero dies)

Here you may find answers to your questions.

Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Fri May 16, 2014 5:22 pm

I have implemented a similar TRIGGER logic what the Age of Kings engine had (has).

ATTENTION! This text is NOT UPDATED ANYMORE! Read the on-device help of the mapeditor (all new trigger options will be listed only there).


Using these triggers during a campaign map building, you can define any even in any condition combination to tell if some of the effects can get executed.
(The first TUTORIAL MAP in Age of Strategy is created with these triggers!)

Examples: for better understanding:
- if your hero (a selected unit) dies than your opponent wins.
- if your knight OR your hero dies you lose.
- if your knight AND your hero dies you lose.
- if your knight reaches a certain area of the map you win
- you own 3 lonbowman and 3 elephant archer than you win.
- if a specific unit dies, than an other kind of unit spawns from nowhere instead (or three)
- if player has more than 20 units, than AI places a castle somewhere.
and so on.

Conditions: Currently these conditions are implemented:
- "is the specified uint died?" (in editor mandatory to fill: condition type, objXY)
- Cond: Obj in area: "is the given unit reached/arrived to the given area on the map?" (fill: condition type, objXY, AreaXY+AreaXY2)
- Cond: Objs in area: "is the defined (player/type/number) units reached/arrived to the given area on the map?" (fill: effect type, Nr1 (number of units), AreaXY, AreaXY1, optional:Player1, ObjType - if given then only those obj types are checked)
- "does unit have no more movement?" (fill: condition type, objXY)
- "does unit have no more action possibility?" (fill: condition type, objXY)
- "does player owns the object?" (fill: condition type, objXY, player1)
- "obj1 beside/in obj2" (if the distance betw. them is <2) (fill: condition type, objXY, objXY2)
- "player1 has started turn nr1" (true if he starts the given turn currently or passed that turn) (fill: condition type, Player1, Nr1)
- "player1 turn counter of nr1 reached 0" (every check on this condition decreases an internal counter from NR1, every new turn induces a condition check, true if the countdown reached 0, do not use it with other conditions, or expect that other condition checks in same trigger can decrease counter) (fill: condition type, Player1, Nr1)

Effects: And currently only this events can be executed:
- Given player wins (fill: effect type, Player1)
- a chat message is shown to the player (fill: effect type, Player1, Message)
- a dialog message is shown to the user (fill: effect type, Player1, Message)
- a toast message (that appears for a few seconds only) message is shown to the user (fill: effect type, Player1, Message)
- another defined trigger gets turned off (fill: effect type, Nr1 (as TriggerID))
- another defined trigger gets turned on (fill: effect type, Nr1 (as TriggerID))
- reveal spot with x,y center (fill: effect type, AreaXY)
- change object (unit/structure) owner (fill: effect type, ObxXY, Player1)
- delete object (unit/structure) (fill: effect type, ObxXY)
- enable/disable Object (eg. a TC or a unit) (fill: effect type, ObxXY)
- change view (moves the camera/viewport to XY location) (fill: effect type, AreaXY)
- create obj to AreaXY for playerNr1 (fill: effect type, ObjType, AreaXY, Player1)
- create multiple objs in AreaXY-toAreaXY for playerNr1 (fill: effect type, ObjType, AreaXY+toAreaXY, Nr1 (max number of units, if 0 than fills up the whole area), Player1)
- change objects owner in area (fill: effect type, AreaXY, AreaXY1, Player2, optional:Player1, ObjType - if given then only those obj types are affected)
- delete objects in area (fill: effect type, AreaXY, AreaXY1, optional:Player1, ObjType - if given then only those obj types are affected)
- enable/disable objects in area (fill: effect type, AreaXY, AreaXY1, optional:Player1, ObjType - if given then only those obj types are affected)
- Change Object Name (fill: ObjXY, Message) - the obj name will be the text in the message field
- Change Object Hp (fill: ObjXY, Number1) - Hp will change by the value you give in Number1 (adds or substracts), the maximum is the HpMax value, the minimum is 0, and at 0 there the unit will be deleted
- Change Object Attack (fill: ObjXY, Number1) - Attack will change by the value you give in Number1 (adds or substracts), the maximum is infinity, the minimum is 0

- Change Object movement(fill: ObjXY, Number1) - movement will change by the value you give in Number1 (adds or substracts), the maximum is infinity, the minimum is 0
- Change Object action points(fill: ObjXY, Number1) - action points will change by the value you give in Number1 (adds or substracts), the maximum is infinity, the minimum is 0
- Change Object range(fill: ObjXY, Number1) - attacks range will change by the value you give in Number1 (adds or substracts), the maximum is infinity, the minimum is 0
- Change Object area effect(fill: ObjXY, Number1) - attack area effect will change by the value you give in Number1 (adds or substracts), the maximum is infinity, the minimum is 0

- Change Object Position (fill: ObjXY, AreaXY) - The unit will be moved to target location (!)if possible(!) (checks: it can walk on that terrain, the tile is not occupied, or if there is a carrier there is space for him in the carrier)
- Change Object Type (fill: ObjXY, ObjType) - The unit will be changed to new unit type (loses everything he previously owned like actual hp, hp will be full hp)

This is enough for first steps and the engine is ready, and if you check this link ( http://aok.heavengames.com/university/design/trigger-tutorial/ ) you can ask me almost any of these triggers to be implemented, they will be not so much time, since the engine is ready.
(you also can come up with new trigger ideas)

So feel free to think over your existing and upcoming campaign map designs with these triggers.


Quick guide for those who have grant (ask if you need one) to the trigger editor:
- you see checkboxes under your campaign map (before launching it)
- "Modify Map" -> if checked you will run the map in edit mode (use the "Launch"/"restart map" button)
- "Reset game definition" -> if checked than the trigger modifications you did is removed and the initial trigger definitions, the ones are compiled with the .apk (if there were any) will bo loaded (you modifications are deleted) - (use the "Launch"/"restart map" button for it)

What you do:
1. launch your map in modify mode (with launch/restart)
2. edit your triggers (see image belof for quick guide)
3. exit map
4. start your map in normal (not modify mode) to see how your triggers work
5. (here you can do 1..4 any time until your triggers are final)
6. now go in in modify mode again, and hit the "send" button - it will send me the trigger definition and if i compile that in then your map will run with those triggers after publishing.

If you do not understand how triggers work then read this http://aok.heavengames.com/university/design/trigger-tutorial/ - i have implemented the same engine.

the image for quick guide for the buttons:
Attachments
triggers2_commented.png
triggers2_commented.png (146.12 KiB) Viewed 13047 times
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Hardeep » Sun Sep 07, 2014 10:02 pm

New trigger patrol units: you make units in rectangular area and they go from a point to another point until they see a unit within 3 tiles, they then attack the unit and hunt down any remaining enemys
THE WHITE HAND WILL NOT BE STOPPED!
ISENGARD WILL PREVAIL!
Durbgu nazgshu, Durbgu dashshu!
Durbgu nazgshu, Durbgu dashshu!

Image
User avatar
Hardeep
 
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Wed Feb 04, 2015 8:26 pm

Hi,
please explain the condition with the counter a bit more... It is qjote complex..
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby COOLguy » Wed Feb 04, 2015 11:43 pm

I think I can.

You use the counter as the ONLY condition in a given trigger. It counts the number of turns down from when it is activated. So deactivate it at the beginning, and have a separate trigger activate it. This is different from the Player nr's turn nr has started.

EXAMPLE: I want to make it so that 5 turns after I kill a certain Spartan, I win.

trigger1 - Conditions are( object xy is destroyed {I put in the coordinates of the Spartan} ); Effects are( trigger2 is activated ) // Here, I have said that when the Spartan (obj xy) is destroyed, the not-yet-existent trigger2 is activated
trigger2 - Conditions are( Countdown in nr turns for player nr {I put in 5 as nr and 1 as player nr} ); Effects are( Declare victory for player nr {I put in 1 as player nr} ) // Here, I have said that after 5 turns from when trigger2 is active player 1 will win --> This trigger MUST be deactivated at the beginning of the map, or 5 turns into the game, player 1 will win for no reason
trigger3 - Conditions are( Player nr's turn nr has started {I put in I for player nr and 1 for nr} ); Effects are( Deactivate trigger nr {I put in 2 as nr} ) // Here, I have deactivated trigger2

I hope I am making sense... :)
Thanks!
Josh
User avatar
COOLguy
 
Posts: 3758
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby max-damage » Wed Feb 04, 2015 11:48 pm

Sounds logical...i can't wait to get my laptop back so i can start making maps...i assume when you say "nr" it's short for "designation number"...right?
It's better to keep your mouth shut and let people wonder if you're a fool than to open it and remove all doubt...
max-damage
 
Posts: 550
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby COOLguy » Thu Feb 05, 2015 12:01 am

Yes, I can't wait either. I think so - it's Daniel's nomenclature. It is number. :)
Thanks!
Josh
User avatar
COOLguy
 
Posts: 3758
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby max-damage » Thu Feb 05, 2015 3:26 am

Okay, thanks... ;-)
It's better to keep your mouth shut and let people wonder if you're a fool than to open it and remove all doubt...
max-damage
 
Posts: 550
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Thu Feb 05, 2015 6:06 am

thanks :)
thar was the problem with the christmas map then, because then it needed idk how many turns to win the map..
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby max-damage » Thu Feb 05, 2015 2:02 pm

Yeah, in the Christmas map, travel time alone is around 100 turns and that's with no battles at all...
It's better to keep your mouth shut and let people wonder if you're a fool than to open it and remove all doubt...
max-damage
 
Posts: 550
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby patroid » Thu Feb 05, 2015 2:41 pm

Where we find this editor???????
User avatar
patroid
 
Posts: 1099
Joined: Fri Aug 08, 2014 10:58 am
Location: Germany, Berlin

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Thu Feb 05, 2015 3:42 pm

Daniel can enable your profile to trigger the maps.
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby COOLguy » Thu Feb 05, 2015 10:48 pm

Yes there was a bug with the Christmas map, so sometimes you won by doing it the right way and other times it didn't let you win. I thought I had fixed it though. It is a fun map.
Thanks!
Josh
User avatar
COOLguy
 
Posts: 3758
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby max-damage » Thu Feb 05, 2015 10:50 pm

...except that now the enemy counts are out of control!!! :shock:
It's better to keep your mouth shut and let people wonder if you're a fool than to open it and remove all doubt...
max-damage
 
Posts: 550
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby COOLguy » Thu Feb 05, 2015 10:52 pm

You make no sense.

And anyway, Enemies=Fun

I didn't come to play hopscotch... :)
Thanks!
Josh
User avatar
COOLguy
 
Posts: 3758
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby ejm29 » Thu Feb 05, 2015 10:56 pm

Oh didn't you? I did! ;)
User avatar
ejm29
 
Posts: 681
Joined: Sat Nov 01, 2014 6:03 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby COOLguy » Thu Feb 05, 2015 10:58 pm

lol - I came to play horseshoes. ;)
Thanks!
Josh
User avatar
COOLguy
 
Posts: 3758
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby max-damage » Thu Feb 05, 2015 11:04 pm

I thought this was the firing range? :twisted:
It's better to keep your mouth shut and let people wonder if you're a fool than to open it and remove all doubt...
max-damage
 
Posts: 550
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby patroid » Fri Feb 06, 2015 8:33 am

Daniel could you enable triggering for my undead
Campaign??

Patroid
User avatar
patroid
 
Posts: 1099
Joined: Fri Aug 08, 2014 10:58 am
Location: Germany, Berlin

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Fri Feb 06, 2015 11:44 am

Please drop me an email with your username and i will build a version with u enabled.
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Wed Feb 25, 2015 6:03 am

new trigger: Change Object Type
(up on server in an hour)
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Wed Jun 03, 2015 3:51 pm

Hi
Someone please explain me how to use the objects change ownere in area, because it doesnt work for me. I add the area, the unit type and the player number who will receivd the converted units. Did I do something wrong?
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Hardeep » Mon Jun 08, 2015 4:26 pm

balint wrote:Hi
Someone please explain me how to use the objects change ownere in area, because it doesnt work for me. I add the area, the unit type and the player number who will receivd the converted units. Did I do something wrong?

I think you need to add first player number who units are affected then who will receive it, or vice versa
THE WHITE HAND WILL NOT BE STOPPED!
ISENGARD WILL PREVAIL!
Durbgu nazgshu, Durbgu dashshu!
Durbgu nazgshu, Durbgu dashshu!

Image
User avatar
Hardeep
 
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Mon Jun 08, 2015 5:39 pm

change objects owner in area (fill: effect type, AreaXY, AreaXY1, Player2, optional:Player1, ObjType - if given then only those obj types are affected)


this means: in area (AreaXY + AreaXY1) all units become owned by player defined in "player2".
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Wed Jun 10, 2015 5:38 pm

I don't have a player 2 field.
this explains it :D
Daniel could it be because of screen size? Or the editor has some issue?
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Wed Jun 10, 2015 7:50 pm

maybe, can u send me a screenshot?
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby balint » Thu Jun 11, 2015 4:55 am

I sent you in e-mail.
This is Hungary and winter is coming.
User avatar
balint
 
Posts: 1274
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Hardeep » Sun Jun 14, 2015 8:21 pm

For saving/loading, does it stick with your account if you switch devices?
THE WHITE HAND WILL NOT BE STOPPED!
ISENGARD WILL PREVAIL!
Durbgu nazgshu, Durbgu dashshu!
Durbgu nazgshu, Durbgu dashshu!

Image
User avatar
Hardeep
 
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Stratego (dev) » Mon Jun 15, 2015 3:58 pm

no, send me the instead of saving if you want it to be persistently stored.
Stratego (dev)
Site Admin
 
Posts: 6437
Joined: Fri Apr 25, 2014 9:28 pm

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Hardeep » Mon Jun 15, 2015 9:33 pm

Daniel (the dev) wrote:no, send me the instead of saving if you want it to be persistently stored.

Bad news for moria, but I have a backup stored
THE WHITE HAND WILL NOT BE STOPPED!
ISENGARD WILL PREVAIL!
Durbgu nazgshu, Durbgu dashshu!
Durbgu nazgshu, Durbgu dashshu!

Image
User avatar
Hardeep
 
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

Re: Map design - TRIGGERS (eg. if the hero dies)

Postby Hardeep » Wed Jun 17, 2015 9:26 pm

How can I make it so the unit I apply a obj change ____ become a negative value? I only get positive.
THE WHITE HAND WILL NOT BE STOPPED!
ISENGARD WILL PREVAIL!
Durbgu nazgshu, Durbgu dashshu!
Durbgu nazgshu, Durbgu dashshu!

Image
User avatar
Hardeep
 
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

Next

Return to FAQ

Who is online

Users browsing this forum: No registered users and 1 guest