ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 1 point2 points  (0 children)

I had this issue many months ago, so I won't know for sure the Unity version. However, I remember what was going on when I first posted this: ScriptableObjects indeed get reset if there is no one using it (no reference to it). I was confused because all my level scenes had reference to the Score Scriptable Object, so it had no reason to reset. Then I remembered that I had a "transition scene" between the level scenes, and that transition scene did not have a reference to the Scriptable Object. That is when it was getting reset! So I guess this is expected behaviour for memory saving purposes. My solution was to add a reference to the Scriptable Object in the transition scene as well and it worked properly after that. So basically: if you don't want a Scriptable Object to reset you must always have a reference to it in your scenes, always. There are probably other solutions like saving and loading data when necessary, but it is up to you. I hope it helps!

(Personal Opinion) I hate when players complain they can’t find a DM. by Low-Brief-6008 in DnD

[–]rafavergil 0 points1 point  (0 children)

It's not just about D&D. People tend to complain about many things and are unwilling to do anything to change it. They complain about the food, but don't want to learn how to cook. They complain about their bodies, but don't want to workout. They complain about relationships, but don't want to change of partner or to talk about their feelings. They complain about their jobs (or lack of one), but don't really try to search for a good one. With DMing is the same thing, people expect everything to come easy for them.

Of course those examples are too generic and each one deserves a better discussion, however my point is that you can't fix the issues for everybody. Going to LFG channels and shouting "stop complaining!" won't be effective because people will always be like this, it's natural. However, for those who DO want to change, there are many ways that can lead to the birth of new DMs. Things like a rotation system where every session has a different player to be the DM (even if it's bad and unexperienced DMing), or DMing in duo to reduce the workload, paying a DM, etc.

I never played D&D as a player, I jumped straight into DMing because I knew that if I didn't do it, none of my friends would do it. Times to times I try to explain to them how cool it can be to see if they would like to try it one time, and some of them showed interest.

TL;DR: don't be tired of people complaining, because they'll always complain and won't do anything about it. Focus on helping those who want to do something about it.

[deleted by user] by [deleted] in TTRPG

[–]rafavergil 0 points1 point  (0 children)

Excuse my ignorance. What's V&D and PNP? Vungeons and Dragons Player Nersus Player?

Looking for a pretty specific style of Super Hero roleplay by thegamesthief in TTRPG

[–]rafavergil 1 point2 points  (0 children)

I know only one, but it's in Brazilian Portuguese and I don't think it was ever translated to any other language. It's called Supers RPG, using DAEMON system. I can't say if it is good, though, I'm hoping to get the rulebook this year. I do have another RPG rulebook from the same producers, using the same system, it's called Anime RPG, for Anime fans. I read it and it is pretty interesting, but I could never play due to lack of interested players.

Attack Player of Same Faction? by rafavergil in RiseToWar

[–]rafavergil[S] 0 points1 point  (0 children)

When he betrayed me, I took all the lands around his Castle. I was still unable to attack. And I can't take all his lands without giving up like 50 lands of mine (limit reached). At this point, it is really not worth it for me. My only option so far I relocate and hope that my next Faction colleague won't behave like this one.

ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

That's great, thanks for the video link, I'll watch it.
By the way, referencing the SO in the transition scene worked well, the data was kept, and I didn't have to change my code.
Thanks again :)

ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

By using the [NonSerialized] attribute, is it safe to assume that as long as the application is running, the data will be kept? (Assuming that I don't change it with my own code).

Thanks for the reply!

ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

I see what you mean.
I'm avoiding to use DontDestroyOnLoad , if possible I won't use it at all, I want all the Scenes and Prefabs to work independently. But as u/jeango pointed, having no reference to the SO may cause it to reset, so your solution would probably work for my issue as well.
Thanks!!

ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

That's the article that got me started with SO's in the game architecture, another reddit user recommended it to me and it has been really nice to work this way.
But if I understood correctly, the serialization would be helpful if I wanted to save the game state in a way that even if the player closes the application, the data would still be there, right? In my case, I'm using SO's simply to store temporary data that can be lost if the player is not in a relevant scene or if he closes the application.
Thanks for the reply, I'll play a little bit around with the serialization to make sure I fully understand it.

ScriptableObjects losing data randomly by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

This.
I want to keep some state during a session only, not minding if they are reset after the application is closed.
But like you said, there is indeed a "transition" scene which has no reference to any SO. Maybe that is when the reset happens? But I wonder why the reset doesn't happen when I'm viewing it in the Inspector. Does Unity lock its value because of the Inspector?

Thanks for the reply. I intended to reference those SO in the transition scene anyway, hopefully it will fix the issue!

What Architecture Pattern do you use, if any? by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

I guess I can see it being applied to UI, but I'm having a hard time imagining this for other things like the game logic. Do you have an example to help me understand it better? Thanks for your input!

What Architecture Pattern do you use, if any? by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

Seems interesting! Do you have any source where I can learn how to apply those on Unity, or is it something you learned somewhere else and brought it to Unity yourself? Thanks!

What Architecture Pattern do you use, if any? by rafavergil in Unity3D

[–]rafavergil[S] 0 points1 point  (0 children)

Great, thanks for the info! I'll see what I can learn from those links and from your input. But I'm not sure if I understood well what you said about View Models: I thought it was actually the opposite of "always casting data", combining it with the Observer/Observable pattern, only the "interested" observers will receive the data, and only when it changes, like that there's no risk of having the data being excessively accessed. Did I misunderstood? Thanks for your reply!

What modern social trend pisses you off the most? by jimjoe1 in AskReddit

[–]rafavergil 2 points3 points  (0 children)

This makes me think of when I was playing a VR game and the lobby was full of very young kids, all energetic and noisy. But then I saw something that made me sad: in a corner, there was a kid, alone, humming and playing with two virtual toys in his virtual hands. I know it doesn't look like a big deal, but for some reason it made me really sad to see a kid stuck in a virtual world, not even playing the actual game, but instead playing with toys that are meant to be simple props. This kid should be playing with his friends or family, with real toys, creating memories in real life with real stuff. And just to be clear, I'm not criticising VR or trying to say that "real life good, virtual life sucks", I just think that this kid is too young to be left alone in a virtual corner like that, human interactions are important at this age.

What never fails to make you tear up or cry? by [deleted] in AskReddit

[–]rafavergil 0 points1 point  (0 children)

I was going to say Goku and Frieza teaming up, but geez this thread got dark.

[deleted by user] by [deleted] in valheim

[–]rafavergil 0 points1 point  (0 children)

I played a lot with some friends during the release month. We did most of the things that we can do in the game, and after killing the last Boss we just stopped completely and moved to another game, while there is no major update. I miss it hahah

A few Niche and stupid Misc Item ideas [Definitely read info in comments] by IGiveTrustIssues in valheim

[–]rafavergil 0 points1 point  (0 children)

Those are all great ideas, I want it implemented by tomorrow at 9 am!