The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => Topic started by: theneonheart on November 21, 2012, 06:29:52 AM

Title: [XP] Need Help with Loops
Post by: theneonheart on November 21, 2012, 06:29:52 AM
I am trying to make a character able to choose their class through a dialogue with an NPC, but I want them to be able to look at each one of the four choices, and say "Yes, this is the one", OR "Let me look at the others" and then go back to the four choices. But I don't know how to do this with the basic dialogue system and doing it the long way is a big mess. Any advice on how to get this going? I'm using XP if that matters.
Title: Re: Think I need to make a 'recursive' dialogue when choosing character class...
Post by: Mangomight on November 21, 2012, 12:57:38 PM
Have you ever heard of loops? They work better than nothing for these kind of situations :)
To be simple I could demonstrate with variables, which would even work with the problem you're having;

Code: [Select]

@>Loop
  @>Show Choices: choice1, choice2, choice3, choice4
  When[choice1]
     @>Control Variables: [0001:testVariable] = 1
     @>
  When[choice2]
     @>Control Variables: [0001:testVariable] = 2
     @> 
     # and so on until 'branch end'.... 
     Branch End
  @>Text
     @> Sure this is the one?
     @>Show Choices: Yes, No
     When[Yes]
     @>Break Loop   # When 'Yes', breaks the loop..
     @>
     When[No]
     @>      # When 'No', continues the loop..
     Branch End
  @>
  Repeat above
  # Now that the variable is set, you can do whatever you want.
@>Text:
  # Say you picked choice2, then...
  @ You've chosen \V[1]               #=> You've Chosen 2
@>
         

Hopes that's pretty self explanatory, you just need to set up a couple of Conditional brances afterwards to make it completely what you wanted it to be, but I guess you'll figure that one out yourself. ;)
Title: Re: Think I need to make a 'recursive' dialogue when choosing character class...
Post by: theneonheart on November 25, 2012, 03:32:45 PM
Hey, thanks for the help. It seems to be working. Sorry it took me a while to get back to you. I appreciate the help!
Title: Re: Need Help with Loops
Post by: theneonheart on December 08, 2012, 02:07:26 AM
OK, so now that I am working with loops, I have a discussion set up with an npc (this is a difference conversation than above). There are 3 choice options after an initial 'what's up' text. then when you pick one of the 3 choices, you discuss with more text. But I have it looped so you go back to the 3 choices at the end of each discussion. However, I have no way to exit the conversation yet. I want to add a conditional branch where you can just press escape and leave the conversation, or I suppose I might be able to add a fourth choice that exits out (just thought of that, I'm going to try that out), but it seems like I should figure out how to exit this with the escape button. I know there is a conditional branch for button pressed, but escape is not one of the options in the menu and I don't know how to make it show up there. Does anybody know how I can work this out? I'd appreciate the help.
Thanks.
Title: Re: Need Help with Loops
Post by: Tsunokiette on December 08, 2012, 02:51:26 PM
I don't remember how the interpreter in XP deals with loops, but it's probably best to avoid using one unless absolutely necessary. It might prevent other events from functioning at the same time.

Another option is to use labels. Labels are like bookmarks. You place one, then later you can use the jump to label command to jump back up or down to the specified label.

Example:

(http://i.imgur.com/n0jwq.png)
Title: Re: Need Help with Loops
Post by: drakenkanon on March 26, 2013, 07:44:52 PM
I disagree with Tsunokiette, loops are great for things like the event mentioned here, simply repeating parts.

On topic: I suggest adding an option like goodbye, nevermind, or whatever you want your character to say in quitting, and just putting a break loop there. In rpg maker VX when you show choices you get the option of selecting a certain option when the player cancels. I don't remember if this was the case with XP, if so: choose the goodbye/nevermind/whatever option.

I hope this helps

Kind regards,
Drakenkanon
Title: Re: Need Help with Loops
Post by: Tsunokiette on March 26, 2013, 07:52:09 PM
Like I said - I don't remember how it works in XP, but if a loop will cause other events to stop functioning in the mean-time, then maybe that's not the best solution. Loops are helpful when used properly and especially if they can run concurrently.  I just don't remember if they do.
Title: Re: Need Help with Loops
Post by: drakenkanon on March 26, 2013, 10:06:02 PM
I never had any problems with them when I used XP, but that might have been a coincidence. But I doubt they should cause much trouble, simply not being able to work during a NPC conversation sounds like a minor problem.

Kind regards,
Drakenkanon
Title: Clinical myotonica, coagulation, hypoechoic yellow-brown kamagra chewable canada worm layer.
Post by: iciecoy on August 23, 2019, 06:21:55 PM
Consider rel.rlqx.rmrk.net.fwv.fb equipped noroxin (http://innatorchardheights.com/noroxin/) aricept lowest price (http://hackingdiabetes.org/aricept/) pilex generic (http://ppf-calculator.com/pilex/) discount actonel (http://huekymigia.com/actonel/) generic shallaki (http://infiniterotclothing.com/online-shallaki/) online shallaki cialis france (http://gaiaenergysystems.com/cialis-20mg-price/) kamagra chewable (http://innatorchardheights.com/kamagra-chewable/) buy lasix (http://ralstoncommunity.org/buy-lasix/) staff <a href="http://innatorchardheights.com/noroxin/">noroxin generic</a> <a href="http://hackingdiabetes.org/aricept/">cheap aricept</a> <a href="http://ppf-calculator.com/pilex/">pilex generic</a> <a href="http://huekymigia.com/actonel/">order actonel online</a> <a href="http://infiniterotclothing.com/online-shallaki/">online shallaki</a> <a href="http://gaiaenergysystems.com/cialis-20mg-price/">cialis</a> <a href="http://innatorchardheights.com/kamagra-chewable/">order kamagra chewable online</a> <a href="http://ralstoncommunity.org/buy-lasix/">buy furosemide</a> unrecognized hyperventilation; http://innatorchardheights.com/noroxin/ noroxin for sale http://hackingdiabetes.org/aricept/ aricept lowest price http://ppf-calculator.com/pilex/ pilex for sale http://huekymigia.com/actonel/ order actonel online cheap actonel http://infiniterotclothing.com/online-shallaki/ shallaki http://gaiaenergysystems.com/cialis-20mg-price/ canadian pharmacy cialis http://innatorchardheights.com/kamagra-chewable/ kamagra chewable online http://ralstoncommunity.org/buy-lasix/ buy lasix description weaker biphasic physiology.