Meteor 2 Scripting Functions
Speech
void sayText(int sourceObjectID, string text, string overrideSoundName, bool allowConcurrent)
Display a text message as if the object is speaking and optionally play speaking sound effect.
sayText(1, sayTextContact, "", false);
sendRadioMessage(1, "Aloha", "", true);
sendRadioMessage(1, "Baaaah", "objects\\sheep", true);
Players cannot speak (this function has no effect on players).
This function can be called from server or client and it automatically replicated.
text paremeter can be any text or a predefined string (see list below).
overrideSoundName can be left blank to display text only or automatically pick a sound when using a predefined string in the text parameter.
set allowConcurrent to false to skip saying the text if someone else nearby is speaking (nearby is less than getSkipRadioRange() in metres).
As only players can see/hear messages, this function automatically aborts if no players are nearby to reduce network packets.
Predefined say strings:
sayTextReady
sayTextHoldingPosition
sayTextMoving
sayTextFollowing
sayTextCannotMove
sayTextAttacking
sayTextContact
sayTextClear
sayTextEnemyKilled
sayTextHealthLow
sayTextReloading
sayTextManDown
sayTextMoveIt
Predefined strings can be customised for mods in game.ini
int getVoiceNumber(int gameObjectID)
Get an object's voice number.
print(getVoiceNumber(10));
void setVoiceNumber(int gameObjectID, int voiceNumber)
Set an object's voice number (server only).
setVoiceNumber(10, 1);
Voice numbers are randomised when objects are created, use this function to set a specific voice for an object.
See sub-folders in base\sound\Voices\ for a list of voice numbers.
bool getAnnouncementsEnabled()
Determine if annoucements are enabled for the current mission.
print(getAnnouncementsEnabled());
void setAnnouncementsEnabled(bool enable)
Enable or disable annoucements (server only).
setAnnouncementsEnabled(true);
Announcements are when friendly units announce contacts etc by speaking.
Announcements are enabled by default.
Resets to default on the next mission.
If the "Characters announce contacts" user option is disabled no announcements will be played at all.
To disable announcements for a specific character set the "m2_can_announce" variable to false.
e.g. setVar(objectID, "m2_can_announce", false, true);
Index