Difference between revisions of "Talk:Interacting with the game: Event-based programming"

From PioneerWiki
Jump to: navigation, search
(Created page with "The code examples seem to be outdated. I got this working: local Event = import("Event") local Comms = import("Comms") local welcome = function() Comms.Message ("...")
 
(Comment on changes)
 
Line 9: Line 9:
 
   
 
   
 
  Event.Register("onEnterSystem", welcome)
 
  Event.Register("onEnterSystem", welcome)
 +
 +
-- I edited the page to reflect your findings. I also think the tutorial could provide a complete '''Hello.lua''' file.

Latest revision as of 14:17, 23 September 2021

The code examples seem to be outdated. I got this working:

local Event = import("Event")
local Comms = import("Comms")

local welcome = function()  
    Comms.Message ("welcome to Pioneer!")
end

Event.Register("onEnterSystem", welcome)

-- I edited the page to reflect your findings. I also think the tutorial could provide a complete Hello.lua file.