-
Notifications
You must be signed in to change notification settings - Fork 3
Howto make a room
To start off with, take a look at ScummC Grammar which gives an overview of how rooms, scripts, and actors are defined.
All graphics in SCUMM use one of many room palettes. You need to make sure all the colors in your graphics will fit somewhere into this palette.
Typically room palettes are divided into 3 sections:
- System colors (shared between the room and actors)
- Room graphic colors
- Costume colors (same across all rooms)
Any tool can be used to generate the graphic resources. All you need is some BMP files in paletteized (indexed) format. It is recommended however that you work in RGB mode, then use the palcat tool to reduce the colors and combine palettes.
This is the simplest: just draw some stuff. If you plan on using Z planes (masks which clip the actors) then it might be a good idea to draw them on separate layers.
To reduce the colors in the background using palcat, try:
palcat -col 180 -o pal_ room.bmp
Be sure to leave room for your costume palettes!
In SCUMM all objects are by default in state 0 and display nothing. With a door, for example, the background image will show the closed door. You need to create a picture that will be put on top of the background, showing the opened door. Again, the simplest way to do this is to use layers.
Keep in mind that you will need to make sure your objects index the correct colors in the room palette. This can be done by sticking them in when using palcat. Try:
palcat -col 180 -o pal_ room.bmp door_open.bmp table_broken.bmp
In SCUMM, all playable and non-playable characters are actors. In some cases scenery and other objects may also be actors.
All actors wear costumes. Costumes are basically images and animations which represent whichever actor they are associated with. Refer to ScummC Grammar for details of how costumes work.
Generally speaking you will want to combine all the images for each costume so they use the same palette. e.g.:
palcat -o out_ -col 32 fred*.bmp
Then stick these onto the end of the room palette
palcat -o out_ pal_room.bmp out_fred_walk_0.bmp george_walk_0.bmp ...
Finally in your .scost:
palette("out_room.bmp");
Z planes allow actors to be behind parts of the background or objects. For this you need to create a mask; a simple black and white layer will do the trick. If the different parts of the background are already split into layers then you can just duplicate it, fill the parts that should be hidden with some color, and clear the rest.
Note that despite their name, Z planes don’t “stack up”. Actors are only hidden by a single Z plane at a time. If you need an actor to be hidden by more than one layer of objects at a time, make a mask combining all of them. For example, if you have a tree behind a fence, you might make one mask with just the shape of the fence (for when the actor is standing in front of the tree), and another with the combined shapes of the fence and the tree together (for when he’s behind the tree)..
This part is easier. Basicaly you need to define where the actors can walk. Fire up the box editor:
$ boxedit -img back.bmp
This will directly load your background BMP. The user interface is quite specific; see the README for more details. When putting the boxes around, remember that boxes can only be connected with vertical or horizontal sides. Each box also defines the scaling and Z plane to use for actors inside it. They should therefore be split according to Z planes and perspective, so depending on your room complexity, it might not be trivial.
To make a door, or any other path that should exist but be disabled (off-limits) by default, check the “Invisible” box. Your scripts will be able to change the box flags later to open the door, etc. You must name all boxes that you intend to reference from the scripts.
Actor scaling comes in two forms: a fixed value, or a linear function of the actor’s Y position in the room (a.k.a. a scaling slot). Each room can only have up to 4 scaling slots. Sadly, there is no preview in the box editor currently, a much wanted feature.
You just need to record the samples you want. However, you must use a specific outdated format: Creative voice file — a.k.a. VOC. The samples must be in 8-bit unsigned mono at 22 or 11 kHz. Anything else won’t do.
The script binds everything together. Look at the examples and other documents on this wiki, starting with ScummC Grammar.