Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

OK, the code change is the culprit in my opinion.

When you load a save point, Narrate is called with loading = true. The loading flag is set to false only after Narrate returns, in the final line of Load. This means that your while loop goes on forever, which crashes Unity.

I guess you could fix it by adding something like this:

while (story.canContinue || loading) 
{
  // ...
  if (loading)
  {
     // Stop the loop after one iteration
     loading = false;
  } else { 
     story.Continue();
     // ...
  } 
  // ...
}

I'm not sure about this, though, because I don't know the details of your code.

I believe I see what you're trying to do here: I guess you want a long multi-line text to be displayed at once, and the breaks are only when a choice is to be made. I would have done it differently, which does not mean it's better, just safer. I would have created an intermediate object that collects and concatenates all the messages instead of the SayDialog, and called sayDialogToUse.doSay only when a choice is to be displayed.

Let me know if your modified Gateway finally works as expected!

You were right, setting loading to false worked! Thank you so so so much!!!

In my code, I collect/concatenate all the text in a string (allText) and then call sayDialogToUse.doSay when the story reaches a choice (it’s outside of the loop). So far, I’ve been operating under an “if it works, it’s good enough” mentality haha – but I’m very open to suggestions for improvement if you’d advise any!

Thank you again for your help!! I really appreciate your support!

Great! Glad to be useful sometimes.

I understand better your code now, it's basically the same solution I was suggesting. :-D

If more people were using this tool, I would probably consider to add it as an alternate mode. For some kind of games, it makes a lot of sense!