Map Database  •  FAQ  •  RSS  •  Login

Events

<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 26 Feb 2012, 09:37

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:
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
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/
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
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 26 Feb 2012, 09:52

Re: Events

AWESOME! :D
<<

T*AnTi-V!RuZz

User avatar

Former Site Admin

Posts: 1826

Joined: 03 Jan 2007, 23:00

KaM Skill Level: Fair

Website: http://www.knightsandmerchants.net

Location: The Netherlands

Post 29 Feb 2012, 08:52

Re: Events

Very nice indeed :)

Return to “Feedback / Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests