-- Exposed Variables Example local Hello = 10 local Speed = false function Expose() ModDebug.Log("Expose Function") -- Expose some variables to the game ModBase.ExposeVariable("Amazing Variable", Hello, ExposedCallback, 0, 20) ModBase.ExposeVariable("Speed", Speed, ExposedCallback) ModBase.ExposeVariable("Fun factor", 30, ExposedCallback, 20, 40) ModBase.ExposeVariable("Instant Win", true, ExposedCallback) -- Expose some keybindings to the game ModBase.ExposeKeybinding("Explosion1", 8, ExposedKeyCallback) ModBase.ExposeKeybinding("Explosion2", 4, ExposedKeyCallback) ModBase.ExposeKeybinding("Explosion3", 2, ExposedKeyCallback) ModBase.ExposeKeybinding("Explosion4", 3, ExposedKeyCallback) -- Register for input key presses ModBase.RegisterForInputPress(InputCallback) -- Register for input mouse button down events ModBase.RegisterForInputMouseButtonDown(MouseInputCallback) end -- Exposed Variable callback function ExposedCallback( value, name ) ModDebug.Log("Exposed Variable Callback - ",name," Changed to: ",value) end -- Exposed Key callback function ExposedKeyCallback( name ) -- Log ModDebug.Log("ExposedKeyCallback ",name) -- Play a sound when they press the "Explosion2" keybinding if( name == "Explosion2" ) then ModSound.PlayCustomSound("Explosion") end end -- Input Callback function InputCallback(param) ModDebug.Log("Player Pressed ",param) end -- Mouse Input Callback function MouseInputCallback(TilePositionX, TilePositionY, ObjectUID) ModDebug.Log("Mouse Down X:", TilePositionX, " Y:",TilePositionY," UID:",ObjectUID) end