Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -335,7 +335,8 @@ unloadturrets = "U" ; Unload turreted units. leaveturret = "U" ; Leave turret point. move = "" ; Modifier to move to a point instead of another action (e.g. gather) -attack = Ctrl ; Modifier to attack instead of another action (e.g. capture) +capture = Ctrl ; Modifier to capture instead of another action (e.g. attack) +attack = "" ; Modifier to attack instead of another action (e.g. capture) attackmove = Ctrl ; Modifier to attackmove when clicking on a point attackmoveUnit = "Ctrl+Q" ; Modifier to attackmove targeting only units when clicking on a point garrison = Ctrl ; Modifier to garrison when clicking on building Index: binaries/data/mods/public/gui/hotkeys/spec/ingame.json =================================================================== --- binaries/data/mods/public/gui/hotkeys/spec/ingame.json +++ binaries/data/mods/public/gui/hotkeys/spec/ingame.json @@ -43,6 +43,10 @@ "name": "Force move", "desc": "Modifier to move to a point instead of another action (e.g. gather)." }, + "session.capture": { + "name": "Force capture", + "desc": "Modifier to capture instead of another action (e.g. attack)." + }, "session.attack": { "name": "Force attack", "desc": "Modifier to attack instead of another action (e.g. capture)." Index: binaries/data/mods/public/gui/session/unit_actions.js =================================================================== --- binaries/data/mods/public/gui/session/unit_actions.js +++ binaries/data/mods/public/gui/session/unit_actions.js @@ -181,6 +181,11 @@ }) }; }, + "hotkeyActionCheck": function(target, selection) + { + return Engine.HotkeyIsPressed("session.capture") && + this.actionCheck(target, selection); + }, "actionCheck": function(target, selection) { let actionInfo = getActionInfo("capture", target, selection); @@ -191,7 +196,7 @@ "firstAbleEntity": actionInfo.entity }; }, - "specificness": 9, + "specificness": 10, }, "attack": @@ -243,7 +248,7 @@ "firstAbleEntity": actionInfo.entity }; }, - "specificness": 10, + "specificness": 9, }, "call-to-arms": { Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js +++ binaries/data/mods/public/simulation/components/UnitAI.js @@ -1568,7 +1568,7 @@ } if (this.CheckTargetVisible(msg.data.attacker)) - this.PushOrderFront("Attack", { "target": msg.data.attacker, "force": false, "allowCapture": true }); + this.PushOrderFront("Attack", { "target": msg.data.attacker, "force": false, "allowCapture": false }); else { var cmpPosition = Engine.QueryInterface(msg.data.attacker, IID_Position); @@ -2114,7 +2114,7 @@ "force": false, // Force to true - otherwise structures might be attacked instead of captured, // which is generally not expected (attacking units usually has allowCapture false). - "allowCapture": true + "allowCapture": false }); return; } @@ -5011,7 +5011,7 @@ if (!target) return false; - this.PushOrderFront("Attack", { "target": target, "force": false, "allowCapture": true }); + this.PushOrderFront("Attack", { "target": target, "force": false, "allowCapture": false }); return true; }; @@ -5030,7 +5030,7 @@ if (!target) return false; - this.PushOrderFront("Attack", { "target": target, "force": false, "allowCapture": true }); + this.PushOrderFront("Attack", { "target": target, "force": false, "allowCapture": false }); return true; }; @@ -5461,12 +5461,12 @@ * to a player order, and so is forced. * If targetClasses is given, only entities matching the targetClasses can be attacked. */ -UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = true, queued = false, pushFront = false) +UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = false, queued = false, pushFront = false) { this.AddOrder("WalkAndFight", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued, pushFront); }; -UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = true, queued = false, pushFront = false) +UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = false, queued = false, pushFront = false) { if (!this.CanPatrol()) { @@ -5504,7 +5504,7 @@ /** * Adds attack order to the queue, forced by the player. */ -UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false, pushFront = false) +UnitAI.prototype.Attack = function(target, allowCapture = false, queued = false, pushFront = false) { if (!this.CanAttack(target)) {