User Tools

Site Tools


scripting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripting [2022/03/11 11:54] – [Editing your script files] mitscripting [2023/05/15 02:07] (current) – [Custom Events] mit
Line 35: Line 35:
  
 ===== Script Files ===== ===== Script Files =====
-The primary 'script' a server runs is stored in a file called ''Data\Scripts\ServerScript.mit'' - this is a text file that can contain commands and scripted events ( You can include other files (see [[scripting:other_language_features|#include]] docs) ). To change your script file, modify it in a text editor (or in the in-game editor when its finished) and then tell the server to reload it bt pressing F11 (or using the command ***reloadscript**). +The primary 'script' a server runs is stored in a file called ''Data\Scripts\ServerScript.mit'' - this is a text file that can contain commands and scripted events ( You can include other files (see [[scripting:other_language_features|#include]] docs) ). To change your script file, modify it in a text editor (or in the in-game editor when its finished) and then tell the server to reload it by pressing F11 (or using the command ***reloadscript**). 
  
 For a quick Hello World example.. Connect to your world, copy the code block below into your serverscript.mit, press f11 then type **&test** For a quick Hello World example.. Connect to your world, copy the code block below into your serverscript.mit, press f11 then type **&test**
Line 53: Line 53:
 ===== Custom Events ===== ===== Custom Events =====
 Custom Events are a special type of event that is triggered from a command and can include custom parameters.  Custom Events are a special type of event that is triggered from a command and can include custom parameters. 
-e.g. *event [Name] TestEvent|MyParam+e.g. ''*event [Name] TestEvent|MyParam''
  
 will trigger an event specified in your script code like: will trigger an event specified in your script code like:
  
-Event( "Custom", "TestEvent" )+<code>Event( "Custom", "TestEvent" )
 { {
    $text = $gTextParam[1]    $text = $gTextParam[1]
    *say Your Parameter was $text    *say Your Parameter was $text
-}+}</code>
  
 Custom events can be triggered for groups of players - e.g. for everyone online ('EventAllOnline'), or for everyone standing in a particular zone on the map. Custom events can be triggered for groups of players - e.g. for everyone online ('EventAllOnline'), or for everyone standing in a particular zone on the map.
  
  
scripting.1647021264.txt.gz · Last modified: 2022/03/11 11:54 by mit

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