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

Adventure Mode Showing what you DON'T have in your world. #5

Open
ethaldeman opened this issue May 1, 2020 · 10 comments
Open

Adventure Mode Showing what you DON'T have in your world. #5

ethaldeman opened this issue May 1, 2020 · 10 comments

Comments

@ethaldeman
Copy link

It seems after you updated the tool for the Corsus DLC, the Tool will now display what areas/bosses you DON'T have in that adventure. I don't know 100% how the items are working in the Adventure, but its seems it does show items you don't have in that Adventure. I believe the Campaign is still showing what area/bosses/items you do have.

@Troxbanv
Copy link

Looking at the file and making a few changes to the logic I am able to get the adventure world to work. I built it in Java as that is what I am familiar with. I looked at the lines one by one and looked at the location of the first instance of "Quest_AdventureMode". That line will have all of the adventure mode information in it, I have run it around 10 times so far and it is accurate. I would be happy to post the logic if you would like to look and hopefully it will help you out, it is based quite a bit on the logic you have so I think it may be easy to implement, I am just not a JavaScript guy. Love the tool you have built and keep up the great work.

@Sale3054
Copy link
Contributor

Sale3054 commented May 26, 2020

Looking at the file and making a few changes to the logic I am able to get the adventure world to work. I built it in Java as that is what I am familiar with. I looked at the lines one by one and looked at the location of the first instance of "Quest_AdventureMode". That line will have all of the adventure mode information in it, I have run it around 10 times so far and it is accurate. I would be happy to post the logic if you would like to look and hopefully it will help you out, it is based quite a bit on the logic you have so I think it may be easy to implement, I am just not a JavaScript guy. Love the tool you have built and keep up the great work.

Can you post what you made or reference the err in logic? I will fix it and post the resolution.

@Mini-Placzek
Copy link

Looking at the file and making a few changes to the logic I am able to get the adventure world to work. I built it in Java as that is what I am familiar with. I looked at the lines one by one and looked at the location of the first instance of "Quest_AdventureMode". That line will have all of the adventure mode information in it, I have run it around 10 times so far and it is accurate. I would be happy to post the logic if you would like to look and hopefully it will help you out, it is based quite a bit on the logic you have so I think it may be easy to implement, I am just not a JavaScript guy. Love the tool you have built and keep up the great work.

Would be interested too. Also used this project as base but never fully understood how to parse the save file properly. Could help to fix the javascript which broke after the Corsus update.

@Troxbanv
Copy link

Troxbanv commented May 27, 2020

Sure I posted my code to https://github.com/Troxbanv/Remnant_File_Analyzer. The biggest change that I made was to the logic in finding the adventure and campaign worlds. In my code if you look at the reader class under the readFile method I loop through the file one line at a time instead of looking at the entire thing at once and if the line contains certain keywords I mark the location of the instance and the one with the lowest value is the line that contains all of the information for either the campaign or the adventure world. I have been using this with a couple of friends and for all of us this has worked every time. Thanks for converting the code to javascript, again I am more of a Java and C guy, I can read javascript but writing it I make way too many errors. If you need anything else please feel free to ask and I will do my best to assist.

@Mini-Placzek
Copy link

Mini-Placzek commented May 27, 2020

Sure I posted my code to https://github.com/Troxbanv/Remnant_File_Analyzer. The biggest change that I made was to the logic in finding the adventure and campaign worlds. In my code if you look at the reader class under the readFile method I loop through the file one line at a time instead of looking at the entire thing at once and if the line contains certain keywords I mark the location of the instance and the one with the lowest value is the line that contains all of the information for either the campaign or the adventure world. I have been using this with a couple of friends and for all of us this has worked every time. Thanks for converting the code to javascript, again I am more of a Java and C guy, I can read javascript but writing it I make way too many errors. If you need anything else please feel free to ask and I will do my best to assist.

Thanks for sharing and great job man <3. Will start working on this now. Looks pretty straight forward so shouldn't take too long. Will come back to you if I have any questions.

@Sale3054
Copy link
Contributor

Sale3054 commented May 27, 2020

I haven't had a chance to look at your code yet, @Troxbanv, but this is the solution I came up with yesterday afternoon. I removed the regex and parsed the adText array to find all occurrences containing Adventure after it was delimited via \n. Seems to work provisionally, but I will look at your solution and see if there is a more tenable long term solution. The one used by the author was workable but probably not the best- and this solution isn't much different!

//new
function getAdventureEntries(arr)
{
  arr = arr.split("\n")
  tempList = []
  for(i = 0; i < arr.length; i++)
  {
    arrWord = String(arr[i])
    if (arrWord.includes('Adventure') === true)
    {
      if(tempList.includes(arrWord) === false)
      {
        tempList.push(arr[i])

      }
    }
  }
  return tempList[1]
}

//for context
function showDataFile(e, o){

    $('tr:not(.header-row)').remove()

    text = e.target.result
    text = text.split("/Game/Campaign_Main/Quest_Campaign_Ward13.Quest_Campaign_Ward13")[0]
    text = text.split("/Game/Campaign_Main/Quest_Campaign_City.Quest_Campaign_City")[1].replace(/Game/g,"\n")

    textArray = text.split("\n")

    //this is the only processing being done on adText prior to the original logic below
    adText = getAdventureEntries(e.target.result)

    if (adText != undefined) {
        adventureMode = true
        adText = adText.replace(/Game/g,"\n")
        adTextArray = adText.split("\n")
    } else {
        adventureMode = false
    }




    if (adventureMode) {
        getWorldData(adTextArray, "#adventure")
    }
    getWorldData(textArray, "#main")

}

Results before and after with my code changes:
before-after

I'll put on a pull request after work.

@Sale3054
Copy link
Contributor

I will note that what's throwing off the author's solution is that there is a chunk of "adventure text" at the top of each save which, seemingly, contains all options that aren't present in your current save.

@Sale3054
Copy link
Contributor

Looks like I can't create a pull request, so you can find my fix at my repo:
https://github.com/Sale3054/RemnantWorldAnalyzerFix

@Troxbanv
Copy link

I will note that what's throwing off the author's solution is that there is a chunk of "adventure text" at the top of each save which, seemingly, contains all options that aren't present in your current save.

Yes, that is why I changed the logic to find the smallest index of the phrase Quest_AdventureMode, even though there are many occurrences of that phrase the one with the smallest value has as of the Corsus update been the line which contains all of the adventure world items.

@Troxbanv
Copy link

Sure I posted my code to https://github.com/Troxbanv/Remnant_File_Analyzer. The biggest change that I made was to the logic in finding the adventure and campaign worlds. In my code if you look at the reader class under the readFile method I loop through the file one line at a time instead of looking at the entire thing at once and if the line contains certain keywords I mark the location of the instance and the one with the lowest value is the line that contains all of the information for either the campaign or the adventure world. I have been using this with a couple of friends and for all of us this has worked every time. Thanks for converting the code to javascript, again I am more of a Java and C guy, I can read javascript but writing it I make way too many errors. If you need anything else please feel free to ask and I will do my best to assist.

Thanks for sharing and great job man <3. Will start working on this now. Looks pretty straight forward so shouldn't take too long. Will come back to you if I have any questions.

Great, hope it is an easy fix and look forward to seeing what the fix is. Have been interested in Javascript just never have time to really dig into it.

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

4 participants