Fixed the scripts struggling with nested API tables

I actually don't remember what the RoomData's lua references where for,
but I'm pretty srue it wasn't this. I'll figure something out when I've
had a sleep.
This commit is contained in:
Kayne Ruse
2014-11-23 06:38:40 +11:00
parent 20d40d5b81
commit 5eeda8235d
5 changed files with 69 additions and 11 deletions
+24 -2
View File
@@ -4,8 +4,30 @@ mapMaker = require "map_maker"
mapSaver = require "map_saver"
roomSystem = require "room_system"
local function dumpTable(t)
print(t)
for k, v in pairs(t) do
print("",k, v)
end
end
dumpTable(mapMaker)
dumpTable(mapSaver)
dumpTable(roomSystem)
dumpTable(roomSystem.Room)
dumpTable(roomSystem.RoomManager)
--create the overworld, set it's generator, loader & saver
local overworld = roomSystem.CreateRoom("overworld", "overworld.bmp")
roomSystem.SetOnLoad(overworld, mapMaker.debugIsland, mapSaver.load, mapSaver.save)
local overworld = roomSystem.RoomManager.CreateRoom("overworld", "overworld.bmp")
roomSystem.Room.SetOnLoad(overworld, 1123)
roomSystem.Room.SetOnUnload(overworld, 458)
if roomSystem.Room.GetOnLoad(overworld) == 1123 then
print("onload retreival works")
end
if roomSystem.Room.GetOnUnload(overworld) == 458 then
print("onunload retreival works")
end
print("Finished the lua script")