Yarnspinner: saving and loading dialogue state - unity3d

My team is using Yarnspinner in Unity to create a text-based game, visual novel style. It works pretty much perfectly, but we're having trouble figuring out how to save and load the dialogue state in the game. It doesn't seem that saving the game state "normally" will properly save the dialogue state.
I've done a lot of research but have found little documentation on how to do this. Given that Yarnspinner is an overall improvement on previous Yarn parsing, I feel like there is likely a built in function somewhere that does this, but I haven't been able to find anything. Does anyone know how to do this, or know any online resources that describe this?

Related

Unity: just keep loading infitely on "Application.Reload" every time i enter in play mode

The problem
Hi, I have been experiencing this kind of loading infitely on the window screen: "Application.Reload" since two or three days ago. This just happened spontaneously without any reason. I have been seaching for a solution, but the uniques fixes i had found are not working for me.
The unique not permanet solution that I came up is just use the Task Manager and close up Unity.
The possible fixes that I have tried:
"Just locate the project folder in the system explorer and click on properties" (This only work one time per application or maybe it just do not work.)
"You can check to see if there is any place in your project path that is not in English" (It just do not work.)
These are the fixes that I have tried.
Example of the problem
Meanwhile I am writing this question, I want to re-confirm this is a infinite load. So I open up my Unity Proyect, enter in the Play Mode and write this question.
This is the result:
https://i.stack.imgur.com/sTA48.png
Edit: the image actually shows the longest time i have been waiting. (1:48:34hs)
Thank in advance for any kind of help!
As I know, this problem persist as well in any Unity Operation, it can happen on Reload, Importing, Asset Indexer, etc. Is just a problem that doesn't affect Unity, and devs marked it as WNF (We'll Not Fix).
I have been struggling with this problem for some years now and the only solution I found was to close it from Task Manager and reopen it.

Generally what would cause Unity Editor freezes and not responding?

I have encountered a critical issue that Unity Editor freezes. I've spent many hours debugging step by step of my codes but still can't find where the problem is. So I think maybe I should try thinking from another angle, generally speaking what reasons would cause Unity Editor freezes and not responding?
I can't find a general case discussion about this topic.
From my experience, infinite loop is one reason for sure. Deadlock is critical issue, but not sure if it causes Unity Editor freezes. Unity Editor bug that I encountered only makes the whole editor crashes, instead of freezing. Any other experiences are welcomed. Thank you!
In such case, what kind of tools or methods could I use to debug it? Right now since the editor freezes I can't use "print" to find out what happens after it freezes. So I use Visual studio to debug the Editor thread, in this way I can see all the prints that I wrote. It appears the game is still running, only the editor not responding. And I can use VS click "attach to Unity and play" and put some debugging points, then debug step by step.
The first thing that I would check out is for an infinite loop. At the hang/freeze moment, you can attatch the debugger of your choice and pause the execution. In the case that it is an infinite loop that it is executing, at the exec time pause you might find the execution in a forever running while (true) {...}
Other thing that I would check is the plugins in use. Several Unity plugins like Parse, FMOD, UMP (Universal Media Player), ZFBrowser, or Embedded Browser are using native threads. It’s an issue when a plugin ends up attaching a native thread to the runtime, which then does blocking calls to the OS. This means Unity can't interrupt that thread for the debugger (or domain reload) and hang. Source
To check that you can check the active threads in the visual studio command window af the freeze is reproduced:
View->OtherWindows->CommandWindow and type in this command:
Debug.ListCallStack /AllThreads /ShowExternalCode
In the stack you can check if some thread is there with no need, or if its related with the plugins mentioned above.
Also an interesting point is to check in the windows task manager (in the case that you are using windows) if the CPU usage is to 0%. It can lead you to the type of hang that is taking place.
Good luck.
Edit: I forgot to mention, you need to check also the unity logfiles
I notice this all the time, and its super frustrating.
Unfortunately, this could be any number of issues. I notice this issue most often when working in projects that are made for the Universal Windows Platform.
Try using the Task manager to monitor specific processes / threads running.
Some follow up questions:
What platform is your project currently targeting?
What version of Unity are you running? Have you tried other versions?
What are your computers specs? Is the OS up to date? Graphics Drivers?
Does it happen (or happen more often) when an external code editor is open? Perhaps try going to Preferences>External Editor > Regenerate Project files.
Are you using Unity Collab by chance? I've had issues where collab is stuck trying to communicate with Unity Servers / looking for changes. Try logging out of your Unity account through the editor, and log back in.
Have you tried looking for a Unity editor crash dump, or error log files? I think they can be found here C:\Users\username\AppData\LocalLow\Unity by default. Those files may give you more specific data concerning your problem.
Unity's new versions are getting more slower and slower. From my experience 2019 versions are the best and more stable.
I solved my issue. It's fundamentally an infinite loop.
It's not a simple case such as "while(true)". I'll try to explain.
My game was a PvP game, and I'm making a local AI. Usually my design pattern works fine, however I just turned off the simulation of "AI thinking time", and since the AI codes and server codes all run in local mode, the transmitting of data between server and client are replaced by local method call(meaning instantly executed before everything else).
There is a loophole in my server code. I use "Update" and a flag on server to change a specific game state, however in this particular case, it got into an infinite loop because the local method call is executed before the "Update". And because my AI now doesn't need real time to "think", it "acts" and transmits the event data to server right away. And since the transmitting doesn't need time any more, it calls the server method instantly, hence forming the infinite loop.

VBA hide form from menu

I'm trying to hide a form from the menu using VBA; I've Googled this, but everything is giving me the .visible option, however I want to hide it from the groups menu located on the left side. I could just as easily manually do this, however it's very tedious and I can't be going on other user's computers to do so.
Is this possible?
I might suggest normally you should only disable menus vs. removing them all together, might suggest doing an enable/disable menu item instead..
It should be possible but how much work is it and is it worth it to you? It isn't clear what your host application is just that you're using VBA. Might suggest the host application may already allow for customization if so use what it provides.
If the app doesn't allow customizing your menu you can still do it, just how much work is it worth for you? You'll need to look at the Win32 way of doing things. If not familiar with Win32 and menus take a look and start here looking here at MSDN to start learning about menus in Windows. After this you'll find Pinvoke will be handle to give you C#/VB sample to call what is needed. The VB should be useful but you will probably need to further translate the VB to VBA for your needs. FYI when starting out a a C/C++ developer back in the day 30 years ago it was anticipated anyone getting into windows might take them a few months, there is a lot you'll need to get up to speed on. Thus is this feature really worth it?

Unity3D: WebGL size - 25mb js - am I doing anything wrong?

I am testing different technologies around, choosing the next platform I'd like to create my next simple game with, now it's Unity's turn.
The ability to export to WebGL is a paramount for me. I created a simple test game in Unity, exported it to WebGL and got... 25MB js file and 10MB data file! Looks like I am doing something wrong, perhaps, there is some sort of "dead code elimination" configuration check box I didn't check.. isn't there? I hope there is...
Sometimes if you leave Development build in your build settings it includes a lot of unnecessary things in.
#Joe Blow - what do you mean you can use it for nothing? it's getting better all the time.

How to design a game in Unity3D which is viable for patching?

I was designing my open world RPG's architecture (I am creating it for fun, I don't intend it to be a hit game :D ), and had to stop it, because I ran into a serious wall.
If a create a big open world game, then its size will be big.
Let's imagine that my game has a launcher, which automatically updates itself, when a new patch is found.
Downloading the whole game again is not acceptable, because if there is a minor bugfix, who would download a whole game again, if there is only a minor change?
So somehow I have to make an architecture which is patchable, so if there is an update, my launcher will only download changed files and not the whole client.
When I build my game, 90 % (if not more) of the game data is in one Program Debug Database.
And when I look at a game, for example World of Warcraft, its files are organized in compressed directories. And if there is a minor fix in one zone's particular place (like a tree is missing), they don't have to update the whole game, and not even the whole map, and not even the whole zone.
Instead they only have to update the file, which determines that (for example) 20x20 meter area in the world where is the bug.
So let's get practical with a simple example:
I have one scene with a big terrain in it, and I have to fix a little part of it.
How can I update my released client's buggy parts without downloading the whole client again?
Thanks for your help in advance! :)
There are several ways to do so. One of the most common ways in unity-3d is by asset-bundles. This would allow you to update your game in a similar manner as for example wow.
There are also plenty of assets available in the app store. The one I personally use is M2HPatcher this mainly as it was free at the time. I am not sure if it is still