[REL] Cover that line

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

  1. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    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,125
    Likes Received:
    16,255
    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: July 31, 2015
    doud, cdrkf and stuart98 like this.
  3. Alpha2546

    Alpha2546 Post Master General

    Messages:
    983
    Likes Received:
    1,571
    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,125
    Likes Received:
    16,255
    continues to work in titans
    sgrock likes this.
  5. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    There s a bug.

    When i use the mod and issue a proper curve line order, i cant deselect my units using left mouse button. I have to counterintuitively click RMB and only then LMB. Im used to deselecting with LMB and orddering a move with RMB.
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Always?

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

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    Yeah always i think.

    if i dont use the mod im fine. i usually click on a unit, then right click to order it move and then LMB to deselect it.

    Without the mod it works and if i turn on the mod, it doesnt. I have to click RMB->LMB to deselect it.
  8. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Can't reproduce at all.
  9. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    MM i have no idea i guess ill have to test diffirent settings in game.
  10. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    Just cant help it it is bugged for me. If you cant replicate this we ll probably need to wait for someone to have the same problem.
  11. Clopse

    Clopse Post Master General

    Messages:
    2,516
    Likes Received:
    2,858
    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.
  12. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    Do you have any other UI mods? Disable all of them and only test with this one mod.
  13. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    yeah ok its one of those ~20 mods. :D going to check which out exactly
  14. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    Well it was Missile Command mod. I had to delete it.
    Clopse likes this.
  15. cola_colin

    cola_colin Moderator Alumni

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

    wondible Post Master General

    Messages:
    3,278
    Likes Received:
    2,078
    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)})
      }
    
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,125
    Likes Received:
    16,255
    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?
  18. wondible

    wondible Post Master General

    Messages:
    3,278
    Likes Received:
    2,078
    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.
  19. netpyxa

    netpyxa Active Member

    Messages:
    118
    Likes Received:
    37
    Can we be getting a fix for Missile Command some time in the future? Also, the UI panel should appear top right, not top left to be more convenient with UberMap. Yeah i know you can drag the panel.
  20. jackburton176

    jackburton176 Member

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

Share This Page