-
Notifications
You must be signed in to change notification settings - Fork 13
Add Rooms
MinimapAPI:AddRoom{
ID = --any value. This is used to identify your room later.
Position = --a vector representing the position of the room on the minimap.
Shape = --a RoomShape enum value that represents the sprite on the minimap and where icons will be placed.
--Anything below is optional
Type = --A RoomType enum value. Optional, but recommended if you want the room to work as expected with minimap revealing items.
PermanentIcons = --A list of strings, where each string is the icon ID representing the room's type.
LockedIcons = --A list of strings like above, but this is only shown when the player does not know the room's type (eg locked shop, dice room)
ItemIcons = --A list of icon IDs that display on the map (eg keys and hearts). This will be overridden once the player enters this room.
DisplayFlags = --The display flags for the room. Matches the format of RoomDescriptor.DisplayFlags.
AdjacentDisplayFlags = --The display flags that this room will take on if seen from an adjacent room. This is usually 0 for secret rooms, 3 for locked rooms and 5 for all others.
Hidden = --This room is secret. It will not be revealed by the compass or the treasure map, and it WILL be revealed by the blue map.
Clear = --The clear boolean for the room.
Visited = --Whether the room has been visited or not. This will be set to true as soon as the player's map position is in line with this room.
NoUpdate = --a boolean. If true, then this room's minimap appearance will never be changed by the API itself, meaning its display flags, clear status, visited status and pickup icons will have to be updated externally.
Color = --a Color object that is applied when this room is rendered on the map.
Descriptor = --a RoomDescriptor object if you are attaching a vanilla room to this table. Setting this will cause this room's display flags and clear boolean to be taken from this RoomDescriptor.
AllowRoomOverlap = --optional. The API will automatically remove a room if you add this in the same position, setting this to true will disable this functionality.
}MinimapAPI:AddRoom takes a table, with the keys as listed above. Returns the room added which is a table containing all of the keys above, except for AllowRoomOverlap (The argument table and the table returned are not the same)
Adding a room with no display flags will render it completely hidden until the player is adjacent to it. Position is not bounded, and can be any number; (Decimal, negative, massive) but be warned that rooms that are not aligned with each other are not detected as adjacent. The API is not strict about types (yet), so try not to put a number into the PermanentIcons or something like that.
For what icon IDs you can use, see the Data section.
Note:
If you want to guarantee a unique ID, make it a table.
Example:
MinimapAPI:AddRoom{ID=50000,Position=Vector(6,3),Shape=RoomShape.ROOMSHAPE_2x1,PermanentIcons={"TreasureRoom"},DisplayFlags=5}Spawns a 2 long 1 tall room at (6,3) with a treasure room icon.