Map design - TRIGGERS (eg. if the hero dies)
Posted: Fri May 16, 2014 5:22 pm
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:
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: