User Tools

Site Tools


scripting:introduction_to_events

This is an old revision of the document!


Event Scripting Overview

You can control events on your world server by script through the file Data/Script/ServerScript.mit. This section, and the accompanying reference, describe the types of 'events' you can specify and how they are used.

After making any changes to any of your script files you will need to use the command.. <codedoc>
  • reloadscript

</codedoc> .. for the changes to take effect

Event Script Example

Heres an example of an event script file..

	Event( "NewBuilding", "3" ) 
	{ 
		*say %PLAYER% built building 3 
		*grantcash %PLAYER% 400 
	} 

	Event( "UseItem", "KudosItem1" ) 
	{ 
		*say %PLAYER% used the kudos item 
		*grantkudos %PLAYER% 1 
		*resetpos %PLAYER%
	} 

This file defines 2 events. In the example above, whenever a player ('Bob' for instance) builds building type 3, the commands within { } braces are executed. i.e.

	*say Bob built building 3 
	*grantcash Bob 400 

would be entered - the say message will appear in red for all players and 'Bob' will get an extra 40s. Similar procedure for the other event should someone use the kudos item.

scripting/introduction_to_events.1402054818.txt.gz · Last modified: (external edit)