Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

. I want anyway each flow to have definitive reactions from the NPC just like your example. COuld you help me please? 

Best regards,

So basically you just want branching dialogue? That error I think is just an indication that all the variables haven't been set up quite right.

You shouldn't actually need the myChangeVars. The one you want to play around with is the myNextLine variable, where you'll set where you want each line of dialogue to go to. As the documentation says (here is the documentation if you haven't seen it already), for normal lines you can just set myNextLine[number] = number, and for dialogue choice lines you'll set it like myNextLine[number] = [num1, num2, num3] corresponding to the different choices.

It might help if you lay out all your lines consecutively and then plan where you want each line of dialogue to go (what will be the next line). 

Hi, thank you for the response :D

Yes the branching part I did and is working fine.

But I am also trying to implement like in your example that you only have 1 talk with the NPC. After that if you talk to him he will react according to the talk you had.

The way I implemented now, based on your documentation, the talk will always restart.

Oh okay hmm - then I'd guess it might just be a misplaced/missing bracket somewhere. Just make sure that you set an option for ALL the possible dialogue choices. If there's two dialogue choices, there should be two values it's going to change to. 

myChangeVars[dialogue_line_number] = [obj_id, "choice_variable_as_string", ["value1", "value2"]];

If you're still having trouble could you send me a screenshot of the code where you declare this?


still struggling, even checked your example project trying to figure it out :/


I also created this pastebin: https://pastebin.com/ynHyW0Ed


thx! :)

Ah okay I think this wasn't clear in the documentation - for lines where there is a choice but you DON'T change any variables (BUT on other lines in the dialogue you HAVE) then you need to set:

myChangeVars[1] = -1; 

for those lines. That basically means there won't be any variables changing in those lines. 

Also, for the changing variable thing to work, you have to give a SPECIFIC instance ID in that argument. You'd given just an object_index, but the function variable_instance_set requires an instance ID. So at the very top when you set the diretor to an object, you can use instance_find to get the ID (hopefully there's just one instance of that object. If not, you can use "ID" to refer to itself).

Also as a note, you'd forgotten to put the "breaks" after your other cases :)

I've put all the changes into this pastebin:

https://pastebin.com/TURyKsdr

Thank you very much for your help sir :D 

you are awesome! Hope to show you the results someday (in english!)