This patch contains
- a transcription of the "Introductory Tutorial" which is in the demos scenarios to use the new Tutorial.js script based on trigger instead of the old tutorial-ai
- and a removal of the tutorial-ai
Differential D526
Remove the tutorial-ai which is obsolete mimo on May 20 2017, 6:52 PM. Authored by
Details
This patch contains
play the tutorial without the patch (i.e. using the tutorial-ai) or with (i.e. using triggers). The missions are identical, with the same strings.
Diff Detail
Event TimelineComment Actions Build has FAILED Link to build: http://jw:8080/job/phabricator/1270/ Comment Actions Build is green Executing section Default... Executing section Source... Executing section JS... Executing section Python... Executing section Perl... http://jw:8080/job/phabricator_lint/5/ for more details. Comment Actions Build is green Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! http://jw:8080/job/phabricator/1293/ for more details. Comment Actions rebase patch after latest changes in Tutorial script.
Comment Actions Build is green Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files... http://jw:8080/job/phabricator/1896/ for more details. Comment Actions Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/maps/scripts/TriggerHelper.js | 45| » if·(owner·==·null) | | [NORMAL] JSHintBear: | | Use '===' to compare with 'null'. binaries/data/mods/public/maps/scripts/TriggerHelper.js | 206| » » if·(cmpTerritoryManager.GetOwner(pos.x,·pos.z)·==·0) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. Executing section XML GUI... Executing section Python... Executing section Perl... http://jw:8080/job/phabricator_lint/427/ for more details.
Comment Actions Build is green Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files... http://jw:8080/job/phabricator/1903/ for more details. Comment Actions Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/maps/scripts/TriggerHelper.js | 45| » if·(owner·==·null) | | [NORMAL] JSHintBear: | | Use '===' to compare with 'null'. binaries/data/mods/public/maps/scripts/TriggerHelper.js | 206| » » if·(cmpTerritoryManager.GetOwner(pos.x,·pos.z)·==·0) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. Executing section XML GUI... Executing section Python... Executing section Perl... http://jw:8080/job/phabricator_lint/428/ for more details. Comment Actions Rest appears good, though I didn't test it yet. (Got an opinion on whether the tutorial panel should become non-tranparent as proposed in #4738?)
Comment Actions Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/maps/scripts/TriggerHelper.js | 45| » if·(owner·==·null) | | [NORMAL] JSHintBear: | | Use '===' to compare with 'null'. binaries/data/mods/public/maps/scripts/TriggerHelper.js | 206| » » if·(cmpTerritoryManager.GetOwner(pos.x,·pos.z)·==·0) | | [NORMAL] JSHintBear: | | Use '===' to compare with '0'. Executing section XML GUI... Executing section Python... Executing section Perl... http://jw:8080/job/phabricator_lint/429/ for more details. Comment Actions Since the tutorials are in a separate translation resource, moving the strings from sim to maps resource and from maps to tutorials resource will add some overhead to transifex.
Comment Actions that's ok for me. But better do it in a following patch as i already had phabricator problems when moving and modifying a file in the same patch. Comment Actions Build is green Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files... http://jw:8080/job/phabricator/1904/ for more details. Comment Actions We should determine the the least buggy, most cost efficient (to both author and translators) solution. Comment Actions Do you mean that if a same sentence is in two different resources, it will be translated twice? I don't know how transifex works, but that would be a serious flaw of the system. Anyway, i really don't care how it is done: only the end result matters. We thus have two choices:
Comment Actions
This way the tutorial will be accessible to players, reside in the final directory and doesn't require any discussion from my side. Comment Actions ok i move them them to the tutorial folder and wait for anybody to do the needed gui (hopefully that'll come before A23). Comment Actions No comment. Index: binaries/data/mods/public/gui/gamesetup/gamesetup.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/gamesetup.js (revision 20087) +++ binaries/data/mods/public/gui/gamesetup/gamesetup.js (working copy) @@ -211,13 +211,13 @@ var g_IsNetworked; * Is this user in control of game settings (i.e. singleplayer or host of a multiplayergame). */ var g_IsController; /** - * Whether this is a tutorial. + * If given, launch a tutorial map. */ -var g_IsTutorial; +var g_TutorialMap; /** * To report the game to the lobby bot. */ var g_ServerName; @@ -941,11 +941,11 @@ function init(attribs) return; } g_IsNetworked = attribs.type != "offline"; g_IsController = attribs.type != "client"; - g_IsTutorial = !!attribs.tutorial; + g_TutorialMap = attribs.tutorial; g_ServerName = attribs.serverName; g_ServerPort = attribs.serverPort; g_StunEndpoint = attribs.stunEndpoint; if (!g_IsNetworked) @@ -1030,11 +1030,11 @@ function initGUIObjects() loadPersistMatchSettings(); updateGameAttributes(); sendRegisterGameStanzaImmediate(); - if (g_IsTutorial) + if (g_TutorialMap) { launchTutorial(); return; } @@ -1468,11 +1468,11 @@ function loadMapData(name) /** * Sets the gameattributes the way they were the last time the user left the gamesetup. */ function loadPersistMatchSettings() { - if (!g_IsController || Engine.ConfigDB_GetValue("user", "persistmatchsettings") != "true" || g_IsTutorial) + if (!g_IsController || Engine.ConfigDB_GetValue("user", "persistmatchsettings") != "true" || g_TutorialMap) return; let settingsFile = g_IsNetworked ? g_MatchSettings_MP : g_MatchSettings_SP; if (!Engine.FileExists(settingsFile)) return; @@ -1523,11 +1523,11 @@ function loadPersistMatchSettings() g_IsInGuiUpdate = false; } function savePersistMatchSettings() { - if (g_IsTutorial) + if (g_TutorialMap) return; let attributes = Engine.ConfigDB_GetValue("user", "persistmatchsettings") == "true" ? g_GameAttributes : {}; Engine.WriteJSONFile(g_IsNetworked ? g_MatchSettings_MP : g_MatchSettings_SP, attributes); } @@ -1880,11 +1880,11 @@ function launchGame() } function launchTutorial() { g_GameAttributes.mapType = "scenario"; - selectMap("maps/tutorials/starting_economy_walkthrough"); + selectMap("maps/tutorials/" + g_TutorialMap); launchGame(); } /** * Don't set any attributes here, just show the changes in the GUI. Index: binaries/data/mods/public/gui/pregame/mainmenu.xml =================================================================== --- binaries/data/mods/public/gui/pregame/mainmenu.xml (revision 20087) +++ binaries/data/mods/public/gui/pregame/mainmenu.xml (working copy) @@ -154,29 +154,43 @@ "url": "http://trac.wildfiregames.com/wiki/0adManual" }); </action> </object> - <!-- START TUTORIAL BUTTON --> + <!-- INTRODUCTORY TUTORIAL BUTTON --> <object type="button" style="StoneButtonFancy" size="0 32 100% 60" tooltip_style="pgToolTip" > - <translatableAttribute id="caption">Tutorial</translatableAttribute> + <translatableAttribute id="caption">Introductory Tutorial</translatableAttribute> + <translatableAttribute id="tooltip">Start the introductory tutorial.</translatableAttribute> + <action on="Press"> + Engine.SwitchGuiPage("page_gamesetup.xml", { "type": "offline", "tutorial": "Introductory_Tutorial" }); + </action> + </object> + + <!-- ECONOMIC WALKTHROUGH TUTORIAL BUTTON --> + <object + type="button" + style="StoneButtonFancy" + size="0 64 100% 92" + tooltip_style="pgToolTip" + > + <translatableAttribute id="caption">Economic Tutorial</translatableAttribute> <translatableAttribute id="tooltip">Start the economic tutorial.</translatableAttribute> <action on="Press"> - Engine.SwitchGuiPage("page_gamesetup.xml", { "type": "offline", "tutorial": true }); + Engine.SwitchGuiPage("page_gamesetup.xml", { "type": "offline", "tutorial": "starting_economy_walkthrough" }); </action> </object> <!-- STRUCTREE BUTTON --> <object style="StoneButtonFancy" type="button" - size="0 64 100% 92" + size="0 96 100% 124" tooltip_style="pgToolTip" > <translatableAttribute id="caption">Structure Tree</translatableAttribute> <translatableAttribute id="tooltip">View the structure tree of civilizations featured in 0 A.D.</translatableAttribute> <action on="Press"> @@ -187,11 +201,11 @@ <!-- HISTORY BUTTON --> <object style="StoneButtonFancy" type="button" - size="0 96 100% 124" + size="0 128 100% 156" tooltip_style="pgToolTip" > <translatableAttribute id="caption">History</translatableAttribute> <translatableAttribute id="tooltip">Learn about the many civilizations featured in 0 A.D.</translatableAttribute> <action on="Press"> @@ -449,11 +463,11 @@ > <translatableAttribute id="caption">Learn to Play</translatableAttribute> <translatableAttribute id="tooltip">Learn how to play, start the tutorial, discover the technology trees, and the history behind the civilizations</translatableAttribute> <action on="Press"> closeMenu(); - openMenu("submenuLearn", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 4); + openMenu("submenuLearn", (this.parent.size.top+this.size.top), (this.size.bottom-this.size.top), 5); </action> </object> <!-- SINGLEPLAYER BUTTON --> <object |