The contents of flaman.lua are:
- Code: Select all
local flaman = {}
-- this is just to try things out.
function flaman.update(speed)
return 3.6*speed
end
return flaman
The (relevant) contents of EngineScript.lua are:
- Code: Select all
-- Load modules
flaman = require("flaman")
... So here's where initialise() and setup() happen but I can't be bothered to write pseudocode for that ...
-- Then do stuff in update()
function update(dTime)
-- Query TS about how fast we're going.
local speed = Call("GetSpeed")
-- Let's do something with the speedometer!
local TheSpeedToDisplay = flaman.update(speed)
end
However, this blows up. In fact, I am confident that it blows up at the line where the module is loaded. The daft thing is that I don't really see what I'm doing wrong here!