[Orxonox-commit 7247] r11861 - in code/branches/ScriptableController_FS18: data/levels src/orxonox src/orxonox/scriptablecontroller

adamc at orxonox.net adamc at orxonox.net
Thu Apr 12 16:16:02 CEST 2018


Author: adamc
Date: 2018-04-12 16:16:02 +0200 (Thu, 12 Apr 2018)
New Revision: 11861

Modified:
   code/branches/ScriptableController_FS18/data/levels/scriptController.oxw
   code/branches/ScriptableController_FS18/src/orxonox/Level.cc
   code/branches/ScriptableController_FS18/src/orxonox/Level.h
   code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller.cc
Log:
scriptablecontroller fixed the No-Script-Option_Error (?)

Modified: code/branches/ScriptableController_FS18/data/levels/scriptController.oxw
===================================================================
--- code/branches/ScriptableController_FS18/data/levels/scriptController.oxw	2018-04-12 14:12:54 UTC (rev 11860)
+++ code/branches/ScriptableController_FS18/data/levels/scriptController.oxw	2018-04-12 14:16:02 UTC (rev 11861)
@@ -17,7 +17,7 @@
 ?>
 
 <Level
-  gametype = Deathmatch
+  
 >
   <templates>
     <Template link=lodtemplate_default />

Modified: code/branches/ScriptableController_FS18/src/orxonox/Level.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/Level.cc	2018-04-12 14:12:54 UTC (rev 11860)
+++ code/branches/ScriptableController_FS18/src/orxonox/Level.cc	2018-04-12 14:16:02 UTC (rev 11861)
@@ -80,7 +80,7 @@
         XMLPortParam(Level, "plugins",  setPluginsString,  getPluginsString,  xmlelement, mode);
         XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype");
 
-        XMLPortParamLoadOnly(Level, "script", setScript, xmlelement, mode);
+        XMLPortParamLoadOnly(Level, "script", setScript, xmlelement, mode).defaultValues("scripts/empty.lua");
 
         XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode);
         XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false);

Modified: code/branches/ScriptableController_FS18/src/orxonox/Level.h
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/Level.h	2018-04-12 14:12:54 UTC (rev 11860)
+++ code/branches/ScriptableController_FS18/src/orxonox/Level.h	2018-04-12 14:16:02 UTC (rev 11861)
@@ -86,7 +86,9 @@
             void networkcallback_applyXMLFile();
 
             inline void setScript(const std::string &script)
-                { this->level_script_ = script; }
+                {   
+                    orxout(internal_warning) << "hi world" << endl;
+                    this->level_script_ = script; }
 
 
             std::string                    pluginsString_;

Modified: code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller.cc
===================================================================
--- code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller.cc	2018-04-12 14:12:54 UTC (rev 11860)
+++ code/branches/ScriptableController_FS18/src/orxonox/scriptablecontroller/scriptable_controller.cc	2018-04-12 14:16:02 UTC (rev 11861)
@@ -13,9 +13,11 @@
 {
     int ret;
 
-    // Not having a script specified at all is not an error
-    if(file_path.empty())
+    // Not having a script specified at all is not an error.
+    if(file_path.empty()){
+        orxout(internal_warning) << "No script specified!" << std::endl;
         return 0;
+    }
 
     // Create a lua object
     lua_State *lua = luaL_newstate();
@@ -25,7 +27,7 @@
         return LUA_ERRMEM;
     }
 
-    // Make standard libraries available in the Lua object
+    // Make standard libraries available in the Lua object.
     luaL_openlibs(lua);
 
     // Register the API



More information about the Orxonox-commit mailing list