RTYP

RTYP is a CAOS command and function to set or output the type of a room.

Command
Syntax: RTYP room_id(integer) room_type(integer)

Sets the given room's type to the one specified. For C3/DS, this should be in the range of 0-10.

Function
Syntax: RTYP room_id(integer)

This returns the given room's type as an integer. For C3/DS, this will be in the range of 0-10.

Example
This command is seen in the install scripts for metarooms to set the type for each defined room.

As a function, it is often used to make sure that plants and critters are restricted to reasonable habitats, so that plants don't start growing on metal walkways, terrestrial animals can't thrive underwater, fish die when brought to dry land, etc. For example, when bramboo fruit checks to see if it can make a new plant, one of the things it checks for is whether it's sitting on soil of some kind: doif rtyp room targ = 5 or rtyp room targ = 6 or rtyp room targ = 7 setv va15 1 else setv va15 0 endi