Client Scripting API

From Multiverse

Jump to: navigation, search
The Client Scripting API is under development. During this phase of development, we are focusing on functionality and features, rather than maintaining 100% backwards compatibility for each release. If you write scripts using this API, be prepared to make change them until the Client Scripting API is more stable.


Contents

Introduction

The Client Scripting API provides programmatic access to many features of the Multiverse Client, including:

  • Hardware capabilities, which can be used to adjust graphical presentation settings to perform best for the user's computer.
  • Configuration settings for graphical systems provided by the game engine, including shadows, compositor scripts, water, sky, terrain, and so on.
  • The world simulation, including players, mobs, buildings, lights, camera, and other objects.
  • 3D visual effects, including terrain decals, animations, projectiles, particle systems, and so on.
  • Sound effects and graphical user interface display.
  • User preferences and key bindings.
  • Coordinated Effects, which enable a single server message to invoke a client script that implements a coordinated set of visual and audio effects.

Scripting Overview

The Multiverse platform uses Python as its scripting language. This document assumes you are familiar with the Python language. See Background Knowledge Prerequisites / Python for a list of Python references. Python is a dynamically-typed language, but most of the properties and methods in the Client API require objects of a specific type, since they represent C# objects in the Client, and C# is statically-typed. Mis-typing objects will cause errors.

The Multiverse Client uses the IronPython implementation of Python. You can use most standard Python modules in your client code, in contrast to Python scripting on the server.

NOTE: In a future release, the UI scripts may be moved into their own module.

Startup script

During startup, the client executes the Python script file /Scripts/Startup.py in the current world's asset repository. This Python script imports any other modules that your world requires, including Coordinated Effects. The client executes Startup.py in the default module of the Python interpreter, the same module in which it runs all user interface and key binding scripts.

Modules and Classes

The Client scripting API consists of several modules and classes. See Client API Reference for an alphabetical list.

Modules

World configuration classes

  • WorldObject - Represents an object visible in the 3D world.
  • FogConfig
  • OceanConfig - configures the ocean rendering system of the Multiverse Client.
  • ParticleSystem - Represents a set of animated particles that are visible in the 3D world.
  • ShadowConfig - configures the shadow rendering system of the Multiverse Client.
  • SoundSource - Represents a source of sound that can be positioned in the 3D world.
  • World

Lighting classes

Animation classes

  • AnimableValue - Represents a property of an object that can be animated.
  • Animation - Represents several forms of animation.
  • MorphAnimationTrack - can control an animation sequence to morph a mesh between predefined morph targets.
  • MorphKeyFrame - represents a key frame in an animation that is animating a numeric property of an object that supports property animation.
  • NodeAnimationTrack - Controls an animation sequence that can manipulate the position, scale and orientation of SceneNodes.
  • NodeKeyFrame - Represents a key frame in an animation that is animating the position, scale and orientation of a SceneNode.
  • PropertyAnimationTrack - Controls an animation sequence that can manipulate numeric properties of objects that support animation.
  • PropertyKeyFrame - represents a key frame in an animation that is animating a numeric property of an object that supports property animation.
  • AnimationState

Visual effects classes

  • Compositor - Represents an instance of a compositor script, a graphical effect that does one or more full screen post processing passes with pixel shaders.
  • Decal - Represents an image layered onto the terrain.

3D scene classes

  • SceneNode - Represents a scene node.
  • Camera - Represents a view into the 3D scene.

Video and web integration

Material scripting

Generic object classes

  • Vector3 - Generic class that represents 3D vectors.
  • ColorEx - Generic class that represents colors.
  • Quaternion - Generic class that represents quaternions.

Other classes

Personal tools