Contents Up Previous Next

Hotspot functions

DisableHotspot
EnableHotspot
GetHotspotAt
GetHotspotPointX
GetHotspotPointY
RunHotspotInteraction


DisableHotspot

DisableHotspot (int hsnum)
Disables hotspot number HSNUM in the current room. All areas of the screen that were previously HSNUM now act as type 0 (no hotspot). You can turn it back on later with the EnableHotspot command.

This command permanently disables the hotspot - that is, it will not be reset when the player re-enters the room. The only way of turning the hotspot back on is to use the EnableHotspot command.

Example:

DisableHotspot(3);
will disable the hotspot number 3.

See Also: EnableHotspot, RemoveWalkableArea


EnableHotspot

EnableHotspot (int hsnum)
Turns hotspot HSNUM back on. Use this to re-enable a hotspot which you turned off earlier with the DisableHotspot command.

Example:

EnableHotspot(3);
will enable hotspot number 3 that was disabled by the DisableHotspot command.

See Also: DisableHotspot, RestoreWalkableArea


GetHotspotAt

GetHotspotAt (int x, int y)
Returns the number of the hotspot at SCREEN co-ordinates (X,Y). If there is no hotspot there, or if invalid co-ordinates are specified, returns 0.

NOTE: The co-ordinates are SCREEN co-ordinates, NOT ROOM co-ordinates. This means that with a scrolling room, the co-ordinates you pass are relative to the screen's current position, and NOT absolute room co-ordinates. This means that this function is suitable for use with the mouse cursor position variables.

Example:

if (GetHotspotAt(mouse.x,mouse.y)==2)
    Display ("Door");
will display a message "Door" when the cursor is over the hotspot number 2.

See Also: GetLocationName, GetLocationType


GetHotspotPointX

GetHotspotPointX (int hotspot)
Returns the X room co-ordinate of HOTSPOT's walk-to point. If the specified hotspot does not have a walk-to point, returns -1.

Example:

MoveCharacterBlocking (EGO, GetHotspotPointX (4), GetHotspotPointY (4), 0);
will move the character to hotspot 4's walk-to point.

See Also: GetHotspotPointY, MoveCharacterToHotspot


GetHotspotPointY

GetHotspotPointY (int hotspot)
Returns the Y room co-ordinate of HOTSPOT's walk-to point. If the specified hotspot does not have a walk-to point, returns -1.

Example:

MoveCharacterBlocking (EGO, GetHotspotPointX (4), GetHotspotPointY (4), 0);
will move the character to hotspot 4's walk-to point.

See Also: GetHotspotPointX, MoveCharacterToHotspot


RunHotspotInteraction

RunHotspotInteraction (int hotspot, int mode)
Processes the interaction list as if the player had clicked the mouse on hotspot number HOTSPOT in the current room, using cursor mode MODE. MODE is one of the MODE_* constants listed in the ProcessClick description. May be useful with the text parser for simulating a mouse click if they type specific words in.

Example:

RunHotspotInteraction(4,MODE_LOOK);
will run the code defined in the "LOOK AT HOTSPOT" interaction for hotspot number 4.

See Also: ProcessClick, RunCharacterInteraction, RunObjectInteraction