#6727 closed defect (fixed)

Rally point relics

Reported by: Langbart Owned by: Freagarach
Priority: Should Have Milestone: Alpha 27
Component: UI & Simulation Keywords:
Cc: Patch: Phab:D4933

Description

to reproduce

  • start a map with some relics
    # command line
    pyrogenesis -autostart-size=128 -autostart="random/mainland" -autostart-victory=capture_the_relic -autostart-reliccount=14
    
  • train a horse in your CivicCenter
  • set the rally point from the CivicCenter to a relic
  • notice the horse will not move to the relic after it has been trained

bisect

Attachments (2)

works.gif (1009.3 KB ) - added by Langbart 15 months ago.
broken.gif (753.2 KB ) - added by Langbart 15 months ago.

Download all attachments as: .zip

Change History (6)

by Langbart, 15 months ago

Attachment: works.gif added

by Langbart, 15 months ago

Attachment: broken.gif added

comment:1 by Freagarach, 15 months ago

Hmm, this one is annoying. Previously it was allowed to capture, so it did. Now the default is to not capture. Since the catafalque has no cmpHealth, the entity cannot attack and will therefore not walk towards it.

I'll have to think about a fix (maybe some check in unit_actions.js:set-rally-point).

comment:2 by Langbart, 15 months ago

possible solution ?

  • binaries/data/mods/public/simulation/components/UnitAI.js

    a b UnitAI.prototype.Attack = function(target, allowCapture = this.DEFAULT_CAPTURE,  
    55025502            this.WalkToTarget(target, queued, pushFront);
    55035503        return;
    55045504    }
     5505    let cmpHealth = Engine.QueryInterface(target, IID_Health);
     5506    if(!cmpHealth)
     5507        allowCapture = true
    55055508    let order = {
    55065509        "target": target,
    55075510        "force": true,

Alternative via unit_actions.js:set-rally-point

  • Phabricator diff/21540/
    • binaries/data/mods/public/gui/session/unit_actions.js

      a b var g_UnitActions =  
      11991199                data.target = targetState.id;
      12001200                cursor = "action-repair";
      12011201            }
       1202            else if (targetState && !targetState.identity.canDelete)
       1203            {
       1204                data.target = targetState.id;
       1205                data.command = "capture";
       1206                cursor = "action-capture";
       1207            }
      12021208            else if (targetState && playerCheck(entState, targetState, ["Enemy"]))
      12031209            {
      12041210                data.target = targetState.id;
    • binaries/data/mods/public/simulation/helpers/Commands.js

      a b var g_Commands = {  
      203203        });
      204204    },
      205205
       206    "capture": function(player, cmd, data)
       207    {
       208        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
       209            cmpUnitAI.Attack(cmd.target, true, cmd.queued, cmd.pushFront);
       210        });
       211    },
       212
      206213    "patrol": function(player, cmd, data)
      207214    {
      208215        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI =>
    • binaries/data/mods/public/simulation/helpers/RallyPointCommands.js

      a b function GetRallyPointCommands(cmpRallyPoint, spawnedEnts)  
      102102                "queued": true,
      103103            });
      104104            break;
       105        case "capture":
       106            ret.push({
       107                "type": "capture",
       108                "entities": spawnedEnts,
       109                "target": data[i].target,
       110                "queued": true,
       111            });
       112            break;
      105113        case "trade":
      106114            ret.push({
      107115                "type": "setup-trade-route",
Last edited 15 months ago by Langbart (previous) (diff)

comment:3 by Freagarach, 15 months ago

Owner: set to Freagarach
Patch: Phab:D4933

comment:4 by Freagarach, 15 months ago

Resolution: fixed
Status: newclosed

In 27533:

Fix rally point cursor and capturing from spawn.

Introduced in r27399 / rP27399 (the default attack mode switch).

Differential revision: https://code.wildfiregames.com/D4933
Tested by: @Langbart, @phosit, @wowgetoffyourcellphone
Fixes: #6727
(Refs. #6733)

Note: See TracTickets for help on using tickets.