Galactic War Modding Crash

Discussion in 'Support!' started by stuart98, July 16, 2015.

  1. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Adding new units to the galactic war causes a crash when they fire.

    I'll have a galactic war version of Galactic Annihilation posted here shortly to provide a repro case.

    @jables @mkrater
  2. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
  3. mkrater

    mkrater Uber Alumni

    Messages:
    1,349
    Likes Received:
    1,830
    Does this occur in the 84088-PTE build as well?
  4. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    I haven't been able to test, but I suspect so.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I'm unable to start a modded GW game. The commander is blank and the start button is disabled, so I suspect the commander changes.

    From the log:

    Code:
    [15:37:47.172] ERROR [JS/game] coui://ui/main/game/galactic_war/cards/gwc_start_subcdr.js:55: Uncaught SyntaxError: Unexpected token ,
    [15:37:47.172] ERROR [JS/game] coui://ui/main/game/galactic_war/gw_start/gw_dealer.js:143: Uncaught TypeError: Cannot set property 'id' of undefined
    
  6. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Lol figured those probably existed. Give me a second.
  7. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Replace the subcdr file with this:

    Code:
    // !LOCNS:galactic_war
    define([
        'module',
        'shared/gw_common',
        'shared/gw_factions',
        'cards/gwc_start',
    ], function (
        module,
        GW,
        GWFactions,
        GWCStart
    ) {
        var CARD = { id: /[^\/]+$/.exec(module.id).pop() };
    
        return {
            visible: function (params) { return false; },
            summarize: function (params) {
                return '!LOC(galactic_war:general_commander.message):General Commander';
            },
            icon: function (params) {
                return 'coui://ui/main/game/galactic_war/shared/img/red-commander.png';
            },
            describe: function (params) { return '!LOC(galactic_war:the_general_commander_loadout_contains_very_limited_mobile_forces_and_only_two_data_banks_however_the_loadout_comes_with_two_sub_commanders_that_accompany_you_into_each_battle.message):The General Commander loadout contains very limited mobile forces and only two data banks. However, the loadout comes with two Sub Commanders that accompany you into each battle.'; },
            hint: function () {
                return {
                    icon: 'coui://ui/main/game/galactic_war/gw_play/img/tech/gwc_commander_locked.png',
                    description: '!LOC(galactic_war:seek_out_first_seeker_osiris_on_xianyao_there_you_will_find_the_loadout_your_friends_desire.message):Seek out First Seeker Osiris on Xianyao. There you will find the loadout your friends desire.'
                };
            },
            getContext: function (galaxy, inventory) {
                return {
                    faction: inventory.getTag('global', 'playerFaction') || 0
                };
            },
            deal: function (system, context, inventory) {
                var minions = _.shuffle(GWFactions[context.faction].minions.slice(0));
                return {
                    params: {
                        minions: minions.slice(0, 2),
                        allowOverflow: true
                    },
                    chance: 0
                };
            },
            buff: function (inventory, context) {
                if (inventory.lookupCard(CARD) === 0) {
                    // Make sure we only do the start buff/dull once
                    var buffCount = inventory.getTag('', 'buffCount', 0);
                    if (!buffCount) {
                        GWCStart.buff(inventory);
                        inventory.maxCards(inventory.maxCards() - 1);
                        inventory.addUnits([
                            '/pa/units/land/vehicle_factory/vehicle_factory.json',
                            '/pa/units/land/tank_light_laser/tank_light_laser.json',
                            '/pa/units/land/tank_attack/tank_attack.json'
                        ]);
                        _.forEach(context.minions, function(minion) {
                            inventory.minions.push(minion);
                        });
                        var minionSpecs = _.pluck(_.filter(_.pluck(context.minions, 'commander')), 'UnitSpec');
                        inventory.addUnits(minionSpecs);
                    }
                    ++buffCount;
                    inventory.setTag('', 'buffCount', buffCount);
                }
                else {
                    // Don't clog up a slot.
                    inventory.maxCards(inventory.maxCards() + 1);
                    GW.bank.addStartCard(CARD);
                }
            },
            dull: function (inventory) {
                if (inventory.lookupCard(CARD) === 0) {
                    var buffCount = inventory.getTag('', 'buffCount', 0);
                    if (buffCount) {
                        // Perform dulls here
                       
                        inventory.setTag('', 'buffCount', undefined);
                    }
                }
            }
        };
    });
    
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    That actually let the game start, but crashes the moment the commander pod lands.
    The commander image on the start war page was still blank, but I was still able to start; the prime suspect error messages point to commander issues.

    Client
    Code:
    [16:23:11.781] INFO [COUI] Argument conversion failed: Wrong type - expected Integer, got Null while converting argument 0 for handler holodeck.setCommanderId
    
    Server
    Code:
    [16:23:16.250] ERROR Error opening struct UnitSpec spec "/pa/units/commanders/raptor_centurion/raptor_centurion.json.player", file failed to load
    

    Attached Files:

  9. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Everything validates. It's possible it doesn't like commanders innheriting from files in the unitlist.json, but the standard server mod doesn't complain about that. Could you try deleting the commander directory and seeing if that fixes anything?
  10. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Renaming the commander directory provides commander images on the start screen, but still crashes on land.
  11. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Are logs any different?
  12. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Client still has ID error, server still has spec error for the selected commander.
  13. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Go home galactic war, you're drunk.
    thetrophysystem likes this.
  14. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Try deleting the AI folder?
  15. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Nope, still crash on land.
  16. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
  17. mkrater

    mkrater Uber Alumni

    Messages:
    1,349
    Likes Received:
    1,830
    Upon review, it looks like the crash you're receiving is because the mod is specifying an invalid commander.
  18. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    How could this be?

    Does it have something to do with Xenosentry Prime being fixed in PTE?
  19. mkrater

    mkrater Uber Alumni

    Messages:
    1,349
    Likes Received:
    1,830
    According to the Dev, the behavior is by design. I don't think it has anything to do with that particular commander.
    But out of curiosity, are you using this commander in your mod? This is one of the personal commanders that's not for sale. The fix for this commander was to make sure it displayed correctly in-game.
  20. crizmess

    crizmess Well-Known Member

    Messages:
    434
    Likes Received:
    317
    Oh, this is the polite form of RTFM, isn't it?
    dom314 and cola_colin like this.

Share This Page