[REL] Cover that line

Discussion in 'Released Mods' started by cola_colin, July 23, 2015.

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    First I will finish the talos principle. Then I will fix a bug. Then I will release it. There may be sleep between any of these tasks, depends on their length.
    cdrkf and stuart98 like this.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    all the above has been completed. Find the mod on pamm on the code on github.

    If you find bugs or issues feel free to report them.
    Last edited: August 1, 2015
    doud, cdrkf and stuart98 like this.
  3. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    Absolutely brilliant mod already. Something that I always wanted.

    I use it especially with grenadiers and its really effective. Such good work cola_colin. Thanks!
    doud and cdrkf like this.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    continues to work in titans
    sgrock likes this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Always?

    Also they did change something about direct "move" commands in Titans, maybe that is confusing you (borked the mod somehow)
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Can't reproduce at all.
  7. Clopse

    Clopse Post Master General

    Messages:
    2,527
    Likes Received:
    2,861
    No problems for me either. Works perfect. I know its probably impossible / really hard to mod but I'd like to draw an arch shape and the units squeeze tightly into an arch shape. Now if you draw a slightly big arc for ten units they spread themselves too thin.

    Also formations out of factories would be nice.
  8. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Do you have any other UI mods? Disable all of them and only test with this one mod.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    @wondible what does missile command do with the input code?
  10. wondible

    wondible Post Master General

    Messages:
    3,279
    Likes Received:
    2,084
    It looks for attack commands to clear loaded and select next attacker in attack sequence mode.

    Code:
      // action left click
      var originalUnitCommand = api.Holodeck.prototype.unitCommand
      api.Holodeck.prototype.unitCommand = function(command, x, y, queue) {
        var selected = model.selection() && model.selection().spec_ids[specs.nuke_launcher]
        return originalUnitCommand.apply(this, arguments).success(
          function() {checkCommand(command, selected)})
      }
    
      // drag command
      var originalUnitEndCommand = api.Holodeck.prototype.unitEndCommand
      api.Holodeck.prototype.unitEndCommand = function(command, x, y, queue) {
        var selected = model.selection() && model.selection().spec_ids[specs.nuke_launcher]
        return originalUnitEndCommand.apply(this, arguments).success(
          function() {checkCommand(command, selected)})
      }
    
      // right click
      var originalTargetCommand = api.unit.targetCommand
      api.unit.targetCommand = function(command, target, queue) {
        var selected = model.selection() && model.selection().spec_ids[specs.nuke_launcher]
        return originalTargetCommand.apply(this, arguments).success(
          function() {checkCommand(command, selected)})
      }
    
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Hmm, I tend to just ignore prototype stuff in js, so only have a rough idea what it does, but I suspect your way of hooking unitEndCommand breaks my way:

    Code:
        var baseEngine = engine.call;
        var hookEngineCall = function(callName, handler) {
            var oldEngineCall = engine.call;
            engine.call = function() {
                if (arguments && arguments[0] === callName) {
                    return handler.apply(this, arguments);
                } else {
                    return oldEngineCall.apply(this, arguments);
                }
            };
        };
    
    ...
    
        hookEngineCall("holodeck.unitEndCommand", function(engineCall, hdeckId, cmd, x, y, queue) {
            if (cmd === "coverline") {
                if (model.hasSelection()) {
                    previewActive = false;
                    coverLine(locations, queue, hdeckId);
                    setTimeout(cleanPreview, 500);
                }
                return {
                    then: function(h) {
                        h(false);
                        model.mode("default");
                    }
                }
            } else {
                return baseEngine('holodeck.unitEndCommand', hdeckId, cmd, x, y, queue);
            }
        });
    
    
    It's weird. Why does your hook cause mine not work anymore?
  12. wondible

    wondible Post Master General

    Messages:
    3,279
    Likes Received:
    2,084
    One issue is you return a fake promise which doesn't support the success method. But when I run them together, CTL works and an error goes the console, so MC would be the broken one.
  13. jackburton176

    jackburton176 Member

    Messages:
    63
    Likes Received:
    15
    probably one of the most underused but essential mods out there right now.
  14. tatsujb

    tatsujb Post Master General

    Messages:
    12,878
    Likes Received:
    5,374
    Holy ****! I'm gonna use this to attack my enemies with penises!
    Killerkiwijuice likes this.
  15. jackburton176

    jackburton176 Member

    Messages:
    63
    Likes Received:
    15
    This is the best mod in the game right now
    cola_colin likes this.
  16. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Indeed...
    Give 'em ALL your girth! (of units, I mean...)
    tunsel11 likes this.
  17. NikolaMX

    NikolaMX Active Member

    Messages:
    126
    Likes Received:
    139
    Mod's API has been causing client crashes and freezes lately. Not even the use, just the presence of the mod
  18. Quitch

    Quitch Post Master General

    Messages:
    5,290
    Likes Received:
    5,991
    How did you determine that?
  19. NikolaMX

    NikolaMX Active Member

    Messages:
    126
    Likes Received:
    139
    After you mentioned it to me i isolated the mod, and tried to change the procedure. Game insta-freezes upon entering the system with even minor changes in the API, which is a more severe form of what im experiencing day to day
  20. Quitch

    Quitch Post Master General

    Messages:
    5,290
    Likes Received:
    5,991
    But what I mean is how do you know it's the API and not the mod's implementation that's the cause of the issue? I know I mentioned that due to thinking Cover the Line and Ubermap using the same API, and both having issues, it could be the API, but that's not evidence that it *is* the API.

    Can you provide reproducible steps for the crash?

Share This Page