Index: source/graphics/MapReader.cpp =================================================================== --- source/graphics/MapReader.cpp +++ source/graphics/MapReader.cpp @@ -372,7 +372,8 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("({})", ret); + ret.setObject(*JS_NewPlainObject(cx)); + if (m_ScriptSettings.empty()) return; Index: source/gui/IGUIObject.cpp =================================================================== --- source/gui/IGUIObject.cpp +++ source/gui/IGUIObject.cpp @@ -458,8 +458,7 @@ JSAutoRequest rq(cx); // Set up the 'mouse' parameter - JS::RootedValue mouse(cx); - m_pGUI->GetScriptInterface()->Eval("({})", &mouse); + JS::RootedValue mouse(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); m_pGUI->GetScriptInterface()->SetProperty(mouse, "x", m_pGUI->m_MousePos.x, false); m_pGUI->GetScriptInterface()->SetProperty(mouse, "y", m_pGUI->m_MousePos.y, false); m_pGUI->GetScriptInterface()->SetProperty(mouse, "buttons", m_pGUI->m_MouseButtons, false); Index: source/gui/MiniMap.cpp =================================================================== --- source/gui/MiniMap.cpp +++ source/gui/MiniMap.cpp @@ -242,8 +242,7 @@ float x, z; GetMouseWorldCoordinates(x, z); - JS::RootedValue coords(cx); - g_GUI->GetActiveGUI()->GetScriptInterface()->Eval("({})", &coords); + JS::RootedValue coords(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); g_GUI->GetActiveGUI()->GetScriptInterface()->SetProperty(coords, "x", x, false); g_GUI->GetActiveGUI()->GetScriptInterface()->SetProperty(coords, "z", z, false); ScriptEvent("worldclick", coords); Index: source/lobby/XmppClient.cpp =================================================================== --- source/lobby/XmppClient.cpp +++ source/lobby/XmppClient.cpp @@ -502,13 +502,12 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("([])", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); // Convert the internal data structure to a Javascript object. for (const std::pair >& p : m_PlayerMap) { - JS::RootedValue player(cx); - scriptInterface.Eval("({})", &player); + JS::RootedValue player(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(player, "name", wstring_from_utf8(p.first)); scriptInterface.SetProperty(player, "presence", wstring_from_utf8(p.second[0])); scriptInterface.SetProperty(player, "rating", wstring_from_utf8(p.second[1])); @@ -527,14 +526,14 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("([])", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); + const char* stats[] = { "name", "ip", "port", "stunIP", "stunPort", "hostUsername", "state", "nbp", "maxnbp", "players", "mapName", "niceMapName", "mapSize", "mapType", "victoryCondition", "startTime", "mods" }; for(const glooxwrapper::Tag* const& t : m_GameList) { - JS::RootedValue game(cx); - scriptInterface.Eval("({})", &game); + JS::RootedValue game(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); for (size_t i = 0; i < ARRAY_SIZE(stats); ++i) scriptInterface.SetProperty(game, stats[i], wstring_from_utf8(t->findAttribute(stats[i]).to_string())); @@ -553,12 +552,12 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("([])", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); + const char* attributes[] = { "name", "rank", "rating" }; for(const glooxwrapper::Tag* const& t : m_BoardList) { - JS::RootedValue board(cx); - scriptInterface.Eval("({})", &board); + JS::RootedValue board(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); for (size_t i = 0; i < ARRAY_SIZE(attributes); ++i) scriptInterface.SetProperty(board, attributes[i], wstring_from_utf8(t->findAttribute(attributes[i]).to_string())); @@ -577,12 +576,12 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("([])", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); + const char* stats[] = { "player", "rating", "totalGamesPlayed", "highestRating", "wins", "losses", "rank" }; for (const glooxwrapper::Tag* const& t : m_Profile) { - JS::RootedValue profile(cx); - scriptInterface.Eval("({})", &profile); + JS::RootedValue profile(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); for (size_t i = 0; i < ARRAY_SIZE(stats); ++i) scriptInterface.SetProperty(profile, stats[i], wstring_from_utf8(t->findAttribute(stats[i]).to_string())); @@ -619,8 +618,7 @@ { JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue ret(cx); - scriptInterface.Eval("({})", &ret); + JS::RootedValue ret(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(ret, "type", wstring_from_utf8(message.type)); if (!message.level.empty()) scriptInterface.SetProperty(ret, "level", wstring_from_utf8(message.level)); Index: source/network/NetClient.cpp =================================================================== --- source/network/NetClient.cpp +++ source/network/NetClient.cpp @@ -294,8 +294,7 @@ for (const std::pair& p : m_PlayerAssignments) { - JS::RootedValue assignment(cx); - GetScriptInterface().Eval("({})", &assignment); + JS::RootedValue assignment(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); GetScriptInterface().SetProperty(assignment, "name", CStrW(p.second.m_Name), false); GetScriptInterface().SetProperty(assignment, "player", p.second.m_PlayerID, false); GetScriptInterface().SetProperty(assignment, "status", p.second.m_Status, false); @@ -758,9 +757,8 @@ JSAutoRequest rq(cx); CKickedMessage* message = (CKickedMessage*)event->GetParamRef(); - JS::RootedValue msg(cx); + JS::RootedValue msg(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); - client->GetScriptInterface().Eval("({})", &msg); client->GetScriptInterface().SetProperty(msg, "username", message->m_Name); client->GetScriptInterface().SetProperty(msg, "type", CStr("kicked")); client->GetScriptInterface().SetProperty(msg, "banned", message->m_Ban != 0); Index: source/network/NetClientTurnManager.cpp =================================================================== --- source/network/NetClientTurnManager.cpp +++ source/network/NetClientTurnManager.cpp @@ -146,8 +146,8 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue msg(cx); - scriptInterface.Eval("({ 'type':'out-of-sync' })", &msg); + JS::RootedValue msg(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); + scriptInterface.SetProperty(msg, "type", std::wstring(L"out-of-sync")); scriptInterface.SetProperty(msg, "turn", turn); scriptInterface.SetProperty(msg, "players", playerNamesStrings); scriptInterface.SetProperty(msg, "expectedHash", expectedHashHex); Index: source/network/StunClient.cpp =================================================================== --- source/network/StunClient.cpp +++ source/network/StunClient.cpp @@ -391,8 +391,7 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue stunEndpoint(cx); - scriptInterface.Eval("({})", &stunEndpoint); + JS::RootedValue stunEndpoint(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(stunEndpoint, "ip", CStr(ipStr)); scriptInterface.SetProperty(stunEndpoint, "port", m_Port); return stunEndpoint; Index: source/ps/GameSetup/GameSetup.cpp =================================================================== --- source/ps/GameSetup/GameSetup.cpp +++ source/ps/GameSetup/GameSetup.cpp @@ -513,19 +513,16 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue playerAssignments(cx); - scriptInterface.Eval("({})", &playerAssignments); + JS::RootedValue playerAssignments(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); if (!networked) { - JS::RootedValue localPlayer(cx); - scriptInterface.Eval("({})", &localPlayer); + JS::RootedValue localPlayer(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(localPlayer, "player", g_Game->GetPlayerID()); scriptInterface.SetProperty(playerAssignments, "local", localPlayer); } - JS::RootedValue sessionInitData(cx); - scriptInterface.Eval("({})", &sessionInitData); + JS::RootedValue sessionInitData(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(sessionInitData, "attribs", attrs); scriptInterface.SetProperty(sessionInitData, "playerAssignments", playerAssignments); @@ -1097,7 +1094,7 @@ JS::RootedValue data(cx); if (g_GUI) { - scriptInterface->Eval("({})", &data); + data.setObject(*JS_NewPlainObject(cx)); scriptInterface->SetProperty(data, "isStartup", true); if (!installedMods.empty()) scriptInterface->SetProperty(data, "installedMods", installedMods); @@ -1257,12 +1254,9 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue attrs(cx); - scriptInterface.Eval("({})", &attrs); - JS::RootedValue settings(cx); - scriptInterface.Eval("({})", &settings); - JS::RootedValue playerData(cx); - scriptInterface.Eval("([])", &playerData); + JS::RootedValue attrs(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); + JS::RootedValue settings(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); + JS::RootedValue playerData(cx, JS::ObjectValue(*JS_NewArrayObject(cx, 0))); // The directory in front of the actual map name indicates which type // of map is being loaded. Drawback of this approach is the association @@ -1314,8 +1308,7 @@ // Set up player data for (size_t i = 0; i < numPlayers; ++i) { - JS::RootedValue player(cx); - scriptInterface.Eval("({})", &player); + JS::RootedValue player(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); // We could load player_defaults.json here, but that would complicate the logic // even more and autostart is only intended for developers anyway @@ -1402,7 +1395,7 @@ LOGWARNING("Autostart: Invalid player %d in autostart-team option", playerID); continue; } - scriptInterface.Eval("({})", &player); + player.setObject(*JS_NewPlainObject(cx)); } int teamID = civArgs[i].AfterFirst(":").ToInt() - 1; @@ -1433,7 +1426,7 @@ LOGWARNING("Autostart: Invalid player %d in autostart-ai option", playerID); continue; } - scriptInterface.Eval("({})", &player); + player.setObject(*JS_NewPlainObject(cx)); } CStr name = aiArgs[i].AfterFirst(":"); @@ -1461,7 +1454,7 @@ LOGWARNING("Autostart: Invalid player %d in autostart-aidiff option", playerID); continue; } - scriptInterface.Eval("({})", &player); + player.setObject(*JS_NewPlainObject(cx)); } int difficulty = civArgs[i].AfterFirst(":").ToInt(); @@ -1489,7 +1482,7 @@ LOGWARNING("Autostart: Invalid player %d in autostart-civ option", playerID); continue; } - scriptInterface.Eval("({})", &player); + player.setObject(*JS_NewPlainObject(cx)); } CStr name = civArgs[i].AfterFirst(":"); Index: source/ps/GameSetup/HWDetect.cpp =================================================================== --- source/ps/GameSetup/HWDetect.cpp +++ source/ps/GameSetup/HWDetect.cpp @@ -75,14 +75,14 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("[]", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); + for (size_t idxLevel = 0; idxLevel < x86_x64::Cache::maxLevels; ++idxLevel) { const x86_x64::Cache* pcache = x86_x64::Caches(idxCache+idxLevel); if (pcache->m_Type == x86_x64::Cache::kNull || pcache->m_NumEntries == 0) continue; - JS::RootedValue cache(cx); - scriptInterface.Eval("({})", &cache); + JS::RootedValue cache(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(cache, "type", static_cast(pcache->m_Type)); scriptInterface.SetProperty(cache, "level", static_cast(pcache->m_Level)); scriptInterface.SetProperty(cache, "associativity", static_cast(pcache->m_Associativity)); @@ -98,14 +98,14 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - scriptInterface.Eval("[]", ret); + ret.setObject(*JS_NewArrayObject(cx, 0)); + for(size_t i = 0; ; i++) { const x86_x64::Cache* ptlb = x86_x64::Caches(x86_x64::TLB+i); if (!ptlb) break; - JS::RootedValue tlb(cx); - scriptInterface.Eval("({})", &tlb); + JS::RootedValue tlb(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(tlb, "type", static_cast(ptlb->m_Type)); scriptInterface.SetProperty(tlb, "level", static_cast(ptlb->m_Level)); scriptInterface.SetProperty(tlb, "associativity", static_cast(ptlb->m_Associativity)); @@ -233,8 +233,7 @@ // (We'll use this same data for the opt-in online reporting system, so it // includes some fields that aren't directly useful for the hwdetect script) - JS::RootedValue settings(cx); - scriptInterface.Eval("({})", &settings); + JS::RootedValue settings(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(settings, "os_unix", OS_UNIX); scriptInterface.SetProperty(settings, "os_bsd", OS_BSD); Index: source/ps/Mod.cpp =================================================================== --- source/ps/Mod.cpp +++ source/ps/Mod.cpp @@ -143,9 +143,8 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue metainfo(cx); JS::RootedValue mods(cx, Mod::GetLoadedModsWithVersions(scriptInterface)); - scriptInterface.Eval("({})", &metainfo); + JS::RootedValue metainfo(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(metainfo, "engine_version", std::string(engine_version)); scriptInterface.SetProperty(metainfo, "mods", mods); Index: source/ps/ProfileViewer.cpp =================================================================== --- source/ps/ProfileViewer.cpp +++ source/ps/ProfileViewer.cpp @@ -530,15 +530,13 @@ JSContext* cx = m_ScriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue data(cx); - m_ScriptInterface.Eval("({})", &data); + JS::RootedValue data(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); const std::vector& columns = table->GetColumns(); for (size_t r = 0; r < table->GetNumberRows(); ++r) { - JS::RootedValue row(cx); - m_ScriptInterface.Eval("([])", &row); + JS::RootedValue row(cx, JS::ObjectValue(*JS_NewArrayObject(cx, 0))); m_ScriptInterface.SetProperty(data, table->GetCellText(r, 0).c_str(), row); if (table->GetChild(r)) Index: source/ps/SavedGame.cpp =================================================================== --- source/ps/SavedGame.cpp +++ source/ps/SavedGame.cpp @@ -79,10 +79,10 @@ if (!simulation.SerializeState(simStateStream)) WARN_RETURN(ERR::FAIL); - JS::RootedValue metadata(cx); JS::RootedValue initAttributes(cx, simulation.GetInitAttributes()); JS::RootedValue mods(cx, Mod::GetLoadedModsWithVersions(simulation.GetScriptInterface())); - simulation.GetScriptInterface().Eval("({})", &metadata); + + JS::RootedValue metadata(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); simulation.GetScriptInterface().SetProperty(metadata, "engine_version", std::string(engine_version)); simulation.GetScriptInterface().SetProperty(metadata, "mods", mods); simulation.GetScriptInterface().SetProperty(metadata, "time", (double)now); @@ -93,8 +93,7 @@ simulation.GetScriptInterface().ReadStructuredClone(guiMetadataClone, &guiMetadata); // get some camera data - JS::RootedValue cameraMetadata(cx); - simulation.GetScriptInterface().Eval("({})", &cameraMetadata); + JS::RootedValue cameraMetadata(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); const CVector3D cameraPosition = g_Game->GetView()->GetCameraPosition(); simulation.GetScriptInterface().SetProperty(cameraMetadata, "PosX", cameraPosition.X); simulation.GetScriptInterface().SetProperty(cameraMetadata, "PosY", cameraPosition.Y); @@ -260,8 +259,7 @@ } JS::RootedValue metadata(cx, loader.GetMetadata()); - JS::RootedValue game(cx); - scriptInterface.Eval("({})", &game); + JS::RootedValue game(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(game, "id", pathnames[i].Basename()); scriptInterface.SetProperty(game, "metadata", metadata); JS_SetElement(cx, games, i, game); Index: source/ps/VisualReplay.cpp =================================================================== --- source/ps/VisualReplay.cpp +++ source/ps/VisualReplay.cpp @@ -189,7 +189,8 @@ continue; CFileInfo fileInfo; GetFileInfo(replayFile, &fileInfo); - scriptInterface.Eval("({})", &replayData); + + replayData.setObject(*JS_NewPlainObject(cx)); scriptInterface.SetProperty(replayData, "directory", directory.string()); scriptInterface.SetProperty(replayData, "fileSize", (double)fileInfo.Size()); } @@ -399,8 +400,7 @@ return JS::NullValue(); // Return the actual data - JS::RootedValue replayData(cx); - scriptInterface.Eval("({})", &replayData); + JS::RootedValue replayData(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(replayData, "directory", directory.string()); scriptInterface.SetProperty(replayData, "fileSize", (double)fileSize); scriptInterface.SetProperty(replayData, "attribs", attribs); @@ -422,8 +422,7 @@ // Create empty JS object JSContext* cx = pCxPrivate->pScriptInterface->GetContext(); JSAutoRequest rq(cx); - JS::RootedValue attribs(cx); - pCxPrivate->pScriptInterface->Eval("({})", &attribs); + JS::RootedValue attribs(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); // Return empty object if file doesn't exist const OsPath replayFile = GetDirectoryPath() / directoryName / L"commands.txt"; Index: source/simulation2/Simulation2.cpp =================================================================== --- source/simulation2/Simulation2.cpp +++ source/simulation2/Simulation2.cpp @@ -981,8 +981,8 @@ JS::RootedValue aiData(cx, ICmpAIManager::GetAIs(scriptInterface)); // Build single JSON string with array of AI data - JS::RootedValue ais(cx); - if (!scriptInterface.Eval("({})", &ais) || !scriptInterface.SetProperty(ais, "AIData", aiData)) + JS::RootedValue ais(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); + if (!scriptInterface.SetProperty(ais, "AIData", aiData)) return std::string(); return scriptInterface.StringifyJSON(&ais); Index: source/simulation2/components/CCmpAIManager.cpp =================================================================== --- source/simulation2/components/CCmpAIManager.cpp +++ source/simulation2/components/CCmpAIManager.cpp @@ -630,7 +630,7 @@ m_HasLoadedEntityTemplates = true; - m_ScriptInterface->Eval("({})", &m_EntityTemplates); + m_EntityTemplates.setObject(*JS_NewPlainObject(cx));; JS::RootedValue val(cx); for (size_t i = 0; i < templates.size(); ++i) @@ -1182,8 +1182,7 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue classesVal(cx); - scriptInterface.Eval("({})", &classesVal); + JS::RootedValue classesVal(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); std::map classes; cmpPathfinder->GetPassabilityClasses(classes); Index: source/simulation2/components/ICmpAIManager.cpp =================================================================== --- source/simulation2/components/ICmpAIManager.cpp +++ source/simulation2/components/ICmpAIManager.cpp @@ -63,10 +63,9 @@ std::advance(it, 2); std::wstring dirname = GetWstringFromWpath(*it); - JS::RootedValue ai(cx); + JS::RootedValue ai(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); JS::RootedValue data(cx); self->m_ScriptInterface.ReadJSONFile(pathname, &data); - self->m_ScriptInterface.Eval("({})", &ai); self->m_ScriptInterface.SetProperty(ai, "id", dirname, true); self->m_ScriptInterface.SetProperty(ai, "data", data, true); u32 length; Index: source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp =================================================================== --- source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp +++ source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp @@ -98,8 +98,7 @@ scriptInterface.ParseJSON(*msg->settings, &settings); scriptInterface.SetProperty(settings, "mapType", std::string("random")); - JS::RootedValue attrs(cx); - scriptInterface.Eval("({})", &attrs); + JS::RootedValue attrs(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(attrs, "mapType", std::string("random")); scriptInterface.SetProperty(attrs, "script", std::wstring(*msg->filename)); scriptInterface.SetProperty(attrs, "settings", settings); @@ -121,22 +120,18 @@ JSContext* cx = scriptInterface.GetContext(); JSAutoRequest rq(cx); - JS::RootedValue settings(cx); - scriptInterface.Eval("({})", &settings); + JS::RootedValue settings(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); // Set up 8-element array of empty objects to satisfy init - JS::RootedValue playerData(cx); - scriptInterface.Eval("([])", &playerData); + JS::RootedValue playerData(cx, JS::ObjectValue(*JS_NewArrayObject(cx, 0))); for (int i = 0; i < 8; ++i) { - JS::RootedValue player(cx); - scriptInterface.Eval("({})", &player); + JS::RootedValue player(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetPropertyInt(playerData, i, player); } scriptInterface.SetProperty(settings, "mapType", std::string("scenario")); scriptInterface.SetProperty(settings, "PlayerData", playerData); - JS::RootedValue atts(cx); - scriptInterface.Eval("({})", &atts); + JS::RootedValue atts(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(atts, "mapType", std::string("scenario")); scriptInterface.SetProperty(atts, "map", std::wstring(L"maps/scenarios/_default")); scriptInterface.SetProperty(atts, "settings", settings); @@ -158,8 +153,7 @@ CStrW map = *msg->filename; CStrW mapBase = map.BeforeLast(L".pmp"); // strip the file extension, if any - JS::RootedValue attrs(cx); - scriptInterface.Eval("({})", &attrs); + JS::RootedValue attrs(cx, JS::ObjectValue(*JS_NewPlainObject(cx))); scriptInterface.SetProperty(attrs, "mapType", std::string("scenario")); scriptInterface.SetProperty(attrs, "map", std::wstring(mapBase));