Events
As of last week the KaM Remake has its own event system support. How do you use it? You create a mission_name.evt file with certain instructions and it is handled by the game.
Here's the example syntax for the Town Tutorial map:
How does it works? Each line is an event. First comes Trigger (that sets event off) with player index and parameters, then comes Action (what will happen) with player index and parameters as well.
E.g. "HOUSE_BUILT 0 5 SHOW_MESSAGE 0 17" means that when Player0 has built house type 5 he will receive a message #17.
So far the dictionary is very short - only 3 available triggers and 3 actions:
Triggers
DEFEATED //[] Certain player has been defeated, we rely on Conditions to generate that event
TIME //[Tick] Time has come
HOUSE_BUILT //[House] Certain house was built
Actions
DELAYED_MESSAGE //[Delay, MsgIndex] Adds new etTime/eaShowMessage event (to display delayed messages)
SHOW_MESSAGE //[MsgIndex]
VICTORY //[]
We are certainly adding more triggers and events later on, partially replacing ADD_GOAL system of TSK/TPR having these ideas in mind:
1. Events and Goals are essentially different entities, when goals specify what needs to be achieved, events say what exactly happens.
2. Events are straightforward, when trigger occurs - the action happens. E.g. we could parse VICTORY action triggers and sum up a victory conditions in map selection screen with icons.
3. At the moment events are not linked, they are 'OR'ed. If you have 5 victory actions, the ones triggers occurs first will set a victory.
P.S. Messages system will be discussed in neighbor topic/
Here's the example syntax for the Town Tutorial map:
TIME -1 30 SHOW_MESSAGE 0 1
TIME -1 160 SHOW_MESSAGE 0 2
TIME -1 340 SHOW_MESSAGE 0 3
HOUSE_BUILT 0 19 SHOW_MESSAGE 0 4
HOUSE_BUILT 0 19 DELAYED_MESSAGE 0 100 5
HOUSE_BUILT 0 11 SHOW_MESSAGE 0 6
HOUSE_BUILT 0 17 SHOW_MESSAGE 0 7
HOUSE_BUILT 0 30 SHOW_MESSAGE 0 8
HOUSE_BUILT 0 18 SHOW_MESSAGE 0 9
HOUSE_BUILT 0 9 SHOW_MESSAGE 0 10
HOUSE_BUILT 0 8 SHOW_MESSAGE 0 11
HOUSE_BUILT 0 16 SHOW_MESSAGE 0 12
HOUSE_BUILT 0 4 SHOW_MESSAGE 0 13
HOUSE_BUILT 0 29 SHOW_MESSAGE 0 14
HOUSE_BUILT 0 23 SHOW_MESSAGE 0 15
HOUSE_BUILT 0 6 SHOW_MESSAGE 0 16
HOUSE_BUILT 0 5 SHOW_MESSAGE 0 17
HOUSE_BUILT 0 5 DELAYED_MESSAGE 0 100 18
HOUSE_BUILT 0 28 SHOW_MESSAGE 0 19
HOUSE_BUILT 0 28 DELAYED_MESSAGE 0 100 20
HOUSE_BUILT 0 24 SHOW_MESSAGE 0 21
HOUSE_BUILT 0 3 SHOW_MESSAGE 0 22
HOUSE_BUILT 0 3 DELAYED_MESSAGE 0 100 23
DEFEATED 1 SHOW_MESSAGE 0 24
DEFEATED 2 SHOW_MESSAGE 0 25
E.g. "HOUSE_BUILT 0 5 SHOW_MESSAGE 0 17" means that when Player0 has built house type 5 he will receive a message #17.
So far the dictionary is very short - only 3 available triggers and 3 actions:
Triggers
DEFEATED //[] Certain player has been defeated, we rely on Conditions to generate that event
TIME //[Tick] Time has come
HOUSE_BUILT //[House] Certain house was built
Actions
DELAYED_MESSAGE //[Delay, MsgIndex] Adds new etTime/eaShowMessage event (to display delayed messages)
SHOW_MESSAGE //[MsgIndex]
VICTORY //[]
We are certainly adding more triggers and events later on, partially replacing ADD_GOAL system of TSK/TPR having these ideas in mind:
1. Events and Goals are essentially different entities, when goals specify what needs to be achieved, events say what exactly happens.
2. Events are straightforward, when trigger occurs - the action happens. E.g. we could parse VICTORY action triggers and sum up a victory conditions in map selection screen with icons.
3. At the moment events are not linked, they are 'OR'ed. If you have 5 victory actions, the ones triggers occurs first will set a victory.
P.S. Messages system will be discussed in neighbor topic/
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de