NPC - Alternate Dialog upon Quest Completion

acarnivorousocean

  • Posts: 194
Greetings, everyone.  This is an interesting topic that I've had trouble finding good documentation for.

I am working on an adventure game in which you have the typical instance of an NPC sending you to accomplish a task, and saying something completely different when you return later.  I currently trying to get a prototype working with proper code blocks and behaviors before I do any original graphics.
All of my previous code blocks are in great working order...I just can't wrap my head around this custom dialog issue.

I am building my prototype using the 'RPG Town & Dialog' test game.  I am just having trouble figuring out how to:

1) Make an alternate block of text (for the completed quest)

2) Make a code block that can call for that piece of text specifically.
I think I can do it with Booleans, but I'm not entirely sure how to get it all together.

I was poking around inside the NPC Dialog Behavior, but I'm still trying to get my bearings with these code blocks.  It was much easier doing custom dialog with RPG Maker....but now, it's time to learn something new.

If anybody has some tips, or a new way of accomplishing this task that I haven't considered, please fill me in.  Maybe this thread can assist some other poor soul who is trying to make a solid RPG/Adventure.

acarnivorousocean

  • Posts: 194
In my brainstorming, I even laughingly considered Killing the NPC upon quest completion, and replacing his sprite with a copy that just had completely different dialog.  I figured that was more trouble than it was worth.  I'm just racking my brain right now for any possible solution.

Devillocks

  • Posts: 6
New to Stencyl myself, but from what I've been reading in the forums it seems you would set a global attributes to flag when the quest is complete, and then your dialog would trigger if that flag value is true. I would think it would be backwards from RPG Maker, in the sense that you would check the flag for "completed" dialog first, if that's false then the "otherwise" value would be the standard dialog.

acarnivorousocean

  • Posts: 194
Yeah, it's always difficult getting used to a new program like this.
Thank you for your ideas though; I'll have to search a bit more and learn about Global Attributes.

I'll try to post my solution with screenshots in case anyone else stumbles upon this thread.

lazyboygames

  • Posts: 485
I'm actually trying to so the same exact thing with my game. The problem is that the RPG Town dialogue doesn't allow very much customization. What I was considering doing is creating my own dialogue boxes.

I would be really interested to find out when you finish. I will actually try to make one myself, and if I do I will post it on this thread as well.

acarnivorousocean

  • Posts: 194
I'm glad I'm not alone in my frustration.

I had been considering the same thing as you: custom dialogue boxes.  I mean, who really needs an NPC that you can only talk to once?  Maybe someday we'll have an improved way of customizing dialogue. 

Sure, post back if you find anything useful, and I'll be sure to alert you as well.

Good luck.

acarnivorousocean

  • Posts: 194
OK, after a few days of research and lots of banging my face on the keyboard, I've come up with something that seems to work.  Keep in mind that I'm still working on it, and it is by no means finished or perfect.  But I figured that anyone watching this thread could take this foundation and run with it.  I'll explain the best I can, and with screenshots of course.

You'll notice in these code blocks that there is only text displaying, and no boxes.  I figured if I at least get the text working properly, I'll worry about drawing boxes later. ;)

This example works fine with both the NPC and the Quest Item on the same Scene.  I'm sadly having problems with the quest resetting itself as soon as I leave the scene and come back.  See, it's not perfect at all.

I understand that Game Attributes are global, and should save across multiple scenes.  I'm not exactly sure why all my stuff is resetting.

At any rate, it's progress!  Feel free to correct any of my code blocks if you find something better.  Explanations for the code are on the jpeg.

acarnivorousocean

  • Posts: 194
OK, got some great help in another thread.  See attached jpeg.  That little block that says 'Set After Quest to False'.....get rid of it.  By doing that, I am ensured that all of my booleans (and quests) will be remembered.  No more of this quest-resetting nonsense.  This code block is inside of the Quest Item by the way.

lazyboygames

  • Posts: 485
That is really cool. One thing  that you might consider adding is a during quest boolean. So when you are doing a quest instead of just repeating what you are supposed to do the NPC acts like they have talked to you before. Also I feel like after awhile it is going to get really jumbled if you keep using game attribute Booleans.

Maybe you should use a list game attribute that records what quest you have completed with local Booleans. This way the behavior will be a lot more flexible.


acarnivorousocean

  • Posts: 194
Dude, the 'during quest' idea is perfect.  We see NPC's doing this all the time-
"If you're having trouble finding (x), have you thought about doing (y)?"

And yes, if my game comes to be of a substantial size (which I plan for it to), things are going to look a little crazy if I have to make a custom set of at least 3 Booleans for each quest.  I will look into using list attributes.  If you happen to have any helpful screenshots of it in action, please post it.

Thanks for the info.