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

Stratego (dev)
Site Admin
Posts: 15734
Joined: Fri Apr 25, 2014 9:28 pm

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

Post by Stratego (dev) »

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

a few video about triggers:

https://www.youtube.com/watch?v=iazgojs33_E
https://www.youtube.com/watch?v=yoNreukGEX0


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/d ... -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/d ... -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 18036 times
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)

Post by Hardeep »

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
There never was much hope... just a fool's hope
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

Hi,
please explain the condition with the counter a bit more... It is qjote complex..
This is Hungary and winter is coming.
User avatar
COOLguy
Posts: 4005
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

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

Post by COOLguy »

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
max-damage
Posts: 548
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

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

Post by max-damage »

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...
User avatar
COOLguy
Posts: 4005
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

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

Post by COOLguy »

Yes, I can't wait either. I think so - it's Daniel's nomenclature. It is number. :)
Thanks!
Josh
max-damage
Posts: 548
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

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

Post by max-damage »

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...
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

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.
max-damage
Posts: 548
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

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

Post by max-damage »

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...
User avatar
patroid
Posts: 1202
Joined: Fri Aug 08, 2014 10:58 am
Location: Germany, Berlin

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

Post by patroid »

Where we find this editor???????
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

Daniel can enable your profile to trigger the maps.
This is Hungary and winter is coming.
User avatar
COOLguy
Posts: 4005
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

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

Post by COOLguy »

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
max-damage
Posts: 548
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

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

Post by max-damage »

...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...
User avatar
COOLguy
Posts: 4005
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

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

Post by COOLguy »

You make no sense.

And anyway, Enemies=Fun

I didn't come to play hopscotch... :)
Thanks!
Josh
ejm29
Posts: 689
Joined: Sat Nov 01, 2014 6:03 pm
Location: United Kingdom

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

Post by ejm29 »

Oh didn't you? I did! ;)
"I don't care who I have to step on on my way down."
User avatar
COOLguy
Posts: 4005
Joined: Sat Jul 12, 2014 2:58 am
Location: Nenuial, Arnor

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

Post by COOLguy »

lol - I came to play horseshoes. ;)
Thanks!
Josh
max-damage
Posts: 548
Joined: Mon Jan 19, 2015 1:04 am
Location: right behind you...

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

Post by max-damage »

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...
User avatar
patroid
Posts: 1202
Joined: Fri Aug 08, 2014 10:58 am
Location: Germany, Berlin

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

Post by patroid »

Daniel could you enable triggering for my undead
Campaign??

Patroid
Stratego (dev)
Site Admin
Posts: 15734
Joined: Fri Apr 25, 2014 9:28 pm

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

Post by Stratego (dev) »

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

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

Post by Stratego (dev) »

new trigger: Change Object Type
(up on server in an hour)
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

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
Hardeep
Posts: 1121
Joined: Mon May 05, 2014 11:06 pm
Location: Isengard, middle earth

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

Post by Hardeep »

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
There never was much hope... just a fool's hope
Stratego (dev)
Site Admin
Posts: 15734
Joined: Fri Apr 25, 2014 9:28 pm

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

Post by Stratego (dev) »

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".
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

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.
Stratego (dev)
Site Admin
Posts: 15734
Joined: Fri Apr 25, 2014 9:28 pm

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

Post by Stratego (dev) »

maybe, can u send me a screenshot?
User avatar
balint
Posts: 1268
Joined: Mon Apr 28, 2014 6:38 pm
Location: Hungary

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

Post by balint »

I sent you in e-mail.
This is Hungary and winter is coming.
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)

Post by Hardeep »

For saving/loading, does it stick with your account if you switch devices?
There never was much hope... just a fool's hope
Stratego (dev)
Site Admin
Posts: 15734
Joined: Fri Apr 25, 2014 9:28 pm

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

Post by Stratego (dev) »

no, send me the instead of saving if you want it to be persistently stored.
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)

Post by Hardeep »

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
There never was much hope... just a fool's hope
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)

Post by Hardeep »

How can I make it so the unit I apply a obj change ____ become a negative value? I only get positive.
There never was much hope... just a fool's hope
Post Reply

Return to “Map Design”