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.
Variables

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
Om nom nom nom
I'm working on an Alchemy system, and I have it so that upon making a potion, you have a chance to level up your Alchemy.

Code: [Select]
<>Message: Hmm... This appears to be an Alchemy table.
:               No one is currently using it.
:               Would you like to try your hand at potion making?
<>Show Choices: Sure, why not?/Nah, I don't want it to blow up.
: [Sure, why not?] Handler
   <> Message: What potion would you like to make?
   <> Label: 1
   <> Show Choices: Minor Health Potion/Minor Mana Potion/Antidote/More...
    :[Minor Health Potion] Handler
       <> Message: To make a Minor Health Potion
        :                You are required to have a
        :                Grimsweed, Parsat, and an
        :                Empty BVial. Are you sure
       <> Message: You want to make this potion?
       <> Show Choices: Yeah./No, I changed my mind.
       :[Yeah] Handler
          <> Branch if Grimsweed Possessed
              <> Branch if Parsat Possessed
                  <> Branch if Empty Vial Possessed
                      <>Message: You mix the two herbs into the vial
                       :               and shake it up a little.
                        <>Change Items: Empty Vial 1 Remove
                        <>Change Items: Parsat 1 Remove
                        <>Change Items: Grimsweed 1 Remove
                        <>Variable Oper: [017:Health Potion] Set, Rnd [0-5]
                        <>Branch if Var [0017:Health Potion] is 2 Less/Equal
                           <>Change Items: Minor Health Potion 1 Add
                           <> Message: You made ONE Health Potion(s)!
                           <>
                          :End
                          <>Branch if Var[0017:Health Potion] is 3
                            <>Message: You created ONE Health Potion(s)!
                             :              You gained an Alchemy level!
                            <>Variable Oper: [0018:Alchemy] + . 1
                            <> Change Items: Minor Health Potion 1 Add
                            <>
                          : End
                           <>Branch if Var [0017:Health Potion] is 4 or more
                              <>Change Items: Minor Health Potion 2 Add
                              <>Message: You made TWO Health Potions(s)!
                              <>
                           : End
                           <>
                         : Else Handler
                           <>
                        : End
                        <>
                     : Else Handler
                       <>
                    : End
                   <>
                : Else Handler
                  <>
               : End
                <>
             : [No, I changed my mind] Handler
                <> Jump to Label: 1
                <>
             : End
            <>
         : [Minor Mana Potion] Handler
           <>
         : [Antidote] Handler
           <>
         : [More...] Handler
           <>
        : End
        <>
      : [Nah, I don't want it to blow up.] Handler
         <>
      : End
      <>



And then I have a little book above the table, and I want it to tell me what level my Alchemy is. But I can't figure out how to display the value stored in the [0018:Alchemy] Variable. D: Is it possible?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
\v[18] in a Message should do it.

If you don't want to show a message, you'd need to do some picture eventing to show it.

**
Rep: +0/-0Level 85
Om nom nom nom
:D Thanks that worked.