Scripting
dim3 uses the highly-optimized, Mozilla Spidermonkey javascript engine for all its scripting. Most people who have done any computer work have either used javascript or can become familiar with it quickly. Included is a very robust object model that can control even the most minute aspects of a game.
Scripts can be attached to:
- Games
- Maps
- Interface/HUD
- Players/Bots
- Objects/Items
- Weapons
- Projectiles
- Timers and Events
Each script can also spawn any number of entities, from effects to lights, or change any of the games parameters, like gravity or resistance, or even altering displays. Scripts can change maps, send queued messages, create sounds, and they can even take control of the camera. Also, scripts can attach themselves to other scripts (for instance, a bot could attach a weapon script, which could in turn attach any number of projectile scripts.)
Most scripts operate on an event system, so the game controls the action until a event that the script requested is triggered (for instance, damage to an object, or a certain user input.) This allows you to have a large amount of code in scripts without adversely effecting game speed.
Objects can be set to respond to or ignore many types of events, from damage to timed events. dim3 has a built-in cursor-click system so objects can be activated by the gun sights.

In the picture below, notice the barrel and compare it with earlier images; it's bent over after being shot numerous times. This is all controlled by the barrel's script.

|
 |
| Did you know? |
|
Scripts can change maps, send queued messages, create sounds, and they can even take control of the camera.
|
| Be part of our growing community |
|
Visit our forums and engage in knowledge sharing.
|
|