As you work on your game, you'll ptobably want to make changes to the way in which the engine starts or ends. For example, you might want to execute some kind of custom code to “pause” certain parts of your game every time dialog begins, and “resume” when the dialog is finished. Customizable scripts give you a place to add your own mechanics to the engine.

These scripts do not exist by default, and they are not part of the SLIDGE Engine. This is deliberate–you will define the scripts, so they will never be overwritten if you choose to apply any future update to the engine. This way, you can make basic modifications to the engine without losing them on each update.

This does not work on HTML5. See below for details.

  • Startup Script
    • Create a script outside of the SLIDGE Scripts folder called slidge_start
    • This script, if it exists, will be executed during the create event of any SLIDGE engine object, after all other engine variables are created and data is loaded, but before any content is displayed.
  • Deletion Script
    • Create a script outside of the SLIDGE Scripts folder called slidge_delete
    • This script, if it exists, will be executed during the destroy event of any SLIDGE engine object.
  • Defaults Script
    • Create a script outside of the SLIDGE Scripts folder called slidge_defaults
    • This script, if it exists, will execute immediately after defaults are set and before anything else is loaded, etc.

HTML5

Due to code obfuscation, the methods above cannot work on HTML 5 (Basically, the engine looks for scripts with certain names, and executes these; on HTML5, this sometimes works in debug mode, but is not likely to work in your final export).

If you plan to export to HTML5, and to use custom scripts, perform a Find All and search for script_execute. You should find 5 instances in the engine (start/delete in the edit and show objects, and defaults in the common data script). Replace the section of code that checks for a script and executes it with a simple call to your custom script.

  • slidge/customizable_engine_scripts.txt
  • Last modified: 2018/12/16 17:35
  • by journeyman