Popup message

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
slimatwar
Posts: 131
Joined: Fri Jan 20, 2017 2:22 pm
Location: Hellas

Popup message

Post by slimatwar »

I would like to know how I can receive a popup message (or a notification) when a specific unit of mine arrives at a specific waypoint or area? I guess it can be done with LUA but I don't know yet how to use it.
BDukes
Posts: 2694
Joined: Wed Dec 27, 2017 12:59 pm

RE: Popup message

Post by BDukes »

You can use it but don't necessarily need lua to do it. Use the event editor. Unit enters area (create area around waypoint) trigger with message action.

With lua you may be able to access the waypoint if it is a generated course for a strike etc.. I'd be careful if it's a patrol or something that won't actually hit the waypoint (use the above).
Don't call it a comeback...
slimatwar
Posts: 131
Joined: Fri Jan 20, 2017 2:22 pm
Location: Hellas

RE: Popup message

Post by slimatwar »

ORIGINAL: BDukes

You can use it but don't necessarily need lua to do it. Use the event editor. Unit enters area (create area around waypoint) trigger with message action.

With lua you may be able to access the waypoint if it is a generated course for a strike etc.. I'd be careful if it's a patrol or something that won't actually hit the waypoint (use the above).

Thank you.
I forgot the features of the event editor,though I don't know much about it.
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Popup message

Post by KnightHawk75 »

BDukes is right, depending on what you need the display message action may be all you need.

If you do need to script it though, you're looking for ScenEdit_SpecialMessage('SideNameHere','The html or plain text here')

http://commandlua.github.io/#ScenEdit_SpecialMessage

slimatwar
Posts: 131
Joined: Fri Jan 20, 2017 2:22 pm
Location: Hellas

RE: Popup message

Post by slimatwar »

Thanks guys.
And what should I do if I want the 'jump to location' button to point me to the specific unit?
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Popup message

Post by KnightHawk75 »

'jump to location'
- Use the 3rd optional parameter.

ScenEdit_SpecialMessage('SideNameHere','The html or plain text here', {table of latitude=TheLatHere, longitude=TheLonHere});

So let's just say for example some unit enters some area (or say it is unit damaged) and you have a trigger for it, the action might include:

local u = ScenEdit_UnitX(); --get the unit wrapper.
ScenEdit_SpecialMessage('Blue','Something happened here. Jump to location is available',{latitude=u.latitude,longitude=u.longitude});
or say it's some hard coded location...
ScenEdit_SpecialMessage('Blue','Something happened here. Jump to location is available',{latitude=1.1234,longitude=-1.1234});

slimatwar
Posts: 131
Joined: Fri Jan 20, 2017 2:22 pm
Location: Hellas

RE: Popup message

Post by slimatwar »

Thank you very much, KnightHawk75.
Post Reply

Return to “Lua Legion”