Hey everyone, I’m certain this is probably my fault as I am new to GDevelop and just need to use it for a silly assignment game demo, but I’m having a lot of trouble figuring out what’s happening. I’m trying to make dialogue options from Yarn change the scene depending on which option you pick. Context: the player gets a choice of where to get lunch out of KFC, McDonald’s, and HJ’s - I’ve only set up the KFC scene so far and tried to code a change scene using a “when command <<“choicekfc”>> is called” as the condition and “change the scene to KFC” as the action, but it’s not working at all and I instead get a grey screen. I’ve tried to change the command to be the “when dialogue has tag ___” but had no success with that either. I suspect I haven’t made the Events tab and Yarn talk to each other properly and I’m stumped on what to do. I added a simple “Let’s go!” dialogue to test if it will play after the player selects the option, and it shows like normal before the screen then goes grey. I’ve attached the Yarn screenshot for context (the forum won’t let me post more than one image since I’m a new member) and any advice would be appreciated!
The code just reads as follows:
Command << “choicekfc” >> is called change the scene to KFC
I think I can upload the Events tab code here by making a reply to myself lol
I haven’t used Yarn but by your event sheet, what it looks to me is that part under "Change scene with options, that might be causing it.
If Dialogue is not running
Hide (I think it hides everything)
So yeah, I believe it might be that part that leaves you with a grey screen. I could be wrong, of course.
The other thing that caught my attention was the part with the timer “typewriter”.
Does it just stop scrolling when the text is done? I don’t see any action to make the timer cycle stop. But then like I said, I’m not really familiar with yarn, so there’s that.
Thank you for the reply!
I just deleted the hide command and now there is no grey screen but it freezes on the frame of the last line of text being displayed in scene 1 and doesn’t change to scene 2 still. At least there’s no more grey so thank you for that haha.
The timer is to make the text have that scroll effect like a typewriter - I’m not sure if I need to pause or delete the timer when the scene ends. I figured it would be okay to not finish it as it’s a scene timer and not anything global, although I could be very wrong because again I’m inexperienced with GDevelop. The text just scrolls and stops once all of it has been revealed.
I suppose you might as well try to pause the timer when it’s not being used. It might be still trying to scroll the text and that might be preventing you from calling “choicekfc”. Or not idk.
The other thing that comes to mind is whether you need to have the dialogue running to access the command? Though I doubt that would be the case.
edit: So I tried looking up some yarn examples. I don’t think it’s the timer. You’re right, it seems the timer is for the scrolling speed so, yeah. I’m still unsure if change scene can be done from the dialogue. Though you might want to try using a scene variable instead.
Declare a boolean scene variable, let’s say, “gotokfc” and set it to false.
If command “choicekfc” is called
set “gotokfc” to true
And then create another event.
If “gotokfc” is true
Change scene to “KFC”
Finally, you might need to have an end dialogue or something. This might help:
The boolean scene variable didn’t work but for some reason the endtalk tag did! Thank you so much for linking that post and for all the help - so strange that it has to be another node with the tag to change rather than just using the answer of the choice node to switch scenes using a tag but I’m just glad it works now.
for anyone else with the same issue this is all I did and then gave the ‘End’ node a tag saying ‘endtalk’, I then put this in the Events page:
The current dialogue branch contains a ‘endtalk’ tag
Then SUB EVENT the action of ‘change the scene to “KFC”’
Ah I see. I guess the boolean variable doesn’t get you out of the dialogue cycle, the end node with the tag does. So yeah, that makes sense.
Well, alright! Nice! Good luck on your assignment.