Quitch / GW-AI-Overhaul

Mod for Planetary Annihilation: TITANS focused on overhauling Galactic War.
https://steamcommunity.com/app/386070/discussions/0/133259956005401439/
Creative Commons Attribution 4.0 International
1 stars 7 forks source link

[BUG] G:\GW-AI-Overhaul\ui\mods\com.pa.quitch.gwaioverhaul\gw_play\referee_game_files.js tag bug #64

Closed lilly1987 closed 1 year ago

lilly1987 commented 1 year ago

Attestation

[ ] I have verified this bug with all other mods disabled

[ ] I am not using one of the documented incompatible mods

[ ] I have confirmed this happens after verifying the games files

[ ] I was using the latest graphics drivers

Describe the bug

A clear and concise description of what the bug is.

befor err log

[03:17:06.547] INFO [JS/game] coui://ui/mods/com.pa.quitch.gwaioverhaul/gw_play/referee_game_files.js:244: lilly.tag : /pa/tools/commander_build_arm/commander_build_arm_lilly.json
[03:17:06.547] INFO [JS/game] coui://ui/mods/com.pa.quitch.gwaioverhaul/gw_play/referee_game_files.js:245: lilly.tag : .player
[03:17:11.188] ERROR Error opening struct ToolSpec spec "/pa/tools/commander_build_arm/commander_build_arm_lilly.json.player", file failed to load
[03:17:11.188] ERROR Unable to load tool spec: /pa/tools/commander_build_arm/commander_build_arm_lilly.json.player
[03:17:11.203] ERROR Unable to load tool spec: /pa/tools/commander_build_arm/commander_build_arm_lilly.json.player

fix after

  tag: function (attribute) {
    // hack fix for mirrorMode due to the fact that
    // `attribute` was retaining the previous `specTag`s
    // and I couldn't track down why
    console.log('lilly.tag : '+ attribute);
    console.log('lilly.tag : '+ specTag);
    var cleanAttribute=attribute;
    //try {
    //  cleanAttribute = attribute.slice(
    //    0,
    //    attribute.lastIndexOf(".json") + 5
    //  );
    //} catch (e) {
    //  // empty
    //}
    console.log('lilly.tag : '+ cleanAttribute + specTag);
    return cleanAttribute + specTag;
  },

test code

                var commander = inventory.getTag('global', 'commander');
                var units =
                [
                    commander,
                ];
                var modUnit = function(unit) {
                    //var newBuildArm = newBuildArm = unit + '.player' + '.build_arm.' + (inventory.mods().length + mods.length).toString();
                    var newBuildArm = newBuildArm = unit + '.player' + '.build_arm.' + (inventory.mods().length + mods.length).toString();
                    console.log('modUnit : '+ newBuildArm);
                    mods.push(
                    {
                        file: unit,
                        path: 'tools.0.spec_id',
                        op: 'clone',
                        value: newBuildArm
                    });
                    mods.push(
                    {
                        file: newBuildArm,
                        path: 'construction_demand.energy',
                        op: 'multiply',
                        value: 1000
                    });
                    mods.push(
                    {
                        file: newBuildArm,
                        path: 'construction_demand.metal',
                        op: 'multiply',
                        value: 1000
                    });
                    mods.push(
                    {
                        file: unit,
                        path: 'tools.0.spec_id',
                        op: 'replace',
                        value: newBuildArm
                    });
                    mods.push(
                    {
                        file: unit,
                        path: 'tools.0.spec_id',
                        op: 'tag',
                        //value: newBuildArm
                    });
                };
                _.forEach(units, modUnit);

ok log

[03:29:15.046] INFO [JS/game] coui://ui/mods/com.pa.quitch.gwaioverhaul/gw_play/referee_game_files.js:245: lilly.tag : .player
[03:29:15.046] INFO [JS/game] coui://ui/mods/com.pa.quitch.gwaioverhaul/gw_play/referee_game_files.js:255: lilly.tag : /pa/units/commanders/quad_potbelly79/quad_potbelly79.json.player.build_arm.12.player

To Reproduce

Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

GWO Info

Taken from the top-right GWO panel:

Additional context

Add any other context about the problem here.

Logs

Please attach the most recent client AND server logs immediately following the bug occurring.

Quitch commented 1 year ago

There's no such file in the game, so you're going to need to provide more context than none at all, along with the attestations and other required information.