User Tools

Site Tools


scripting:includes

Includes

Rather than having all of your script code in the one 'ServerScript.mit' file, it is expected that you will split your script across multiple files, with each file usually relating to one area of your game-world. (e.g. You may have a file to handle all the usable items on your world, or one for handling a particular cutscene or scripted building).

To link files into your script, use the format..

<codedoc> #include “<FILENAME>” </codedoc>

e.g.

ServerScript.mit <codedoc> #include “CrowTournament.mit” </codedoc>

CrowTournament.mit <codedoc> Event( “Custom”, “StartCrowTournamentUser” ) {

  • setcrow 1
  • crowlives 5

}

Event( “Custom”, “StartCrowTournament” ) {

  • say Crow Tournament commencing
  • eao StartCrowTournamentUser

} </codedoc>

Keeping related code separated like this can make it easier to share script across worlds - e.g. You could add your crow tournament feature to another world by copying the CrowTournament.mit file across and including it from the ServerScript.

scripting/includes.txt · Last modified: 2020/01/28 17:50 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki