temp script changes
This commit is contained in:
@@ -0,0 +1 @@
|
||||
--TODO: create a flexible saving & loading system
|
||||
@@ -2,11 +2,10 @@ print("Lua script check")
|
||||
|
||||
mapMaker = require "map_maker"
|
||||
mapSaver = require "map_saver"
|
||||
roomSystem = require "room_system"
|
||||
|
||||
--BUG: #35 The server fails without at least one room
|
||||
--TODO: Create rooms with names?
|
||||
newRoom = RoomManager.CreateRoom("overworld", "overworld.bmp")
|
||||
pager = Room.GetPager(newRoom)
|
||||
RegionPager.SetOnCreate(pager, mapMaker.debugIsland)
|
||||
--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)
|
||||
|
||||
print("Finished the lua script")
|
||||
|
||||
+2
-6
@@ -40,9 +40,7 @@
|
||||
#include "lua.hpp"
|
||||
#endif
|
||||
|
||||
#include "region_api.hpp"
|
||||
#include "region_pager_api.hpp"
|
||||
#include "tile_sheet_api.hpp"
|
||||
#include "map_system_api.hpp"
|
||||
#include "room_api.hpp"
|
||||
#include "room_manager_api.hpp"
|
||||
|
||||
@@ -61,9 +59,6 @@ static const luaL_Reg loadedlibs[] = {
|
||||
{LUA_DBLIBNAME, luaopen_debug},
|
||||
|
||||
//Tortuga's API
|
||||
{TORTUGA_REGION_NAME, openRegionAPI},
|
||||
{TORTUGA_REGION_PAGER_NAME, openRegionPagerAPI},
|
||||
{TORTUGA_TILE_SHEET_NAME, openTileSheetAPI},
|
||||
{TORTUGA_ROOM_NAME, openRoomAPI},
|
||||
{TORTUGA_ROOM_MANAGER_NAME, openRoomManagerAPI},
|
||||
|
||||
@@ -73,6 +68,7 @@ static const luaL_Reg loadedlibs[] = {
|
||||
|
||||
//these libs are preloaded and must be required before used
|
||||
static const luaL_Reg preloadedlibs[] = {
|
||||
{TORTUGA_MAP_SYSTEM_API, openMapSystemAPI},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ private:
|
||||
std::list<Entity*> entityList;
|
||||
|
||||
//lua references
|
||||
int createRef = LUA_NOREF;
|
||||
int loadRef = LUA_NOREF;
|
||||
int unloadRef = LUA_NOREF;
|
||||
};
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
//public methods
|
||||
//-------------------------
|
||||
|
||||
//BUG: #35 The server fails without at least one room
|
||||
|
||||
void ServerApplication::Init(int argc, char* argv[]) {
|
||||
//NOTE: I might need to rearrange the init process so that lua & SQL can interact with the map system as needed.
|
||||
std::cout << "Beginning " << argv[0] << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user