I got an error when tried to save and load a scenario with some lua code. I used a float variable and megaglest tried to restore it as an integer.
I used this in my global script:
wavemultiplyer = 0.3;
Megeglest wrote this to the savegame file:
<LuaScript variable="wavemultiplyer" value="0.3" value_type="3"/>
When I tried to load the game, I got this:
[2013-08-17 21:34:15] *ERROR* In [/build/megaglest/src/megaglest-3.8.0-beta1/source/glest_game/game/script_manager.cpp::init 468]
error [Error converting from string to int, found: [0.3]
Stack Trace:
megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0xa71cd8] line: 0
megaglest:Shared::Util::strToInt(std::string const&)address [0xa480a1] line: 0
megaglest:Shared::Lua::LuaScript::loadGame(Shared::Xml::XmlNode const*)address [0xa02452] line: 0
megaglest:Glest::Game::ScriptManager::loadGame(Shared::Xml::XmlNode const*)address [0x5412ee] line: 0
megaglest:Glest::Game::ScriptManager::init(Glest::Game::World*, Glest::Game::GameCamera*, Shared::Xml::XmlNode const*)address [0x5442fa] line: 0
megaglest:Glest::Game::Game::init(bool)address [0x585096] line: 0
megaglest:Glest::Game::Program::setState(Glest::Game::ProgramState*, bool)address [0x652e68] line: 0
megaglest:Glest::Game::Game::loadGame(std::string, Glest::Game::Program*, bool, Glest::Game::GameSettings const*)address [0x580812] line: 0
megaglest:Glest::Game::MenuStateLoadGame::mouseClick(int, int, Shared::Platform::MouseButton)address [0x780cf8] line: 0
megaglest:Glest::Game::MainWindow::eventMouseDown(int, int, Shared::Platform::MouseButton)address [0x681d50] line: 0
megaglest:Shared::Platform::Window::handleMouseDown(SDL_Event)address [0xa7892a] line: 0
megaglest:Shared::Platform::Window::handleEvent()address [0xa794ea] line: 0
megaglest:Glest::Game::glestMain(int, char**)address [0x68e51e] line: 0
megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x6939d1] line: 0
/usr/lib/libc.so.6:__libc_start_main()address [0x7ff0b5025a15] line: 0
megaglest() [0x4c6d99]address [0x4c6d99] line: 0
]
[2013-08-17 21:34:15] *ERROR* In [/build/megaglest/src/megaglest-3.8.0-beta1/source/glest_game/global/lang.cpp::getScenarioString Line: 488] Error [Value not found in propertyMap: In [/build/megaglest/src/megaglest-3.8.0-beta1/source/glest_game/game/script_manager.cpp::init 468]
error [Error converting from string to int, found: [0.3]
Stack Trace:
megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0xa71cd8] line: 0
megaglest:Shared::Util::strToInt(std::string const&)address [0xa480a1] line: 0
megaglest:Shared::Lua::LuaScript::loadGame(Shared::Xml::XmlNode const*)address [0xa02452] line: 0
megaglest:Glest::Game::ScriptManager::loadGame(Shared::Xml::XmlNode const*)address [0x5412ee] line: 0
megaglest:Glest::Game::ScriptManager::init(Glest::Game::World*, Glest::Game::GameCamera*, Shared::Xml::XmlNode const*)address [0x5442fa] line: 0
megaglest:Glest::Game::Game::init(bool)address [0x585096] line: 0
megaglest:Glest::Game::Program::setState(Glest::Game::ProgramState*, bool)address [0x652e68] line: 0
megaglest:Glest::Game::Game::loadGame(std::string, Glest::Game::Program*, bool, Glest::Game::GameSettings const*)address [0x580812] line: 0
megaglest:Glest::Game::MenuStateLoadGame::mouseClick(int, int, Shared::Platform::MouseButton)address [0x780cf8] line: 0
megaglest:Glest::Game::MainWindow::eventMouseDown(int, int, Shared::Platform::MouseButton)address [0x681d50] line: 0
megaglest:Shared::Platform::Window::handleMouseDown(SDL_Event)address [0xa7892a] line: 0
megaglest:Shared::Platform::Window::handleEvent()address [0xa794ea] line: 0
megaglest:Glest::Game::glestMain(int, char**)address [0x68e51e] line: 0
megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x6939d1] line: 0
/usr/lib/libc.so.6:__libc_start_main()address [0x7ff0b5025a15] line: 0
megaglest() [0x4c6d99]address [0x4c6d99] line: 0
]