-
Notifications
You must be signed in to change notification settings - Fork 19
SCUMM 8 API: Rooms
Each screen that the user sees is a Room in SCUMM-8. This can be a room in the traditional sense, such as a hallway or bedroom - or it can be an exterior scene. Rooms can even be used to simulate "title" screens and special effects. A Room is basically just a backdrop image that can contain other stuff.
The following properties apply to Room definitions.
-
map
- The x1,y1 (top-left cell pos) and x2,y2 (bottom-right cell pos) of the map that should be used as the room.
For example:map = {80,24,103,31}
- The x1,y1 (top-left cell pos) and x2,y2 (bottom-right cell pos) of the map that should be used as the room.
-
trans_col
- The color to draw as transparent (defaults to 0 = black)
-
col_replace
- Allows you to specify an alternative color to one originally in room/object/actor sprites. Useful for reusing existing content.
- For example:
col_replace = {5,2}
-
lighting
- Specifies the lighting level to use for a given room/object/actor, from 1=Normal to 0=black (default = 1).
- For example:
lighting = 0.75
Specifies the list of objects (variables) that should exist in this room. If objects are not added to a Rooms objects
list, they will not be drawn.
For example:
objects = {
obj_library_door_hall,
obj_lightswitch,
obj_fire
},
If specified, the code within the enter
function will be executed every time the room is "entered". Therefore, if you only want the code run once, you'll need to set a flag and check for it.
For example:
enter = function(me)
-- animate fireplace
start_script(me.scripts.anim_fire, true) -- bg script
end,
If specified, the code within the exit
function will be executed every time the room is "exited". Therefore, if you only want the code run once, you'll need to set a flag and check for it.
For example:
exit = function(me)
-- pause fireplace while not in room (to save cpu)
stop_script(me.scripts.anim_fire)
end,
Introduction
Definitions
Core Variables
Core Functions
Tutorials