Closed birdmanmandbir closed 3 years ago
Adding new facts is a little tricky because they're spread out randomly across multiple tables in the save file. I'll implement a function that appends a new entry on to the first FactTable found and test if that works.
@Deweh Thanks! Is it really random in multiple tables, or just distributed in different tables (with a fixed mapping)? For the latter one, maybe we can get the table id and insert new entry to the specific table.
I use this to get the table id, although there are 10 tableEntry, but all the known facts are in the tableEntry 0
public List<FactsTable.FactEntry> GetKnownFacts()
{
var factsList = new List<FactsTable.FactEntry>();
int i = 0;
// 10 tables
string message = "";
foreach (NodeEntry tableEntry in this.GetFactsContainer().Children)
{
message = "table " + i.ToString() + "\n";
message += "length:" + (((FactsTable)tableEntry.Value).FactEntries.Count()).ToString() + "\n";
var tableData = (FactsTable)tableEntry.Value;
foreach (FactsTable.FactEntry fact in tableData.FactEntries)
{
if (!fact.FactName.StartsWith("Unknown_"))
{
message += fact.FactName + "\n";
factsList.Add(fact);
}
}
i++;
MessageBox.Show(message);
}
return (factsList);
}
I'm intrigued by your project. Will this help with frozen Quests? There seems to be a huge interest with people who are stuck after the search and destroy mission. Thanks for your hard work!
@birdmanmandbir From my tests, it seems that the proposed method does not work. A new fact can successfully be inserted into the first table, but the game does not recognize it. If you'd like to try it out, it's available on the dev-stable branch.
@adiggens Facts are separate from the active quest system. There may be some facts for some quests that can help move things along, but they aren't a catch-all solution.
@birdmanmandbir Sorry if a PR isn't the right place for this, but what are the combination of existing facts that would need to be set (with the correct values) to enable to the secret ending?
@Deweh @bencalegari sorry for reply late, actually I guess sq032_jonny_friend
is one factor which could improve jonny's percentage from 60% to 70% (if you said you are friend of jonny, then this percentage only could be 60% in maximum)
I will try this dev-stable branch on my own save file.
@birdmanmandbir Since my last reply, the dev-stable branch has been updated to hide the 'Add Fact' button so that it could be merged to master. All the functionality is still there, you'll just have to find the button in the designer and set its 'Visible' property to true.
This feature is now working correctly with 0c715ca7134422c902a3fa6624b8afc149dc0f1b. (mfw they use the hash as an index) It'll be included in the next release.
To have the secret end, I think the sq032_jonny_friend should be added, but for now this tool not support add key-value pair to the quest facts