Message (Kernel)

Retrieves message resource information. Messages are what is spoken by in-game characters. See Message editor.

Important

SCI1.1 only.

Message(msgGET moduleNumber noun verb condition sequence textBuffer)

Gets the text for the specified message resource, and returns the talker number.

Parameters:
  • moduleNumber (number) – The module number (room number).
  • noun (number) – The message noun.
  • verb (number) – The message verb.
  • condition (number) – The message condition.
  • sequence (number) – The message sequence number.
  • textBuffer (string) – The buffer that receives the message text.
Returns:

A talker number, or 0 if it failed.

Example:

(var temp0[100])
Message(msgGET 0 12 0 0 1 @temp0)
Message(msgNEXT textBuffer)

Gets the text for the message resource that follows the one previously obtained by msgGET. The following message is the one with the same moduleNumber/noun/verb/condition tuple, but an incremented sequence number. If no such message exists, then the search continues at the message given by the last stack frame.

Parameters:textBuffer (string) – The buffer that receives the message text.
Returns:A talker number, or 0 if it failed.
Message(msgLAST_MESSAGE outBuffer)

Gets the tuple of the last returned message. This consists of 5 16-bit values: moduleNumber, noun, verb, condition and sequence.

Parameters:outBuffer (heapPtr) – A buffer large enough to hold 12 bytes (2 for the null terminator)

Example:

(var buffer, modNum, noun, verb, condition, case)
= buffer Memory(memALLOC_CRIT 12)
Message(msgLAST_MESSAGE buffer)
= modNum GetValueAt(buffer 0)
= noun GetValueAt(buffer 1)
= verb GetValueAt(buffer 2)
= condition GetValueAt(buffer 3)
= case GetValueAt(buffer 4)
DoAudio(audPLAY modNum noun verb condition case)
Message(msgSIZE moduleNumber noun verb condition sequence)

Gets the size needed to store the message text (including terminating null).

Parameters:
  • moduleNumber (number) – The module number (room number).
  • noun (number) – The message noun.
  • verb (number) – The message verb.
  • condition (number) – The message condition.
  • sequence (number) – The message sequence number.
Returns:

The size in bytes needed to store the message text.

Example:

(var theSize, title)
= theSize Message(msgSIZE modNum noun verb condition seq)
(if (theSize)
        = title Memory(memALLOC_CRIT theSize)
        Message(msgGET modNum noun verb condition seq title)
)
Message(msgREF_NOUN moduleNumber noun verb condition sequence)
Message(msgREF_VERB moduleNumber noun verb condition sequence)
Message(msgREF_COND moduleNumber noun verb condition sequence)
Message(msgPUSH)
Message(msgPOP)