Scripting:Sourcecode

Building pieces of another world.
Revision as of 12:18, 21 June 2014 by gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The source code for TWScript, including supporting files and instructions for building the scripts is available at GitHub: https://github.com/TheWatcher/twscript If you fork the code on GitHub and make any useful additions to any of the base/ files, or fix any bugs in the code, please send me a pull request and I'll look into merging your changes.

Layout

The TWScript source is organised into a number of directories:

  • base/ contains the various TWBase* base scripts and supporting code.
  • pubscript/ contains any pieces of Telliamed's Public Scripts code required to support the rest of TWScript
  • twscript/ contains the implementations of the various TWScript scripts.

If you intend to use TWScript as a basis for your own code, you will need to retain the base and pubscript directories, but you will want to replace twscript with your own code.

Code Style

The most immediate thing you will notice when browsing the TWScript code is that, unlike the wider lg/scriptlib/publicscript code by Telliamed, this code deliberately avoids Hungarian Notation as much as possible. If you want, consider it a way of clearly separating the TWScript code from the larger codebase (or maybe I just utterly loathe Hungarian Notation with the burning passion of a thousand newborn stars. Which is it? WE MAY NEVER KNOW!)

My code also uses underscores rather than CamelCase except for class names, and functions imported from outside my code. This is partly another personal style thing, but in this case there really is the intention of marking code separation: it makes it easier for me to keep track of what's mine and what comes from Outside.



Authors

  • gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+]