Enough people have been asking about a SOMA equivalent for Amnesia's
SetMessage function that I went ahead and created a module for it.
Installing the script into your mod is simple - just take the "script" folder from the mod package and copy it into the root folder of your mod, then make sure you add the line "
<Directory Path="/script" AddSubDirs="true" />" to your mod's resources.cfg file (if you haven't already).
You will also need to add a new file inside your config folder called "Modules.cfg", then paste
this text into that file.
Using the script is simple as well. For basic functionality, it shares the syntax from Amnesia:
SetMessage(const tString &in asText);
SetMessage(const tString &in asTextCategory, const tString &in asTextEntry);
SetMessage(const tString &in asText, float afMessageDuration);
SetMessage(const tString &in asTextCategory, const tString &in asTextEntry, float afMessageDuration);
So a very simple example of using the module (the code I used for the image above in fact) would be:
SetMessage("This is a simple message.");
For people who want to add a little more control to their messages, here is the full syntax for the functions as well:
void SetMessage(const tString &in asText,
float afMessageDuration = 3.0f,
eMessagePosition alMessagePosition = eMessagePosition_TopCenter,
eMessageAlignment alMessageAlignment = eMessageAlignment_Default,
cVector2f avMessageSize = cVector2f_MinusOne,
cVector2f avMessageOffset = cVector2f_Zero);
- asText: The message to be displayed.
- afMessageDuration: The time, in seconds, for the message to be displayed. (Excluding the fade in/out time.)
- alMessagePosition: The position of the text on the screen. (Defaults to dead center).
- alMessageAlignment: The alignment of the text body. (Defaults to dependent on the message position.)
- avMessageSize: The size, in group space (0.0-1.0), of the text body. (Defaults to roughly two-thirds the width of the screen.)
- alMessageOffset: The offset, in group space (0.0-1.0), of the message text. (Defaults to no offset.)
void SetMessage(const tString &in asTextCategory,
const tString &in asTextEntry,
float afMessageDuration = 3.0f,
eMessagePosition alMessagePosition = eMessagePosition_TopCenter,
eMessageAlignment alMessageAlignment = eMessageAlignment_Default,
cVector2f avMessageSize = cVector2f_MinusOne,
cVector2f avMessageOffset = cVector2f_Zero);
- asTextCategory: The text category to be using for this message.
- asTextEntry: The text entry for the message to be displayed.
- afMessageDuration: The time, in seconds, for the message to be displayed. (Excluding the fade in/out time.)
- alMessagePosition: The position of the text on the screen. (Defaults to dead center).
- alMessageAlignment: The alignment of the text body. (Defaults to dependent on the message position.)
- avMessageSize: The size, in group space (0.0-1.0), of the text body. (Defaults to roughly two-thirds the width of the screen.)
- alMessageOffset: The offset, in group space (0.0-1.0), of the message text. (Defaults to no offset.)
To sum that up, you can use either plain text or lang categories for the message text, input your own duration time, define where you want the message box to appear, how you want the text to be aligned, and put in your own custom offset/size for the box itself.
To get the module, you can either get it from the
Steam Workshop or by downloading it directly from
MediaFire.