Dark Rooms

ADRIFT 5 Help ›› Creating Games ›› Tutorials ›› Beginner ››
Parent Previous Next

Dark Rooms

Dark Rooms are locations where you can only see the description of the room and examine objects in that room if there is some sort of light source nearby.  Normally this would be some sort of hand held light source like a torch or a lantern.

The ADRIFT Standard Library has built in functionality to handle dark rooms.

Look for the DarkRoom.taf file in the Samples folder for an example you can load up.

Specifying the dark rooms

To mark a room as a dark room, simply edit the Dark Locations group, and select all rooms that should be dark:

Creating light sources

To create a light source, simply create your object, then add it to the Light Sources group:

And that's all there is to it.  The Look and Examine tasks use these two groups to decide whether or not to display the normal descriptions, or alternative ones.

If you want an object to become a light source in the game, you can simply add or remove it from the Light Sources group using task actions.  Similarly, if a location should suddenly become a dark location, you can add or remove it from the Dark Locations group in the same way.

Interacting with hidden objects

Using the above technique, objects will be hidden from view and cannot be examined.  But they are still actually there.  There are three things you can do here: