-
Notifications
You must be signed in to change notification settings - Fork 18
Frequently Asked Questions
Just remove all classes from the data/ directory, except one. You can hardwire all players to use that one class in the sign-up process in sessionhandler.js. See the FoggyText project for an example: https://github.com/arendjr/FoggyText
The Realm class handles various stuff that needs to be managed globally. It keeps track of the in-game date/time, it keeps track of all other objects in the realm, makes it easy to query for players, etc.. The Realm class is also used if you need to create a new object from JavaScript:
var newItem = Realm.createObject('Item');
You can read all about it in the triggers documentation.
In order to simplify common patterns, there's a bunch of convenience methods defined. Many of these are provided as extensions to the standard JavaScript objects to make their use as seemless as possible.
You can find all these methods collected in util.js
In addition, all game objects that are exposed to JavaScript have various methods and properties that you can call from JavaScript. There are special commands to inspect those.
This command will give you an overview of all methods of an object:
list-methods <object>
And this command gives an overview of all the properties:
list-props <object>
Finally, the default scripts include a copy of Underscore.js. This is a well-known library of utility methods that I will increasingly start to use as the project moves forward.
I see there are properties called respawnTime and respawnTimeVariation. How are those used to determine when a character respawns?
The time it takes for a character to respawn (in milliseconds) is respawnTime + (random number between 0.0 and 1.0) * respawnTimeVariation.
Be careful, if respawnTime is 0 the character will be deleted when it dies and is dead forever rather than being respawned.
The implementation of this is found in the die() method in character.js.
Personally, I use Qt Creator: http://qt.digia.com/Product/Developer-Tools/