Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
joman195

Lesson 1 - Part 1

Recommended Posts

fordummies.png

First off, this class is not for teaching you the basics, there are other classes on here that do that. This is a class for those who want to learn how to string events together. Second off, this is an open class meaning anyone can participate in the assignments, first there will be three parts then an assignment.

 

Now that the giant wall of text is done let's get down to the real stuff. First off I am going to show you how to make a banking system that gives 25% interest every 10 sec, now you can easily change this.

What you will need:

3 Variables

2 common events

1 switch

 

Alright first make your two common events and label them like so: 93975729.png

 

Then make three Variables and name them: On Hand, In Bank, and Temp: 52060387.png

 

Next inside bank make a loop, inside it make a choice: Deposit, Withdraw, Check Balance, Cancel. Inside Deposit make a number input processing command and have it save to the variable temp. Then set the variable on hand to your current gold and make a conditional branch to check if the variable in temp is less than or equal to your gold keep he box checked. First, under else make a text box saying 'Not enough gold!' or something to that effect. Above the word else make a change gold and hit decrease then select variable and temp. Create a control variables and choose in bank and add then hit variable and temp, for deposit do the same thing except add gold and subtract the variable.76172365.png

Then for check balance make a text event with \V[the number of the in bank variable].

And for cancel use the break loop command. When it's completely finished it looks like this. 94171784.png

 

Now, for the interest. Go to the other common event and make it parallel process with the switch being the one you made earlier. Then make a timer for 10 sec. after that make a conditional branch for the timer being 0 sec or less and uncheck the box. Then use the change variable and set the temp variable equal to the in bank variable, then divide the temp variable by 4 and add it to the in bank variable. Start a new timer and you're set. 40821657.png

Now make an autorun event on a map to turn on the interest switch and an action button event and call the bank common event.

It should turn out like the one attached.

Bank.zip

Share this post


Link to post
Share on other sites

Straight into it then :) Pretty advanced for the first lesson. Despite the couple of years of played around in RMXP, I don't think I ever actually used common events.

 

Looking forward to the next one :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...