[REL] Less Click More Build, Queue More Units from Shift Click

Discussion in 'Mod Discussions' started by thetrophysystem, October 9, 2013.

  1. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    For version 54757. Made from the concept by Cola_Colin, ModBatch.

    Many people have been asking for factory nonstop production. This is a hot edit to the game files to better achieve this and feel less burdened by bulk queueing units.

    This thread is currently a quick-post, more work will go in to making it more official and less a backhack, after I get home from work.

    The current installation is literally changing the game file, not adding a new file to be read from the mod folder. If anything goes wrong, verify files in the game launcher for clean, or backup and restore manually.

    Instructions:
    1)
    Go to C:\Users\BroTranquilty\Desktop\Kyle's Games\Planetary Annihilation\PA\media\ui\alpha\live_game\live_game.js and open it with notepad (or notepad+)

    2) Around line 878, or ctrl-F and search the text for "batchbuildsize"
    Code:
            self.batchBuildSize = ko.observable(5);
    3) Change the number (5) to (#), where as # is how many at a time you want Shift-Click to queue units in-game. Suggestions are 20, 50, and 100. I use 20 and that will probably be the default for the mod-folder js file that I upload.

    Really this lets you queue more units than you ever need to queue in only a handful of clicks, at intervals you choose.

    Any imput? Feel free! Any questions? I will help!

    TO-DO:
    -Set up a file to add to the 'Mods' folder instead of editing game files.
    -Possibly add multiple batch sizes using different keys
    -Make the factory have a limitless queue of the unit (infinite production)
    Last edited: October 9, 2013
  2. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Aren't you duplicating ModBatch right now?
    It doesn't do the limitless queuing though, so that would be handy.
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Yeah ModBatch is exactly this with the first TO-DO point executed.

    The idea for the limitless queue of units is also in my mind, but as far as I can tell the best possible thing probably would be to queue up 10000 units or more to the "limitless" part. To get the "loop" effect it might be possible to i.e. queue up 1 tank 1 aa, 1 tank 1 aa, 1 tank 1 aa ten thousand times based on the initial queue when the "loop" button was clicked. Ofc you would have to cancel it all and redo it when the queue is supposed to be changed.
  4. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    I should search more -.-

    Or I should say, I and the people asking for this should search more. I was one of those people wondering why there isn't an infinite build option yet.

    Which brings me to my next question. I was already home doing work on this, is there any purpose for me to pursue this, because I was working on duplicating the process to make this interface work and basically adding the process all over again to make a new button combo batch a different number of units. Or repeat order units. Would either of those be worthwhile to look into making while my elbows are this deep?
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    You could take my mod and enhance it with the simulated loop features or whatever you think is useful. I dont really plan to do anything more about it, as I am mostly fine with 100 unit queues.
  6. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    If I do, because now you got me playing with blender instead, it is weird it is from the early 2000s yet it feels different than ones I used several years ago, but if I do, I will most definitely have to credit you.

    I was thinking, as my TODO list implied, to simulate loop, and/or to make it multi-button (none = 1 unit, shift = 5 unit, unmapped key = 30 unit, shift+unmapped key = 100 unit)

    Hey, honestly you made me a very happy girl, for my time not to be wasted up until now reinventing the wheel. Yes, I am joking, I am a guy.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Well yes according to the license stuff from my signature you have to credit me somewhere. Apart from that you may even sell the mod, I don't mind ;)
  8. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Well I should get to that then!

    No, not the selling. The crediting part.

    Know what else sucks? If I had known that your work was done on this, that it was free to use with credit going to you, and that I was going to give you credit, then it would have been a LOT less work to had looked at your work FIRST. So far, I have gotten probably a sloppier typed code with the exact point of progress you have so far.

    Anyway, edited the original post.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    About the "simulate the loop" part: I think the problem here is that, if I remember correctly, you can only send a "now build X command". Who builds X is depending on the current selection. So you can't simulate the loop unless you modify the player's selection. And you don't want to do that ;)
  10. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    I just figured that out. Well, actually, first, I tried making a new button do it. I was going to combine my ideas, instead of having one button make 20 and one button make 100, I was going to make one button make 20 and one button loop. That way, you would only use one button to build 20, and one button make 1 that loops so you would make 1 when that one was done over and over. Best part about the loop, is if you needed and engi, click to build one and it will build between the next two because the loop wouldn't engage till after the next one was done.

    Unfortunately, as you said, it will only currently engage with your selection. After looking at my code and looking at your code, I am afraid as well that I am using too much code for just a single task. I know you have made posts about "referencing things individually" and going out of your way, but I am afraid I just copy the existing code the devs made ingame and that requires me to copy a lot of the pre-existing references. I only looked at yours way later and noticed yours is a slightly different command with a single line. The more I add on the even bigger my code looks, when it was several lines bigger than your one line originally.

    At times, I feel like accepting defeat on this one and asking you to change, lock, and sink this thread as a moderator. But I am not quite there yet.

    Anyway, I wish I knew code not to have to rely on copying what I see the config already doing, because you obviously know the code better to where you actually create the commands you know work instead of copying whats already inside the game's build. Alas, I am a scrubby Minecraft modder lol. If I make a minecraft bow mod, I just modify existing commands and add new ones for more functions.

    More later if I can figure out how to make that looping actually reference the factory instead of the player selection. I have a single question though if you are still reading colin, If I were to change the player selection for a single frame and back, would you think it would ever cause an issue with somebody clicking the same instant second it tries to operate? I mean, it would only be 1/20th a second.
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I don't think doing that is a good idea. Only experiments can show if it causes issues though. But I think the "emulated" loop that uses the current queue's up the current queue a thousand times might work out okay.

Share This Page