Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError on save upload #9

Open
paige404 opened this issue Aug 28, 2020 · 3 comments
Open

TypeError on save upload #9

paige404 opened this issue Aug 28, 2020 · 3 comments

Comments

@paige404
Copy link
Contributor

Having trouble with the js breaking at Line 286.

Uncaught TypeError: Cannot read property 'replace' of undefined

Worth noting that I have a Subject 2923 campaign, I am running a Corsus adventure mode, and I attempted to upload the save file directly after I loaded into the Swamp.

Using notepad++ to read the save file directly gives a real mess, but the only /Quest/Campaign_Main/ instance in it is /Game/Campaign_Main/Items/QuestItems/Quest_FoundersKey.Quest_FoundersKey_C

@paige404
Copy link
Contributor Author

paige404 commented Aug 29, 2020

Been taking a crack at this locally and was able to find a solution that I think works for preventing breakage with both Main and Subject 2923 campaigns, though parsing 2923 campaign events is of course not an option without writing all that in. Maybe I can do that too, but it's outside the scope of this issue.

It now shows me a Corsus Adventure mode, but it doesn't appear to be my active adventure mode. The Adventure I already have active (and have entirely completed, as far as I can tell) is here (line 310 of the file):

/Game/World_Swamp/Quests/Quest_AdventureMode/Quest_AdventureMode_Swamp_01.Quest_AdventureMode_Swamp_01 �   v   /Game/World_City/Quests/Quest_AdventureMode/Quest_AdventureMode_City_Template_01.Quest_AdventureMode_City_Template_01 �   d   /Game/World_Swamp/Quests/Quest_Boss_SwampGuardian/Quest_Boss_SwampGuardian.Quest_Boss_SwampGuardian �   l   /Game/World_Swamp/Quests/Quest_Boss_SwampGuardian/Quest_Boss_SwampGuardian_POI.Quest_Boss_SwampGuardian_POI �   g   /Game/World_Swamp/Quests/Quest_SmallD_QueensTemple/Quest_SmallD_QueensTemple.Quest_SmallD_QueensTemple �   o   /Game/World_Swamp/Quests/Quest_SmallD_QueensTemple/Quest_SmallD_QueensTemple_POI.Quest_SmallD_QueensTemple_POI �   y   /Game/World_Swamp/Quests/Quest_Miniboss_FlickeringHorror/Quest_MiniBoss_FlickeringHorror.Quest_MiniBoss_FlickeringHorror �   K   /Game/Maps/Templates/Template_Dungeon40_Small01.Template_Dungeon40_Small01 �   �   /Game/World_Swamp/Quests/Quest_Miniboss_FlickeringHorror/Quest_Miniboss_FlickeringHorror_POI.Quest_Miniboss_FlickeringHorror_POI �   m   /Game/World_Swamp/Quests/Quest_Event_TraitBook_Swamp/Quest_Event_TraitBook_Swamp.Quest_Event_TraitBook_Swamp �   p   /Game/World_Swamp/Quests/Quest_Event_Simulacrum_Swamp/Quest_Event_Simulacrum_Swamp.Quest_Event_Simulacrum_Swamp �   …   /Game/World_Swamp/Quests/Quest_OverworldPOI_Cryptolith_Swamp/Quest_OverworldPOI_Cryptolith_Swamp.Quest_OverworldPOI_Cryptolith_Swamp �   n   /Game/World_Labyrinth/Quests/Quest_Cryptolith_Labyrinth/Quest_Cryptolith_Labyrinth.Quest_Cryptolith_Labyrinth �   S   /Game/Maps/Templates/Template_Dungeon_SingleTilePOI.Template_Dungeon_SingleTilePOI �   g   /Game/World_Swamp/Quests/Quest_Event_DevouringLoop/Quest_Event_DevouringLoop.Quest_Event_DevouringLoop

But the events that actually show up when it parses my adventure mode is from a second section, here (line 7 of the file):

Game/World_Swamp/Quests/Quest_AdventureMode/Quest_AdventureMode_Swamp_02.Quest_AdventureMode_Swamp_02 �   L   /Game/World_Swamp/Quests/Quest_Boss_Fatty/Quest_Boss_Fatty.Quest_Boss_Fatty �   X   /Game/World_Swamp/Quests/Quest_Siege_BrainBug/Quest_Siege_BrainBug.Quest_Siege_BrainBug �   ^   /Game/World_Swamp/Quests/Quest_SmallD_FetidPool/Quest_SmallD_FetidPool.Quest_SmallD_FetidPool �   O   /Game/World_Swamp/Quests/Quest_SmallD_Wisp/Quest_SmallD_Wisp.Quest_SmallD_Wisp �   ‚   /Game/World_Swamp/Quests/Quest_OverworldPOI_AbandonedThrone/Quest_OverworldPOI_AbandonedThrone.Quest_OverworldPOI_AbandonedThrone �   y   /Game/World_Swamp/Quests/Quest_OverWorldPOI_GraveyardElf/Quest_OverworldPOI_GraveyardElf.Quest_OverworldPOI_GraveyardElf �   v   /Game/World_Swamp/Quests/Quest_Event_BurdenOfTheDevoted/Quest_Event_BurdenOfTheDevoted.Quest_Event_BurdenOfTheDevoted

I'm hoping this issue makes more sense to someone more knowledgeable about these save files. What is AdventureMode_Swamp_02? Why does it read that and then neglect AdventureMode_Swamp_01?

Edit: Been debugging pretty thoroughly and I think I see the problem, but I don't know the solution. My Adventure Mode quests do get picked up in tempList, but at tempList[5]. They then get discarded at line 301, adText = tempList[1].

I'm sure array index 1 is a magic number of some significance, but I'm not sure what that is. It makes this a bit troublesome.

I'm attaching my save file here in case you or anyone else cares to investigate. It should be showing Dream Eater, Queen's Sanctum, the Guardian, some other stuff. Instead, it shows Graveyard Elf, BrainBug, and several other things that are (unfortunately) not in this particular adventure.

save_0.zip

@paige404
Copy link
Contributor Author

paige404 commented Aug 30, 2020

I was able to get everything working locally by checking for campaign type (Main or Clementine--that is, 2923). On a Main campaign the code runs as normal, on a Clementine it uses some different splits to find the campaign data (to avoid further TypeErrors) and pulls adText = tempList[5].

I still need to make sure this is a viable solution. I've got a friend's save with a Main campaign to test that I'm not breaking any existing functionality, but I'll need to wheedle some other friends for 2923 saves for further testing; I don't want to submit a PR only to find that my magic number is bad and it breaks on other people's saves.

I also don't feel super comfy adding a magic number into the codebase at all, especially when I don't know why it works out the way it does.

@paige404
Copy link
Contributor Author

paige404 commented Sep 1, 2020

The tempList[5] approach broke when testing with a friend's savefile, but that's good--I worked out a more elegant solution, no magic numbers involved. I'll want to do some more extensive testing (adventures on each world, and testing edge cases like making a subject 2923 campaign, making a new adventure, then re-rolling a main campaign again). but I think I'm about ready for a pull request once that's done. Stay tuned.

paige404 added a commit to paige404/Remnant-World-Analyzer that referenced this issue Sep 2, 2020
- resolve issue hzla#9
- add logic to check the campaign type
- change the place in the save file where adventure mode data is taken
  - accomodates both campaign types
- no support for subject 2923 campaign events or reisum adventures yet, but this is the first step.
paige404 added a commit to paige404/Remnant-World-Analyzer that referenced this issue Sep 2, 2020
- resolve issue hzla#9
- add logic to check the campaign type
- change the place in the save file where adventure mode data is taken
  - accomodates both campaign types
- no support for subject 2923 campaign events or reisum adventures yet, but this is the first step.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant