#Panorama & Client Lua communication

1 messages · Page 1 of 1 (latest)

mighty bear
#

How to communicate between Panorama and Client Lua?
I've seen this diagram https://i.imgur.com/9AVlRil.png but couldn't find examples of it.

Currently I want to update my custom indicator library, by listening mouse positions on Panorama and give it to Client Lua.
And probably want to send something to Panorama as well.

flint ibex
#

from what i've tried, GameEvents.SendEventClientSide can be used to send stuff from panorama to client lua, and listened via ListenToGameEvent

none of the stuff from client lua reaches the panorama though (since only FireGameEvent / FireGameEventLocal is available, and none seems to trigger GameEvents.Subscribe - when sent from client lua)

for SendEventClientSide you need to register events in custom.gameevents

mighty bear
#

any example for this? I tried it, but somehow I got the message CreateEvent: event 'custom_indicator' not registered.

#

scripts/custom_events.txt:

"CustomEvents"
{
    "custom_indicator"
    {
        "ability"    "int"
        "worldX"    "float"
        "worldY"    "float"
        "behavior"  "int"
    }
}
#

panorama.js:

    GameEvents.SendEventClientSide( "custom_indicator", {
        worldX: mousePos.x,
        worldY: mousePos.y,
        ability: ability,
        behavior: behavior,
    });
}```
flint ibex
mighty bear
#

huh, somehow I missed it

small estuary
#

So how to transfer data form client lua to server lua or panorama?