Re: ORK integration
Posted: Tue Oct 29, 2024 2:11 pm
Hi,
On your QuestJournalForORK and QuestGiverForORK component(s), have you ticked Allow ORK Quest Machine Save Data To Save? If not, the game will be double-saving quest data, so you'll want to tick those checkboxes.
In any case, edit the ORKQuestMachineSaveData.cs script.
In the LoadGame method, change this:
to this:
Then add a method like this to the script:
You may want to check this line:
Currently it sets "isBugged" true if the quest isn't procedurally generated. Change it to whatever criteria works for your scenario.
The code above simply removes the quest from the player's journal. If you instead want to add a fresh copy of the quest, change the line "if (isBugged)" to:
On your QuestJournalForORK and QuestGiverForORK component(s), have you ticked Allow ORK Quest Machine Save Data To Save? If not, the game will be double-saving quest data, so you'll want to tick those checkboxes.
In any case, edit the ORKQuestMachineSaveData.cs script.
In the LoadGame method, change this:
Code: Select all
if (savedGameData != null)
{
SaveSystem.ApplySavedGameData(savedGameData);
}
Code: Select all
if (savedGameData != null)
{
SaveSystem.ApplySavedGameData(savedGameData);
if (savedGameData.version < 1) FixQuests();
}
Then add a method like this to the script:
Code: Select all
void FixQuests()
{
var journal = QuestMachine.GetQuestJournal();
var questsToCheck = new System.Collections.Generic.List<Quest>(journal.questList);
foreach (var quest in questsToCheck)
{
bool isBugged = !quest.isProcedurallyGenerated;
if (isBugged) journal.DeleteQuest(quest);
}
}
Code: Select all
bool isBugged = !quest.isProcedurallyGenerated;
The code above simply removes the quest from the player's journal. If you instead want to add a fresh copy of the quest, change the line "if (isBugged)" to:
Code: Select all
if (isBugged)
{
var originalQuestAsset = quest.originalAsset;
journal.DeleteQuest(quest);
var questInstance = originalQuestAsset.Clone();
var questerTextInfo = new QuestParticipantTextInfo(journal.id, journal.displayName, journal.image, null);
questInstance.AssignQuester(questerTextInfo);
questInstance.timesAccepted = 1;
journal.deletedStaticQuests.Remove(StringField.GetStringValue(questInstance.id));
journal.AddQuest(questInstance);
questInstance.SetState(QuestState.Active);
}