Page 1 of 5

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

Posted: Fri May 16, 2014 5:22 pm
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:

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

Posted: Sun Sep 07, 2014 10:02 pm
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

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

Posted: Wed Feb 04, 2015 8:26 pm
by balint
Hi,
please explain the condition with the counter a bit more... It is qjote complex..

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

Posted: Wed Feb 04, 2015 11:43 pm
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... :)

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

Posted: Wed Feb 04, 2015 11:48 pm
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?

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

Posted: Thu Feb 05, 2015 12:01 am
by COOLguy
Yes, I can't wait either. I think so - it's Daniel's nomenclature. It is number. :)

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

Posted: Thu Feb 05, 2015 3:26 am
by max-damage
Okay, thanks... ;-)

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

Posted: Thu Feb 05, 2015 6:06 am
by balint
thanks :)
thar was the problem with the christmas map then, because then it needed idk how many turns to win the map..

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

Posted: Thu Feb 05, 2015 2:02 pm
by max-damage
Yeah, in the Christmas map, travel time alone is around 100 turns and that's with no battles at all...

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

Posted: Thu Feb 05, 2015 2:41 pm
by patroid
Where we find this editor???????

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

Posted: Thu Feb 05, 2015 3:42 pm
by balint
Daniel can enable your profile to trigger the maps.

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

Posted: Thu Feb 05, 2015 10:48 pm
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.

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

Posted: Thu Feb 05, 2015 10:50 pm
by max-damage
...except that now the enemy counts are out of control!!! :shock:

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

Posted: Thu Feb 05, 2015 10:52 pm
by COOLguy
You make no sense.

And anyway, Enemies=Fun

I didn't come to play hopscotch... :)

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

Posted: Thu Feb 05, 2015 10:56 pm
by ejm29
Oh didn't you? I did! ;)

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

Posted: Thu Feb 05, 2015 10:58 pm
by COOLguy
lol - I came to play horseshoes. ;)

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

Posted: Thu Feb 05, 2015 11:04 pm
by max-damage
I thought this was the firing range? :twisted:

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

Posted: Fri Feb 06, 2015 8:33 am
by patroid
Daniel could you enable triggering for my undead
Campaign??

Patroid

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

Posted: Fri Feb 06, 2015 11:44 am
by Stratego (dev)
Please drop me an email with your username and i will build a version with u enabled.

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

Posted: Wed Feb 25, 2015 6:03 am
by Stratego (dev)
new trigger: Change Object Type
(up on server in an hour)

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

Posted: Wed Jun 03, 2015 3:51 pm
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?

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

Posted: Mon Jun 08, 2015 4:26 pm
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

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

Posted: Mon Jun 08, 2015 5:39 pm
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".

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

Posted: Wed Jun 10, 2015 5:38 pm
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?

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

Posted: Wed Jun 10, 2015 7:50 pm
by Stratego (dev)
maybe, can u send me a screenshot?

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

Posted: Thu Jun 11, 2015 4:55 am
by balint
I sent you in e-mail.

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

Posted: Sun Jun 14, 2015 8:21 pm
by Hardeep
For saving/loading, does it stick with your account if you switch devices?

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

Posted: Mon Jun 15, 2015 3:58 pm
by Stratego (dev)
no, send me the instead of saving if you want it to be persistently stored.

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

Posted: Mon Jun 15, 2015 9:33 pm
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

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

Posted: Wed Jun 17, 2015 9:26 pm
by Hardeep
How can I make it so the unit I apply a obj change ____ become a negative value? I only get positive.