Meteor 2 Scripting Functions
Radio
void sendRadioMessage(int senderObjectID, int targetObjectID, string message, float chatterDuration=-1, float delaySeconds=0)
Send a radio transmission from the specified unit.
sendRadioMessage(PLAYER_OBJECT, -1, radioTextFirstContact);
sendRadioMessage(PLAYER_OBJECT, -1, "Aloha");
senderObjectID must be a valid unit and the sender must have a radio (or be player in a vehicle with a radio).
targetObjectID is not required and can be -1.
message can be any text or a predefined string (see list below).
chatterDuration is optional and defaults to -1 (use default).
delaySeconds is optional and delay sending the transmission. If not specified delaySeconds defaults to 0 (send now).
Vehicles can transmit further than infantry (map radio range * 2).
Sending too many transmission can cause an enemy airstrike on the sender's position.
Use the Radio power-up/item or setUnitHasRadio(PLAYER_OBJECT, true); script command to give the player a radio for the duration of the level.
Predefined strings (some affect how transmissions are replied to, most do not):
radioTextRequestSitrep
radioTextReplySitrep
radioTextRequestAssist
radioTextFirstContact
radioTextCallingNearBases
radioAnnounceContact
radioTextYes
radioTextNo
radioTextSayAgain
radioTextRequestPingComms
radioTextRequestSupplyDrop
radioTextTransmitterAutomatedBroadcast
radioTextRequestEvac
radioTextMaydayGoingDown
radioTextSuppliesDropped
radioTextSupplyPlaneCalloutSmoke
radioTextSupplyPlaneDropInbound
void getUnitHasRadio(bool hasRadio)
Determine if the specified unit has a radio.
bool playerHasRadio = getUnitHasRadio(PLAYER_OBJECT);
print("playerHasRadio = " + playerHasRadio);
void setUnitHasRadio(bool hasRadio)
Give or take a radio from the specified unit.
setUnitHasRadio(PLAYER_OBJECT, true);
print("playerHasRadio = " + getUnitHasRadio(PLAYER_OBJECT));
Server only.
Works for any unit or player.
float getUnitRadioRange()
Get the current radio range on the specified unit in metres.
print("Player radio range = " + getUnitRadioRange(PLAYER_OBJECT));
Returns 0 if the unit does not have a radio.
float getRadioRange()
Get the current radio range in metres.
print("Radio range = " + getRadioRange());
void setRadioRange(float rangeMetres)
Set the current radio range in metres.
setRadioRange(600);
print("Radio range = " + getRadioRange());
setRadioRange(5000 / PIXELS_PER_METRE);
print("Radio range = " + getRadioRange());
Server only.
Radio range is set per map and resets the map is changed. Increase for larger maps.
Infantry units can transmit for this range, vehicles can transmit at twice this range.
float getSkipRadioRange()
Get the miniumum distance in metres that nearby units use the radio.
print("Skip radio range is " + getSkipRadioRange());
void setSkipRadioRange(float skipRangeMetres)
Set the miniumum distance in metres that nearby units use the radio.
setSkipRadioRange(50);
print("Skip radio range changed to " + getSkipRadioRange());
Server only.
Units closer than this distance will not radio the player directly. Instead a message appears on screen as if they are speaking.
bool getRadioAirstrikesEnabled()
Determine if radio random enemy airstrikes are enabled.
print(getRadioAirstrikesEnabled());
void setRadioAirstrikesEnabled(bool enable)
Enable or disable random enemy airstrikes if the radio is used too much during the daytime.
if(isServer())
{
setRadioAirstrikesEnabled(false);
}
Server only.
Radio airstrikes are enabled by default.
Index
Generated on the 23 November 2024 at 08:20:43 (UK Time)