Messages

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

Messages

Post by DavidRN »

Hi

I have created a SAR mission involving FFH 150 ANZAC its aircraft Eagle#1 and a civilian disabled yacht.

I really liked the Lua message format from the excellent Raid on Kismayo, 2013 so have copied the same message Lua as utilised in that scenario (changing the message wording etc).

I see the message popup from Eagle#1 (local theMessage)

But not the response from FFH 150, or lat and long (am I suppose to?)

Any assisstance will be appreciated.

David

Code: Select all

local theSpottedUnit = ScenEdit_UnitX()
local theSpotter = ScenEdit_UnitY().unit

if theSpottedUnit.dbid == 1379 then
    local theMessage = "Eagle#1 has located the disabled yacht, will be a difficult rescue due to current weather conditions and sea state."

    theMessage = GenerateRadioMessageBody(theMessage,theSpotter.name)

    RadioMessage('Eagle#1','104.20 MHz',theMessage,{latitude=theSpottedUnit.latitude,longitude=theSpottedUnit.longitude})

    TelexMessageToPlayer(
        'Eagle#1', 
        'Eagle#1', 
        '1. FFH 150 Thank you for your report of locating the disabled yacht. <br>2. Please proceed with rescue as planned 	 
        planned. <br>3. Good luck.', 
        {latitude=theSpottedUnit.latitude, longitude=theSpottedUnit.longitude}
    )

    ScenEdit_SetEvent('Yacht_Spotted',{isactive=false})
end
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: Messages

Post by KnightHawk75 »

The scene itself would be much more helpful to see whats up... or at least all the code, there are call to functions (TelexMessageToPlayer,RadioMessage ) who's content aren't shown.
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

Re: Messages

Post by DavidRN »

KnightHawk75 wrote: Wed Feb 08, 2023 11:19 am The scene itself would be much more helpful to see whats up... or at least all the code, there are call to functions (TelexMessageToPlayer,RadioMessage ) who's content aren't shown.

Hi Thanks for the reply here is the original message (Raid on Kismayo, 2013) as below ....

My scenario (SAR) involves a FFG the FFH ANZAC, its helicopter Eagle#1 and a civilian disabled yacht.

Eagle#1 will find the disabled yacht (random location each start) and I want to semnd that mesage to FFH 150 and in return FFH 150 responds go ahead with rescue.

I dont understand the NKEA CENTCOM etc how I convert that to my scenario.

Raid on Kismayo, 2013

Code: Select all

local theSpottedUnit = ScenEdit_UnitX()
local theSpotter = ScenEdit_UnitY().unit

if theSpottedUnit.dbid == 452 then
    local theMessage = "We've spotted safe house. It's a real hornet's nest down there!"

    theMessage = GenerateRadioMessageBody(theMessage,theSpotter.name)

    RadioMessage('SATCOM','316.2 MHz Encrypted',theMessage,{latitude=theSpottedUnit.latitude, longitude=theSpottedUnit.longitude})

    TelexMessageToPlayer(
        'NKEA', 
        'CENTCOM', 
        'i', 
        'US CENTral COMmand', 
        'lhd 3 kearsarge', 
        'top secret', 
        '1. centcom acknowledges your report of locating the al-jabaab safe house. <br>2. you have a green light to proceed with insertion of ground forces and capture of the courier as planned. <br>3. good hunting and godspeed.', 
        {latitude=theSpottedUnit.latitude, longitude=theSpottedUnit.longitude}
    )

    ScenEdit_SetEvent('US_SafeHouseSpotted',{isactive=false})
end


My Scenario

Code: Select all

local theSpottedUnit = ScenEdit_UnitX()
local theSpotter = ScenEdit_UnitY().unit

if theSpottedUnit.dbid == 1379 then
    local theMessage = "Eagle#1 has located the disabled yacht, will be a difficult rescue due to current weather conditions and sea state."

    theMessage = GenerateRadioMessageBody(theMessage,theSpotter.name)

    RadioMessage('Eagle#1','104.20 MHz',theMessage,{latitude=theSpottedUnit.latitude,longitude=theSpottedUnit.longitude})

    TelexMessageToPlayer(
        'Eagle#1', 
        'Eagle#1', 
        '1. FFH 150 Thank you for your report of locating the disabled yacht. <br>2. Please proceed with rescue as planned 	 
        planned. <br>3. Good luck.', 
        {latitude=theSpottedUnit.latitude, longitude=theSpottedUnit.longitude}
    )

    ScenEdit_SetEvent('Yacht_Spotted',{isactive=false})
end
Top
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: Messages

Post by KnightHawk75 »

Did you copy over the global TelexMessageToPlayer() and all the other global functions and associated code dependencies it uses to your scene, I assume you did at least for RadioMessage() else that part wouldn't be working for you either.
DavidRN
Posts: 91
Joined: Tue Jan 17, 2023 8:41 pm

Re: Messages

Post by DavidRN »

KnightHawk75 wrote: Thu Feb 09, 2023 9:40 pm Did you copy over the global TelexMessageToPlayer() and all the other global functions and associated code dependencies it uses to your scene, I assume you did at least for RadioMessage() else that part wouldn't be working for you either.
I have added the telex message and now works great, thanks for the help.

DB
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

Re: Messages

Post by KnightHawk75 »

DavidRN wrote: Sat Feb 11, 2023 2:43 am
KnightHawk75 wrote: Thu Feb 09, 2023 9:40 pm Did you copy over the global TelexMessageToPlayer() and all the other global functions and associated code dependencies it uses to your scene, I assume you did at least for RadioMessage() else that part wouldn't be working for you either.
I have added the telex message and now works great, thanks for the help.

DB
Glad to hear it.
Post Reply

Return to “Lua Legion”