[REL] Anti-Popcorn Units

Discussion in 'Released Mods' started by nixtempestas, August 26, 2014.

  1. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    I use eclipse, it's way better in my opinion. I'll go get Netbeans and see what I can do with it.
  2. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Thanks. Eclipse wouldn't detect java on my machine, even when directed straight to the folder...
  3. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    And it gets even weirder
    upload_2014-8-27_15-45-53.png
    upload_2014-8-27_15-46-24.png

    works perfectly here.

    running netbeans 8.0 (EDIT: specifically https://netbeans.org/downloads/start.html?platform=windows&lang=en&option=javase)
    Created new project, selected java project with existing sources, click next
    clicked next again
    under source package folder, clicked add folder and selected the source folding containing the 3 files, clicked next
    The 3 files were listed in the includes window as expected. Clicked finish.
    Run -> Run Project

    and it worked.

    Are you sure you got java properly installed? I've never heard of eclipse failing to find it if it's there, it's rather good at it.
    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  4. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    It was looking in program files. It was in x64. I specified that, it still declined it was the folder. Gave up, moved on.

    Your instructions are different from mine, I started a new project java application, but I will try an existing package this time, thank you much.

    This time it worked, although your actionlist specifies damage override for a file path listing your exact mod name (so the ubercannon damage override doesn't work for my mod if I run it, I don't have same directory)

    C:\Users\Lyle\AppData\Local\Uber Entertainment\Planetary Annihilation\server_mods\com.nixtempestas.antipopcorn\pa\ammo\cannon_uber\
    java.io.FileNotFoundException: C:\Program Files (x86)\Uber Entertainment\Planetary Annihilation Launcher\Planetary Annihilation\stable\media\pa\ammo\cannon_uber\cannon_uber.json (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at java.io.FileReader.<init>(FileReader.java:58)
    at ValueChanger.<init>(ValueChanger.java:27)
    at JSONShadow.main(JSONShadow.java:32)
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1954)
    at ValueChanger.getValue(ValueChanger.java:114)
    at JSONShadow.main(JSONShadow.java:36)
    Last edited: August 27, 2014
  5. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Oh crud. I'd have to do more than expected to change 2-3 values at once (health, cost, speed). Unless it's damage which is lil easier. I can still do so, but I will at least do that by hand.

    Oh wait, I could make the destination and source the same, can't I?
  6. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    ah right, you'd have to modify those ones too to point to the exact files.
    The "path override" styled arrays are a duct tape solution for that annoying time when you want to modify something in a folder like ammo or tools. If you don't want to touch anything but units, just comment out the arrays inside the path_overrides array like so and it will be ignored.

    Code:
    public static String[][][] path_overrides = {
            //path_override_damage,
            //path_override_splash_damage
        };
    If I'd made the moddir = "com.nixtempestas.antipopcorn\\pa\\
    and then in the all the specifier arrays listed the directory as "units\\air\\air_scout\\" etc. it would have been unnecessary to use them at all. Since the uber cannon was the only thing not in units though, I went with duct tape solution.
  7. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    You'd need 3 arrays for that, more if you don't want them to all be the same multiplier for each array.

    This is a "blanket sweep" application designed for rapid iteration on a mod.

    I should mention, make sure you delete any files produced by the application between runs, or it will use the existing modded files as the source instead of vanilla. (unless of course that is what you want it to do)
  8. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Disabled until updated for Titans.
  9. nixtempestas

    nixtempestas Post Master General

    Messages:
    1,216
    Likes Received:
    746
    Really need to do that at some point...

Share This Page