Beta Mod Changes

Discussion in 'Mod Discussions' started by o, September 25, 2013.

  1. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    Oh, I forgot to mention... I know that the mount stacking thing isn't a sufficient solution for TCs, which have additional needs like removing the mapping for existing files (so things like 'find all units' checks don't pick up original PA units if you don't want them). So there will be more coming down the pipe for topics like that. I've got a lot of mod support work to do coming up, so don't worry, we're not done yet. Hang in there! :)
    Raevn likes this.
  2. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    I cant seem to get this working is it actually in the new build?

    there was no mods folder in the %LOCALAPPDATA%\Uber Entertainment\Planetary Annihilation\

    and i tried making a mod which shadows ui_mod_list.js and its not working.

    I also am not finding any refrences to it within the javascript files, unless its being implemented wihin the engine itself.


    EDIT:

    Im not sure what i changed but it seems to be working now odd.
    Last edited: December 11, 2013
  3. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    There may not be a mods folder under there by default; if not go ahead and add one. Then under there, make a folder for your mod specifically. You'll also have to make sure you have a valid modinfo.json file for your mod (as described in the big post), otherwise it won't load (those files are not optional, unlike the mods.json thing with the mount order, which is).

    Does that help? If not, write up what your directory structure there looks like, and then the contents of your modinfo.json file; we'll see if we can track it down.

    And yes the mounting is an engine internal thing; the javascript shouldn't have to worry about it. Our web UI implementation actually routes all file loading requests through this mounting stack, so it should be transparent. For example, I locally tested with a mod that replaced the UI's lobby.html file, like so:

    (local app data)\Uber Entertainment\Planetary Annihilation\mods\
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\modinfo.json
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\ui\
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\ui\alpha\
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\ui\alpha\lobby\
    (local app data)\Uber Entertainment\Planetary Annihilation\mods\test_lobby\ui\alpha\lobby\lobby.html

    My modinfo.json then looked something like this:
    Code:
    {
        "context" : "client",
        "identifier" : "com.uitestmods.paui.testlobby",
        "display_name" : "My super sweet lobby replacement",
        "description" : "LOBBYYYYYYYY",
        "author" : "Zeus Hammer",
        "version" : "1.0",
        "signature" : "(not yet implemented)"
    }
    
    I know this is a contrived example, but javascript shadowing should work similarly. Hopefully you'll be able to get it working; let me know if you're still stumped and we'll figure it out. :)
  4. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    Doh, didn't see that part when I replied. Oh well, maybe that info will help somebody else in the future. Glad it's now working for you! :)
  5. iceDrop

    iceDrop Active Member

    Messages:
    143
    Likes Received:
    99
    Confirmed this location works on my Mac. No more symlinks and replacing files with each patch install for me. Thanks!
  6. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    The only downside to having this implemented within the engine. Is that it prevents some stuff from being done that i wanted to do.

    So is there any way we can get the values of each modinfo.json and mods.json.

    I wanted to try and create a mod which merges current ui mods and this mod system. But to do so i would need to have access to the data within modinfo.json and mods.json.
  7. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    http://api.jquery.com/jQuery.getJSON/ ???
  8. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    I definitely intend to add APIs to get the mod info for loaded mods from inside the JS; that'll happen sooner rather than later. In the meantime you may be able to get around it with some external JSON APIs yeah.
  9. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    The issue is that as far as i know the files arnt in the virtual file system used for the game.
  10. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    That's true, those files are not present in the file system space themselves. That does make it more problematic for you, I agree.

    I'll see about adding engine.call hooks for this info today; should be low-impact enough to be something we can get in for the build next week. I'll keep you posted.
  11. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Yeah I noticed :(
    I want to read the unit json files in settings but that it won't work.
    Devs ? Anybody an idea ?
  12. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    look at the post above :D
  13. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Sweeet ! that would make me very happy I want to read the *.json files from media/pa folder :)
  14. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    Hold on, that's not the feature I'm talking about; I'm only talking about mod info metadata (since those files are not accessible in the virtual file system otherwise). Can you not access the unit files though? Because I would think that should work already, hmm....

    I'll tinker with this a bit today and see if I can come up with something.
  15. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    No can't access them only things under ui folder are accessible.
  16. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    Really? Grr. I'll look into it.
  17. chargrove

    chargrove Uber Alumni

    Messages:
    107
    Likes Received:
    350
    Bah, yeah it assumes the ui folder is the host root and doesn't allow relative pathing outside of that, even if our file system space allows one more level up. That's a Coherent UI thing apparently, doh.

    I'm experimenting with adding in a symbolic link folder like "/$media/" that our internal file handler recognizes as the media root, i.e. if in JS you try to load "/$media/pa/test.js", instead of interpreting it as "/ui/$media/pa/test.js", it'll instead use "/pa/test.js", bypassing the /ui/ host folder restriction. A little weird perhaps, but appears to work from initial testing; ostensibly this would work for other media folder assets as well.

    Nothing official yet, but just know that something is in the works. :)
    proeleert and Raevn like this.
  18. dfanz0r

    dfanz0r Active Member

    Messages:
    150
    Likes Received:
    47
    I have gone looking into the Coherent UI documentation. By default unless you create a custom file handler, it sets the root of coui:// to the current working directory. If you already have a custom file handler then it should be a simple change on the engine side of things, but all direct urls would need to me changed in the files. If a custom file handler isnt implemented then that means something on the engine side of things is changing the working directory to the ui folder right before coherent is initialized.

    Im guessing a custom file hander is used, since its mentioned in the quoted post. So really how hard would it be to just modify the handler to interpret the files as being not in the ui folder, but within the media folder instead. But again direct links to files would need to be modified but that could be done easily in np++ with a file find and replace.

    Here are links directly to the coherent docs for refrence.
    custom file handler:
    http://coherent-labs.com/Documentat...andler.html#aa390bfb235232b3e5825900e23b4cb65
    Initialization of coherent:
    http://coherent-labs.com/Documentation/cpp/d0/dfd/_quick_start_guide_windows.html#Integration

    I dont know if this post is of any help but yeah i tried. Plus i would rather not have to bother with anything possibly confusing like what was suggested. Its just a bit over engineered just to possibly keep some kind of backwards compatibility in something that isnt even complete yet.
    Last edited: December 14, 2013
  19. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Can't seem to get it to work:

    Code:
    ../shared/css/boot.css loading css common.js:30
    ../shared/js/boot.js loading script common.js:9
    XHR finished loading: "coui://ui/alpha/shared/js/boot.js". coui://ui/alpha/shared/js/common.js
    http 200 common.js:22
    fn not bound
    ../../mods/ui_mod_list.js loading script common.js:9
    Failed to load resource coui://ui/alpha/shared/js/common.js
    loadScript common.js:14
    (anonymous function) common.js:80
    http 0 common.js:18
    error loading ../../mods/ui_mod_list.js common.js:19
    XHR finished loading: "http://uberent.com/GameClient/GetNews?titleid=4&count=1".
    Edit: console log of the error message:
    Code:
    DOMException {message: "A network error occurred.", name: "NetworkError", code: 19, stack: "Error: A network error occurred.↵  at loadScript…)↵  at coui://ui/alpha/shared/js/common.js:81:1", INDEX_SIZE_ERR: 1…}
    code: 19
    message: "A network error occurred."
    name: "NetworkError"
    stack: "Error: A network error occurred.↵  at loadScript (coui://ui/alpha/shared/js/common.js:14:11)↵  at coui://ui/alpha/shared/js/common.js:81:1"
    __proto__: DOMException
    Files:
    • (local app data)\Uber Entertainment\Planetary Annihilation\mods\pamm\modinfo.json
    • (local app data)\Uber Entertainment\Planetary Annihilation\mods\pamm\ui\mods\ui_mod_list.js
    modinfo.json:
    Code:
    {
        "context" : "client",
        "identifier" : "com.pa.raevn.pamm.uimodslist",
        "display_name" : "PA Mod Manager UI Mods List",
        "description" : "",
        "author" : "Raevn",
        "version" : "1.0",
        "signature" : "(not yet implemented)"
    }
    Last edited: December 14, 2013
  20. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    It's working now, but I didn't change anything, just like dfanz0r :confused:

Share This Page