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

Clearing Jumper Passage bug

A topic by Edmango created Oct 30, 2019 Views: 258 Replies: 3
Viewing posts 1 to 2
(2 edits)

Hello again. I've been working with your asset and ended up adding quite a few custom commands to the parser so that I need to jump into code and add stuff as little as possible.

Right now I've hit a snag and would like some assistance in attempting to figure it out:

What I've done is made a function that will replace a passage with another one, it searches through my story for passages, can successfully find one with a matching name, but then when it goes to the final step, which is replacing the passage on a character with a new one, it breaks.

I was trying to stress test this and tried a few things, first I set

Envmgr.Charactersinscene[i].Dialogue = null;

(Dialogue is just the name of the jumper variable)

And then kept the rest as is, I could clear the passage once, but then if I tried to set it to a new passage, it gives me an error and crashes my game client.

So I now have it instead of setting that jumper to null, it now sets it to clearJumper, which is a private variable that's just a jumper with nothing in it.

This let me set the jumper from something to clear to something to clear again, but when I tried to set it for the third time in a row, it crashes.

This is already better than before, but I wanted to know if there's a better way to set passages because for some reason it's saying that my jumper.passage doesn't exist and crashes, instead of just telling me that it's null.

Perhaps a way to, in code, create a new jumper and then set it to that new jumper

I also tried doing:

Jumper j;
and setting the jumper to j, but it tells me that it's the use of an unassigned local variable, so I got kinda stuck.

Thanks for your time.

P.S. Oh, and this is a VERY minor thing unrelated to the above, consider it a feature suggestion:

but it's a bit strange that every time you click outside of any text box or passage it just deselects the passage. I like to click on the titles to change them, but sometimes I click just 1/2 pixels too high or too low and it deselects it so I need to select it again, if there's a way to make it so when you are clicking on the inspector window either on the title or the raw text and have it so that it doesn't automatically deselect I'd appreciate it.

Developer (1 edit)

If your goal is to replace a passage with another one, would the <<#PassageName/PassageID>> tag work for you? That inserts the entire parsed contents of one passage into another, excluding any recursion

Also good catch with the whole clicking outside a text field thing… I’ll try to change that soon!

That appears to have completely solved my problem, thanks! I was just hesitant to replace passages with the passageID because of this line on the documentation: "This is the passage id that this jumper will reference. It's recommended to set passage instead of id through code." But if I'm instead just giving it a null passage through the ID, the problem is resolved. Thanks again!

I'm nearly done setting this up to work properly in my game and this tool has helped me out immensely. Thank you for your prompt responses and assistance.

Developer

Ah yeah, that line just refers to… The name of a passage might change (either by reorganization or possibly localization) but the ID will always remain the same as a reference. You can right-click on a passage and copy it’s ID to your clipboard easily with an option in the context menu!