StartNewModule(string)
Moves the existing players to a new module.
void StartNewModule( string sModuleName );
Parameters
sModuleName
The name of the module to start.
Description
Shut down the currently loaded module and start a new one (moving all currently-connected players to the starting point.
Remarks
The StartNewModule command requires the filename of the module to start, not the internal name. There is a handy way to restart modules, used in testing, ie creating a unique power item that restarts the module this way:
StartNewModule(GetName(GetModule()));
GetName(GetModule()) returns the internal name, not the filename, so for that approach to work, the filename and the internal name of the module need to exactly the same. See bugs below.
Known Bugs
The bug / issue that caused StartNewModule to crash if called with an invalid filename has been fixed with patch 1.61. If the filename doesn't exist, the function simply fails.
Version
1.61
Example
// Start a new module called "module001", this is the FILENAME, remember! void main() { StartNewModule("module001"); } // Restart the currently running module - IF the name of the // module is the same as the filename of the module (see above). void main() { StartNewModule(GetName(GetModule())); }
See Also
categories: | Module Functions |
author: Tom Cassiotis, editor: Jasperre
Send comments on this topic.