RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[XP] Need Help with Loops

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 67
TheNeonHeart.com
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.
« Last Edit: May 26, 2015, 12:56:10 AM by yuyu! »
And if you stare for long enough into the abyss... you just might stare it down.

My Games: ExXception Draft
My Awesome Homepage The Neon Heart.com Host to My Writing / Music / Reviews / and More

**
Rep:
Level 66
RMRK Junior
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. ;)

**
Rep:
Level 67
TheNeonHeart.com
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!
And if you stare for long enough into the abyss... you just might stare it down.

My Games: ExXception Draft
My Awesome Homepage The Neon Heart.com Host to My Writing / Music / Reviews / and More

**
Rep:
Level 67
TheNeonHeart.com
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.
And if you stare for long enough into the abyss... you just might stare it down.

My Games: ExXception Draft
My Awesome Homepage The Neon Heart.com Host to My Writing / Music / Reviews / and More

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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:

"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

***
Rep:
Level 85
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

*
Full Metal Mod - He will pillage your women!
Rep:
Level 93
The RGSS Dude
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.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They’re bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I’m the only one, I’m the only one."

***
Rep:
Level 85
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

*
Rep: +0/-0Level 5
RMRK Junior
Consider rel.rlqx.rmrk.net.fwv.fb equipped noroxin aricept lowest price pilex generic discount actonel generic shallaki online shallaki cialis france kamagra chewable 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.