Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Fleece

A dialogue manager for Unity that doesn't fray at the edges. · By KaiClavier

Suggesting set operators

A topic by Jacob Grossman created Jan 08, 2021 Views: 229 Replies: 12
Viewing posts 1 to 12

Hey! I'm trying to get my head around how to set variables. All i want to be able to do is ++ an int variable but it seems that that isn't possible from within the default parser. Would it be possible to add basic math functions to the set method?  Having things like ++, -- would be super useful. 

Developer

Hey!

The default parser actually as a feature like this, as a custom event example! If you type <<add($myVariableName, 1>> it'll add 1 to your variable.

Thanks for the reply. I've gotten that working now thanks.

 Do you have a discord for your tools? Was just wondering because I'm trying to learn how Fleece works (am currently just trying to get something to happen once the dialogue has reached the end of a tree but can't for the life of me figure out how to check whether the passage is finished reading or not)

Developer

I don't have a discord, but it's not a bad idea... usually I'll just answer questions one-on-one like this!

You'll be able to tell when dialogue has reached the end of a tree when Continue() returns an empty string!

Thanks again. I got it working in the end. I was running into weird issues I think because I was testing if passage.Continue() == string.Empty but of course that was continuing the passage and messing everything up. I realised after a bit that I could do string = passage.Continue() then test that to see if it was empty.

Developer

Ahaha yep, that's the way to do it!

(1 edit)

Hey, I was gonna suggest this as a feature but i don't  know if I just aren't seeing it yet but it'd be cool if the parser settings had a setInitialState button and resetToSavedState button. I'm forever testing to see if things work or not but then having to go into the Parser and reset variables that'd just been changed. Does this already exist?

Developer

Oh good idea - the default save data system is very simple on purpose - it's designed to be integrated into other systems for anything more complex. (I'm working on a versatile save data system that'll integrate into fleece right now)That said, I should add a method to that class so values can be reset quickly...


The visited array already has a reset function that's called in the sample scenes, so I'll add a base reset function to parsers that can be called at a similar time... outside of the sample scenes, just like with the visited array, it'll be up to the developer to call it at an appropriate time - but I'll add a button to the default parser so it can be done though the editor.


It might take a bit longer, but I'll make sure to upgrade the save data system soon! Should I email you a build to test it out when I've got it working?

(1 edit)

Yeah I'd be happy to test it out. 

I should prob spend a bit more time with the example scenes.  The systems are all SO flexible and loosely coupled that it sure has taken a bit of time to wrap my head around how to understand what's going on and how to get what I want but I have prototyped 90% of what I set out to test so that's something.

Something I came across once I'd built my .exe was that a custom method I'd set up using the custom commands from one of the examples didn't run in the build but does run in the editor. Could that be a bug?

spawnPizza is the one that doesn't run once built:

Developer

Oh interesting, what does SpawnPizza() do? does the "dt" method still work in this scenario?

(1 edit)

... never mind ... after testing everything again I found the problem was coming from somewhere else. It's weird that it didn't occur in editor until after building but hey /shrug

the dt method appears to work in editor and build but tbh I'll prob remove that one because it's one of the overlapping methods I built before I really understood what was happening when and how - it was a method used to disable the dialogue box onscreen

Developer

I just submitted an update to the asset store (live on itch already) for the new Reset methods! The DefaultParser scriptableobject has a button in its inspector now that lets you reset all data, and each data can have an initial value defined.

RIght on!