Jump to content

Le Barde

Community Members
  • Posts

    15
  • Joined

  • Last visited

Le Barde's Achievements

Discens

Discens (2/14)

1

Reputation

  1. Hi everybody, Thanks for so good a game! When I play death matches, the I.A. takes time to gather things instead of fastly creating war builds. Thanks to a plugin I wrote I always win, even against the "very hard" IA. Don't you think this is a bug? Thanks by advance.
  2. Hello, I have written a little plugin. When you type "P" it turns kind of a playable pause mode. Actually, it toggles game speed 0.00001 / 1. Like this I can play as in AOE2, playing during the pause and optimizing everything. --> https://github.com/lebarde/activepause What do you think of this?
  3. Hello, I had the same need, so I launched the following thread: http://www.wildfiregames.com/forum/index.php?showtopic=18824#entry293840. I have created a little mod for that if you are interested. Cheers, Lebarde.
  4. Nice! Anyway, it works now. I can play as I wanted! Here is the repo: https://github.com/lebarde/activepause Now 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.
  5. This is very kind of you, thanks four your answers. I tested several things, and now I anderstand more stuffs. 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). -> 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 !
  6. 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.
  7. 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.
  8. 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.
  9. 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 ?
  10. Hi, So I have made a new directory inside ~/.local/share/0ad/mods Here 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.
  11. 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.
  12. Ok I have seen this and (important) this, but still there is nothing ingame...
  13. 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.
  14. 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 !
  15. EDIT: see http://www.wildfiregames.com/forum/index.php?showtopic=18824#entry293840 Hello, I was seeking a way to make the pause active, i.e. to give orders while having peused the game. I have seen that topic : http://www.wildfiregames.com/forum/index.php?showtopic=17646&hl=pause This is what I am looking for. Unfortunately, I have to open the console and type something (or use arrow up). Now I would like to map Engine.SetSimRate(0) / Engine.SetSimRate(1) to the pause button, or to another one. What I want is : typing the button would call Engine.SetSimRate(0), and typing the same button another time would call Engine.SetSimRate(1). Do you think this is possible ? The best I would have would be to grey up the screen, just like the Pause action does, but I want to be able to focus on units and launch actions. The very best of all would be to add this functionality to the core 0ad ! That would be fair for a solo session to fight against a strong bot. Thanks !
×
×
  • Create New...