Advanced Level Features

From Gothongs Wiki
Jump to navigationJump to search

If you have not. You should check Creating a Level first.

Let us begin with level features that require no scripting. The following features are added by editing prim descriptions.

The XOBJ syntax for descriptions are task0$task0arg0$task0arg1...$$task1$task1arg0$task1arg1...

Separate tasks from arguments with a single $

Use multiple tasks in a description by separating them with $$

These three features are all set by scanning the description of the prim that a player is standing on. You do not have to set the soundspace or environment on every prim, because it will only updated when the player moves to another prim that has a soundspace or environment description. Footsteps require all prims that you walk on to have the proper sound in the description.

Soundspace

A soundspace is a way to set an ambient loop to play in the background. There are built in soundspaces, but you can also set your own via UUID.

The soundspace tasks looks like: "SS$sound$volume", so "SS$ru$0.2" will add a rumble ambient loop.

You can replace the ru with a UUID to use a custom sound, or use one of the preset sounds from the soundspace header file: https://github.com/JasXSL/SL-XOBJ/blob/master/xobj_core/classes/jas%20Soundspace.lsl

Footsteps

Footsteps use the same system. Footsteps should be set on all of the prims that avatars walk on. Many of the JasX library meshes come with footsteps already setup.

The footstep task looks like: "tFS$type", if you wanted sand you would use "tFS$SAND". You can find a full list of supported sounds in the header file: https://github.com/JasXSL/SL-XOBJ/blob/master/xobj_toonie/classes/ton%20Footsteps.lsl

You cannot use UUIDs for footsteps. But you can make pull requests on githup for additional sounds.

Environment Settings

Environment settings allow you to change the sky setting (formerly windlight). It works like Soundspace in that it is only needed on points where you want it to change, such as the prim players start their level on.

The environment task looks like: "WL$sky_uuid", such as "WL$96b70f39-ce1e-8e92-257d-d54d34bd3853"

You can only use UUIDs for this setting.

Doing all at once

Let us assume that we want to set footsteps, windlight, and a soundspace on the prim that players start the level on.

The soundspace looks like "SS$ru$0.2", the footsteps like "tFS$SAND", and windlight like "WL$96b70f39-ce1e-8e92-257d-d54d34bd3853".

We combine these with $$ to get the description: SS$ru$0.2$$tFS$SAND$$WL$96b70f39-ce1e-8e92-257d-d54d34bd3853

We edit the floor prim that player start on and set its description to that. The change should be immediately visible!

Water

Making your level more interactive with scripts

Level scripts

On level loaded

Triggers

ID Events

Music

Objective Hints

Using the timer template for cutscenes

Monster Scripts