Skip to content

Ghost Tutorial: Custom Assets

Jasdac edited this page Dec 17, 2024 · 7 revisions

Ghost

Ghost event

Props

Props are things the ghost can interact with. There's some boilerplate code in place that lets you simplify the process. Let's create a bucket that the ghost can throw.

  1. Drop GhostInteractive and Portal into the bucket's inventory.
  2. Next I'm going to edit an existing asset (Blueberry soda) and unlink the STAINS prim. If you don't want a round STAINS prim you can pick any of the other assets that support handprints.
  3. I'll position the STAINS prim to the bucket so I can see it. A pro tip is to create a temporary light prim to make it more visible.
  4. Make the STAINS prim physics shape type None (not required, but recommended).
  5. Set the description to GI$3$<0,1,0>. The 3 is a bitwise combination that says to allow stains and to let the ghost automatically throw this item. See Descriptions for more info.
  6. Pick it up and put it into the level monitor. You can now add it to the level like you did in the placing props tutorial.

If you want the prop to have custom behaviors when the ghost interacts with it (such as play a sound), you can do so by using a LocalConf script provided in the devkit for props. Or just edit an existing asset that does something similar to what you want.

Doors

  1. Create your door mesh.
  2. Add a prim where you want the pivot point to be and link the door to it, making the new prim the root prim. Positive X should be pointing towards the handle.
  3. Drop the Door, Portal, and LocalConf scripts into the door.
  4. Edit the onStateEntry, onDoorOpen and onDoorClose sounds. The onStateEntry one will play while the player is dragging the door.
  5. Set the description to ["DO:INT",-1.57,0]. The first entry marks the door as an interior door. If it's an exterior door that should close when the ghost hunts, set it to DO:EXT instead. -1.57 is the max rotation of the door. The final value is a bitmask. See headers/Obstacles/Ghost/Door.lsh for more info. Set the description of any other prims to ROOT.
  6. Say SAVE to save it, then pick it up and put it in the monitor, and use the chat commands listed on the wiki index to test the door.