Le Barde Posted June 17, 2014 Report Share Posted June 17, 2014 (edited) EDIT: see comment 17 for the mod!Hello,I would like to map a function I type in the console (e.g. Engine.SetSimRate(1)) to a button.I cannot see anything in the user.cfg.Is that possible ?Thanks alot ! Edited June 19, 2014 by Le Barde Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 17, 2014 Report Share Posted June 17, 2014 First, you give a name to the hotkey in the cfg file (as you'll find a lot of names in the default.cfg). Then you make sure the GUI listens to that hotkey by adding it as an object. If you're using SVN, I just split-off the hotkeys, see http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/session/hotkeys. Either add a file (that's better when you have a mod, the file will be automatically loaded, and when we change the hotkeys, the change will also go to your mod). Or modify a file (if you're wanting to get it into public, or make a total conversion mod, so not relying on public). 1 Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 (edited) Thanks for your answer.To go further : I would like to make a toggle between Engine.SetSimRate(1) and Engine.SetSimRate(0).I have made :$ mkdir -p ~/.config/0ad/mods/public/gui/session/hotkeys$ echo >> ~/.config/0ad/mods/public/gui/session/hotkeys/activepause.xml <<EOF <object hotkey="active_pause"> <action on="Press">Engine.SetSimRate(0);</action> <action off="Press">Engine.SetSimRate(1);</action> </object>EOF$ echo "hotkey.activepause = P" >> ~/.config/0ad/config/user.cfgBut there is no result.1) On linux (here, Debian) can we create mods in the $HOME/.config/0ad directory ?2) What is wrong ?I have launched 0ad once, and the program has modified the user.cfg into hotkey.activepause = "P" (instead hotkey.activepause = P without the brackets). So I guess the option is rightly written here.I guess the activepause.xml is not recognized.Is that right ? Could I get around this ?Thanks !EDIT : putting the activepause.xml into a new directory /usr/share/games/0ad/mods/public/gui/session/hotkeys doesn't solve the problem. Edited June 18, 2014 by Le Barde Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 Ok I have seen this and (important) this, but still there is nothing ingame... Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 18, 2014 Report Share Posted June 18, 2014 Thanks for your answer.To go further : I would like to make a toggle between Engine.SetSimRate(1) and Engine.SetSimRate(0).I have made :$ mkdir -p ~/.config/0ad/mods/public/gui/session/hotkeys$ echo >> ~/.config/0ad/mods/public/gui/session/hotkeys/activepause.xml <<EOF <object hotkey="active_pause"> <action on="Press">Engine.SetSimRate(0);</action> <action off="Press">Engine.SetSimRate(1);</action> </object>EOF$ echo "hotkey.activepause = P" >> ~/.config/0ad/config/user.cfgBut there is no result.1) On linux (here, Debian) can we create mods in the $HOME/.config/0ad directory ?Mods have to be in ~/.local/share/0ad/mods/ I think, but if you use SVN, you can also place them directly in binaries/data/mods/ under the directory you checked out. Keeps your work and the work you use for reference closer.2) What is wrong ? There's no "on" and "off" for buttons. If you want to switch between two states, you need to keep a (possibly global) variable somewhere with the current state.I have launched 0ad once, and the program has modified the user.cfg into hotkey.activepause = "P" (instead hotkey.activepause = P without the brackets). So I guess the option is rightly written here.I guess the activepause.xml is not recognized.Is that right ? Could I get around this ?Thanks !EDIT : putting the activepause.xml into a new directory /usr/share/games/0ad/mods/public/gui/session/hotkeys doesn't solve the problem.You shouldn't have to create that directory. As I said, it's a new change, so you can only use it if you use the latest SVN checkout. If you're using the A16 release (which looks like it given the path), you'll have to edit the massively big gui/session/session.xml file. But that will cause conflicts with our future versions of the session.xml which are hard to maintain since the file is so big.That's the reason I split off certain parts of that file (s.a. the hotkeys). But it's only available in the development version now. 2 Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 OK Thanks again :-)Actually, I do use the A16 release, which is in the debian wheezy-backports repository. But if this is necessary I will use the SVN version.Just in case, I had corrected active_pause to activepause in the xml file. I had also seen it in http://trac.wildfiregames.com/wiki/GameDataPaths, so I have placed the mod into a new directory ~/.local/share/0ad/mods/activepause.Now I think I have to dive into debugging. And as you said, I assume I cannot prevent me from writing javascript!But it could be nice to add an action "off" to hotkeys. This could benefit to the community for this kind of stuff.So I am going on! Thanks. Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 Hi,So I have made a new directory inside ~/.local/share/0ad/modsHere is my ~/.local/share/0ad/mods/activepause/activepause.xml :<?xml version="1.0" encoding="utf-8"?><object> <!-- Pause: It adds the functionality of an active pause. Now you can give orders and make actions during this pause. --> <object hotkey="activepause"> <action on="Press" file="activepause.js"></action> <!-- <action off="Press">Engine.SetSimRate(1);</action> --> </object></object>Here is my ~/.local/share/0ad/mods/activepause/activepause.js :print("Calling module activepause..."); // For debugging.if (__activepause == true){ Engine.SetSimRate(1); __activepause == false;}else{ Engine.SetSimRate(0.05); __activepause == true;}And then I have added this following line in ~.config/0ad/config/user.cfg :hotkey.activepause = "P"Still there is nothing to be seen, no error or warning message. But It is right that 0ad accesses (and modifies) ~.config/0ad/config/user.cfg.I cannot see if 0ad accesses ~/.local/share/0ad/mods/activepause/activepause.xml.What am I doing wrong ?If I manage to make this plugin, I think I will publish it!Thanks by advance. Quote Link to comment Share on other sites More sharing options...
niektb Posted June 18, 2014 Report Share Posted June 18, 2014 (edited) Did you launch the mod (using the -mod=activepause argument)? Also you need to retain the same map structure as the public mod. Therefore you need to place your files in the same folder as the other hotkeys but in your own mod instead of the public mod. Edited June 18, 2014 by niektb 1 Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 Thanks for your answer.So, I have created and restructured my mod.Here is what it looks like :lebarde@my-home:~/.local/share/0ad$ tree.|-- mods| |-- activepause| | `-- gui| | `-- session| | `-- hotkeys| | |-- activepause.js| | |-- activepause.js~| | |-- activepause.xml| | `-- activepause.xml~| |-- public| `-- user|-- saves| |-- quicksave-0001.0adsave| |-- quicksave-0002.0adsave| |-- savegame-0001.0adsave| |-- savegame-0002.0adsave| |-- savegame-0003.0adsave| |-- savegame-0004.0adsave| `-- savegame-0005.0adsave`-- screenshots `-- screenshot0001.png9 directories, 12 filesThis appears to be normal.Here are the new files as I have modified them :activepause.xml :<?xml version="1.0" encoding="utf-8"?><script file="activepause.js"/><!-- Pause: It adds the functionality of an active pause. Now you can give orders and make actions during this pause. --><object hotkey="activepause"> <action on="Press">ActivePause();</action> <!-- <action off="Press">Engine.SetSimRate(1);</action> --></object>And for the activepause.js :print("Calling module activepause..."); // For debugging.var __activepause = false;function ActivePause(){ if (__activepause) { Engine.SetSimRate(1); __activepause == false; } else { Engine.SetSimRate(0.05); __activepause == true; }}And the .config/0ad/config/user.cfg :developeroverlay.enable = "true"gentangents = "true"hotkey.activepause = "P"particles = "false"postproc = "false"preferglsl = "true"shadowpcf = "false"shadows = "false"showsky = "false"silhouettes = "false"smoothlos = "false"sound.mastergain = "0.9"splashscreenenable = "true"splashscreenversion = "1398339194"userreport.enabledversion = "1"userreport.id = "a9b012077260ee10"vsync = "false"watercoastalwaves = "false"waterfoam = "false"waternormals = "false"waterrealdepth = "false"waterreflection = "false"waterrefraction = "false"watershadows = "false"windowed = "true"Now here is what I get :lebarde@my-home:~$ 0ad -mod=activepauseCache: 500 (total: 7692) MiBTIMER| InitVfs: 80.603 msSound: AlcInit success, using OpenAL SoftTIMER| CONFIG_Init: 7.1709 msWARNING: gnome-keyring:: couldn't connect to: /home/lebarde/.cache/keyring-DhZ4jo/pkcs11: No such file or directoryATTENTION: default value of option force_s3tc_enable overridden by environment.TIMER| RunHardwareDetection: 20.9222 msTIMER| write_sys_info: 16.3374 msTIMER| InitRenderer: 731.505 usTIMER| ps_console: 3.0845 msTIMER| ps_lang_hotkeys: 765.6 usTIMER| common/modern/setup.xml: 274.264 usTIMER| common/modern/styles.xml: 190.625 usTIMER| common/modern/sprites.xml: 1.99312 msTIMER| common/setup.xml: 875.628 usTIMER| common/sprite1.xml: 2.01844 msTIMER| common/styles.xml: 69.618 usTIMER| common/common_sprites.xml: 2.71084 msTIMER| common/common_styles.xml: 289.476 usTIMER| common/init.xml: 1.33301 msTIMER| pregame/sprites.xml: 405.938 usTIMER| pregame/styles.xml: 44.048 usTIMER| pregame/mainmenu.xml: 31.5562 msTIMER| common/global.xml: 511.626 ussys_cursor_create: using Xcursor to create 32 x 32 cursor// Here I select new gameTIMER| common/modern/setup.xml: 189.083 usTIMER| common/modern/styles.xml: 157.205 usTIMER| common/modern/sprites.xml: 1.815 msTIMER| common/setup.xml: 663.961 usTIMER| common/sprite1.xml: 1.50726 msTIMER| common/styles.xml: 26.777 usTIMER| common/common_sprites.xml: 1.79653 msTIMER| common/common_styles.xml: 267.9 usTIMER| gamesetup/setup.xml: 86.724 usTIMER| gamesetup/sprites.xml: 49.606 usTIMER| gamesetup/styles.xml: 50.038 usTIMER| gamesetup/gamesetup.xml: 17.8017 msTIMER| common/global.xml: 687.581 us// Here I launch the mapTIMER| common/modern/setup.xml: 190.979 usTIMER| common/modern/styles.xml: 158.861 usTIMER| common/modern/sprites.xml: 1.83927 msTIMER| common/setup.xml: 656.008 usTIMER| common/sprite1.xml: 1.5098 msTIMER| common/styles.xml: 26.534 usTIMER| common/common_sprites.xml: 1.87284 msTIMER| common/common_styles.xml: 264.004 usTIMER| common/init.xml: 1.2539 msTIMER| loading/styles.xml: 84.217 usTIMER| loading/sprites.xml: 296.126 usTIMER| loading/loading.xml: 1.38214 msTIMER| common/global.xml: 384.31 ussys_cursor_create: using Xcursor to create 32 x 32 cursorTIMER| common/modern/setup.xml: 198.669 usTIMER| common/modern/styles.xml: 160.616 usTIMER| common/modern/sprites.xml: 1.84991 msTIMER| common/setup.xml: 595.249 usTIMER| common/sprite1.xml: 1.44162 msTIMER| common/styles.xml: 26.828 usTIMER| common/common_sprites.xml: 1.77502 msTIMER| common/common_styles.xml: 227.334 usTIMER| common/icon_sprites.xml: 92.78 usTIMER| session/sprites.xml: 2.41625 msTIMER| session/setup.xml: 70.312 usTIMER| session/styles.xml: 207.222 usTIMER| session/session.xml: 94.7213 msTIMER| common/global.xml: 3.18788 msGAME STARTED, ALL INIT COMPLETE// Cannot use the mod...// Here I quit the gamesys_cursor_create: using Xcursor to create 32 x 32 cursorTIMER| common/modern/setup.xml: 216.289 usTIMER| common/modern/styles.xml: 161.107 usTIMER| common/modern/sprites.xml: 1.84676 msTIMER| common/setup.xml: 619.367 usTIMER| common/sprite1.xml: 1.48352 msTIMER| common/styles.xml: 31.735 usTIMER| common/common_sprites.xml: 1.7731 msTIMER| common/common_styles.xml: 242.543 usTIMER| msgbox/msgbox.xml: 943.131 usTIMER| common/modern/setup.xml: 208.462 usTIMER| common/modern/styles.xml: 181.902 usTIMER| common/modern/sprites.xml: 1.89875 msTIMER| common/setup.xml: 632.576 usTIMER| common/sprite1.xml: 1.48313 msTIMER| common/styles.xml: 27.809 usTIMER| common/common_sprites.xml: 1.78461 msTIMER| common/common_styles.xml: 285.547 usTIMER| common/icon_sprites.xml: 61.212 usTIMER| common/init.xml: 1.39327 msTIMER| summary/summary.xml: 149.032 msTIMER| summary/sprites.xml: 288.494 usTIMER| common/global.xml: 7.76019 ms// Here I close 0adTIMER| common/modern/setup.xml: 190.619 usTIMER| common/modern/styles.xml: 160.255 usTIMER| common/modern/sprites.xml: 1.83109 msTIMER| common/setup.xml: 593.267 usTIMER| common/sprite1.xml: 1.44863 msTIMER| common/styles.xml: 26.74 usTIMER| common/common_sprites.xml: 1.75064 msTIMER| common/common_styles.xml: 229.485 usTIMER| common/init.xml: 1.3294 msTIMER| pregame/sprites.xml: 371.31 usTIMER| pregame/styles.xml: 25.398 usTIMER| pregame/mainmenu.xml: 6.19916 msTIMER| common/global.xml: 433.648 usTIMER| common/modern/setup.xml: 189.17 usTIMER| common/modern/styles.xml: 156.008 usTIMER| common/modern/sprites.xml: 1.81165 msTIMER| common/setup.xml: 587.768 usTIMER| common/sprite1.xml: 1.43463 msTIMER| common/styles.xml: 26.644 usTIMER| common/common_sprites.xml: 1.73413 msTIMER| common/common_styles.xml: 221 usTIMER| msgbox/msgbox.xml: 736.09 usTIMER| shutdown TexMan: 14.129 usTIMER| shutdown Renderer: 18.2813 msTIMER| shutdown SDL: 28.045 msTIMER| shutdown UserReporter: 183.557 usTIMER| shutdown ConfigDB: 0.635 usAL lib: FreeContext: (0x22deaf0) Deleting 64 Source(s)TIMER| resource modules: 455.964 msTIMER TOTALS (9 clients)----------------------------------------------------- tc_pool_alloc: 32.814 Mc (3860x) tc_dds_transform: 17.481 Mc (1222x) tc_png_decode: 4364.27 kc (17x) tc_transform: 30.2627 Mc (411x) tc_plain_transform: 12.0722 Mc (411x) tc_ShaderGLSLLink: 290.827 Mc (31x) tc_ShaderGLSLCompile: 242.222 Mc (62x) tc_ShaderValidation: 10.7549 Mc (35x) xml_validation: 75.4258 Mc (134x)-----------------------------------------------------TIMER| shutdown misc: 235.142 uslebarde@my-home:~$What can be wrong inside ? Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 18, 2014 Report Share Posted June 18, 2014 Your mod certainly doesn't get loaded, as your XML file is wrong. An XML file may only have one root node (in the case of included XML files, a root node with the name "object". If you want your script to be ran, place it in the session/ directory, and it will be loaded automatically. Anyway, my suspicion is that your "0ad" commands points to a shell script which doesn't pass on the arguments to pyrogenesis. Can you find out what "0ad" is on your system? "which 0ad" should tell you the complete path, after which you can open it. If you're not sure about the script, try with pyrogenesis directly. 1 Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 I have corrected the XML file, so that should be OK now. Here it is :<?xml version="1.0" encoding="utf-8"?><object> <script file="activepause.js"/> <!-- Pause: It adds the functionality of an active pause. Now you can give orders and make actions during this pause. --> <object hotkey="activepause"> <action on="Press">ActivePause();</action> <!-- <action off="Press">Engine.SetSimRate(1);</action> --> </object></object>Next, the 0ad command points to /usr/games/0ad, which contains :#!/bin/shpyrogenesis=$(which pyrogenesis 2> /dev/null)if [ -x "$pyrogenesis" ] ; then "$pyrogenesis" "$@"else echo "Error: pyrogenesis not found in ($PATH)" exit 1fiso apparently it passes the arguments to pyrogenesis.But when I launch pyrogenesis, I get the following error and a box giving me a stack trace.lebarde@my-home:~$ pyrogenesisPaths.cpp(169): Function call failed: return value was -110301 (Error during IO)Function call failed: return value was -110301 (Error during IO)Location: Paths.cpp:169 (Root)Call stack:(0x8273da) pyrogenesis() [0x8273da](0x7de6e1) pyrogenesis() [0x7de6e1](0x7de8dd) pyrogenesis() [0x7de8dd](0x7df29b) pyrogenesis() [0x7df29b](0x5bae63) pyrogenesis() [0x5bae63](0x5bc6b1) pyrogenesis() [0x5bc6b1](0x5b6e42) pyrogenesis() [0x5b6e42](0x5b98e3) pyrogenesis() [0x5b98e3](0x42c49d) pyrogenesis() [0x42c49d](0x422287) pyrogenesis() [0x422287](0x7fa9f8ecfead) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fa9f8ecfead](0x42ba35) pyrogenesis() [0x42ba35]errno = 0 (Error during IO)OS error = ?ERROR: Cannot find executable (expected at '')Paths.cpp(176): Function call failed: return value was -110301 (Error during IO)Function call failed: return value was -110301 (Error during IO)Location: Paths.cpp:176 (Root)Call stack:(0x8273da) pyrogenesis() [0x8273da](0x7de6e1) pyrogenesis() [0x7de6e1](0x7de8dd) pyrogenesis() [0x7de8dd](0x7df29b) pyrogenesis() [0x7df29b](0x5badef) pyrogenesis() [0x5badef](0x5bc6b1) pyrogenesis() [0x5bc6b1](0x5b6e42) pyrogenesis() [0x5b6e42](0x5b98e3) pyrogenesis() [0x5b98e3](0x42c49d) pyrogenesis() [0x42c49d](0x422287) pyrogenesis() [0x422287](0x7fa9f8ecfead) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7fa9f8ecfead](0x42ba35) pyrogenesis() [0x42ba35]errno = 0 (Error during IO)OS error = ?Cache: 500 (total: 7692) MiBTIMER| InitVfs: 3.97552 sSound: AlcInit success, using OpenAL SoftTIMER| CONFIG_Init: 7.79019 msWARNING: gnome-keyring:: couldn't connect to: /home/adrien/.cache/keyring-DhZ4jo/pkcs11: No such file or directoryATTENTION: default value of option force_s3tc_enable overridden by environment.[snip : the game is launching]After that, the output is the same as before, and "activepause" mod is not loaded.Modifying the file /usr/share/games/0ad/mods/public/gui/session/session.xml is OK (there are bugs, but at least there is an output!), but I would like to have it in the user's directory. Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 More important : look at this!lebarde@my-home:~/$ 0ad -mod=activepausesh: 0: getcwd() failed: No such file or directoryCache: 500 (total: 7692) MiB[...]So the game doesn't find any directory (that is probably named upon "activepause", but none is specified).If I do :# cd /usr/share/games/0ad/mods# ln -s /path/to/my/mod# lsactivepause publicthen launching the game with 0ad -mod=activepause or either pyrogenesis -mod=activepause doesn't work. Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 Ok, now I get something.pyrogenesis doesn't seem to load every XML file that is in the mod.I tried to rename activepause.xml into session.xml and l launched 0ad -mod=activepause.Then I got:lebarde@my-home:~/$ 0ad -mod=activepauseCache: 500 (total: 7692) MiBTIMER| InitVfs: 82.4826 msSound: AlcInit success, using OpenAL SoftTIMER| CONFIG_Init: 6.46221 msWARNING: gnome-keyring:: couldn't connect to: /home/lebarde/.cache/keyring-DhZ4jo/pkcs11: No such file or directoryATTENTION: default value of option force_s3tc_enable overridden by environment.TIMER| RunHardwareDetection: 21.5674 msTIMER| write_sys_info: 16.3436 ms[snip]TIMER| session/setup.xml: 68.399 usTIMER| session/styles.xml: 212.92 usERROR: File 'activepause.js' does not existTIMER| session/session.xml: 321.524 usTIMER| common/global.xml: 405.991 usERROR: GUI page 'page_session.xml': Failed to call init() functionGAME STARTED, ALL INIT COMPLETEERROR: JavaScript error: fpsCounter tick line 0ReferenceError: updateFPS is not defined __eventhandler51 (tick)@fpsCounter tick:0ERROR: JavaScript error: fpsCounter tick line 0ReferenceError: updateFPS is not defined __eventhandler51 (tick)@fpsCounter tick:0ERROR: JavaScript error: fpsCounter tick line 0ReferenceError: updateFPS is not defined __eventhandler51 (tick)@fpsCounter tick:0ERROR: JavaScript error: fpsCounter tick line 0[...] // infinite loop and error message ingame....which is much more interesting.But I don't want to surcharge session.xml, only load a new XML file. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 18, 2014 Report Share Posted June 18, 2014 The hotkeys are loaded into session.xml, so it's normal that file fails. And you need to give the path relative to your mod main directory for the script, so probably "gui/session/hotkeys/activepause.js" or something. Also, I don't think script tags are valid inside object tags. The scripts are defined directly inside session.xml, which loads all "gui/session/*.js" files, so just placing your file there should be enough. EDIT: I thought you switched to SVN, though I shouldn't have suspected that given you still use the 0ad shell script. 1 Quote Link to comment Share on other sites More sharing options...
leper Posted June 18, 2014 Report Share Posted June 18, 2014 As Sander said previously loading all files in a folder doesn't work with A16 (which you are using). activepause.js isn't found because it isn't in the mod directory but in a subdirectory and those paths are relative to the mod folder, so it should be "gui/session/activepause.js". 2 Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 18, 2014 Author Report Share Posted June 18, 2014 (edited) This is very kind of you, thanks four your answers.I tested several things, and now I anderstand more stuffs.The hotkeys are loaded into session.xml, so it's normal that file fails.And you need to give the path relative to your mod main directory for the script, so probably "gui/session/hotkeys/activepause.js" or something. Also, I don't think script tags are valid inside object tags. The scripts are defined directly inside session.xml, which loads all "gui/session/*.js" files, so just placing your file there should be enough.EDIT: I thought you switched to SVN, though I shouldn't have suspected that given you still use the 0ad shell script.But I cannot understand what is the best practice: either renaming activepause.xml or session.xml ?What I understand is when I rename the file into session.xml the file is replacing the session.xml in the public mod into this one.But how to simply load activepause.xml (given that it doesn't load automatically)? I have also tested adding a page_session.xml into the gui/ directory, containing only the reference to session/activepause.xml, but I ran into bad errors surcharge problem I think).-> For the relative paths, it's ok now.-> no problem for alpha16. I shall switch to SVN when it works to propose it to the team (if there's an utility, but like that there would be two pause hotkeys).As Sander said previously loading all files in a folder doesn't work with A16 (which you are using).activepause.js isn't found because it isn't in the mod directory but in a subdirectory and those paths are relative to the mod folder, so it should be "gui/session/activepause.js".-> Seen, thanks! So now that's OK.EDIT : Moreover I have read http://trac.wildfiregames.com/wiki/Virtual_File_System, and this behaviour is well explained. But it is not explained how to load a new file.I guess an easy way would be to copy the entire contents of gui/page_session.xml and add my line for gui/session/activepause.xml. But like this there is redundance and it would force me to check the original page_session.xml file for each version.EDIT 2 : I have surcharged page_session.xml. For now that works, but I find this warkaround like a hack. What is the best practice ?Thanks a lot ! Edited June 18, 2014 by Le Barde Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 18, 2014 Report Share Posted June 18, 2014 EDIT : Moreover I have read http://trac.wildfiregames.com/wiki/Virtual_File_System, and this behaviour is well explained. But it is not explained how to load a new file.I guess an easy way would be to copy the entire contents of gui/page_session.xml and add my line for gui/session/activepause.xml. But like this there is redundance and it would force me to check the original page_session.xml file for each version.EDIT 2 : I have surcharged page_session.xml. For now that works, but I find this warkaround like a hack. What is the best practice ?Thanks a lot !This is the way to mod something, copy a file to your mod, and modify it. It's also why we're working on splitting those big files, and loading stuff by directory instead of by complete path. 1 Quote Link to comment Share on other sites More sharing options...
leper Posted June 18, 2014 Report Share Posted June 18, 2014 This is the way to mod something, copy a file to your mod, and modify it. It's also why we're working on splitting those big files, and loading stuff by directory instead of by complete path.Which is already working for gui files on SVN. Quote Link to comment Share on other sites More sharing options...
Le Barde Posted June 19, 2014 Author Report Share Posted June 19, 2014 Nice!Anyway, it works now. I can play as I wanted!Here is the repo: https://github.com/lebarde/activepauseNow I thinks I should make all the changes to:- publicly add the alternative pause;- create a DefaultPause object/var/pattern that will be called whenever the pause action is required. The nice trick would be that we can choose the Pause method inside the user.cfg.Thanks you three for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.