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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user