# Gw Temp

## Tutorial - 'Ratios' by TheOnlyMutantPixie

An item about General posted on

### Blurb

A simple tutorial by TheOnlyMutantPixie explains ratios and how you can apply them to your game. Written for RM2K3, but easy to apply to other gamemakers.

### Body

Okay, welcome to my second tutorial, this time teaching you the possibilities of ratios and how to use them in a rather simple little mini-game. The reason I came up with this is because I just had a Maths exam (GCSE, for the English) on Friday, November the 5. Today is November the 6th at 11:51 p.m. And the next exam is on Tuesday, November the 9th. But this will probably be put up after Iâ€™ve had that exam. Anyway, one of the questions is about ratios, which is easy to understand. Ok, enough rambling. Now to get on with the tutorial!

Warning: The following tutorial may teach you some Maths, even some French. You have been warned.

Understanding Ratios (How to figure them out for dumbies)

Ratios are found everywhere, but the simplest way to think about it is: ingredients for a pie. In the kind of wording for an intermediate exam question (extremely similar to the one found on the Maths exam),

â€˜Betty is making a pie and using the ingredients pastry and cherry filling in a ratio of 5:2 (Pastry = 5, Cherry filling = 2. Ratio is in the order of the listed things). If she uses 50g of Cherry filling, how much pastry does she use?â€™

Allow me to explain how to figure it out (answer is below this anyway).

50g of cherry filling is being used, divide that by 2. That is how much a ratio of 1 is: 25g so in order to figure out the pastry times 25 by the ratio you need to figure out (in this case 5)

25*5= 125

Amount of pastry being used: 125g

Backwards Compatibility

I just taught you some Maths, hoorah! This can also be used backwards, where we know the grams but need to figure out the ratio!

Example:

â€˜Betty is making a pie and uses 125g of pastry and 50g of cherry filling. She uses the pastry in a ratio of 5, but what is the ratio of the cherry filling?â€™

125g is being used, divide that by five and you receive the ratio of one.

125 / 5 = 25

So thatâ€™s 25g of cherry filling, the ratio of one, double it and you get 2 ratios, otherwise 50g.

Ratio of the cherry filling: 2

So, the point of this is?

I taught (Some of) you some Maths, yay! Well, nerds might be thinking that, but anyways. This can be applied to games in various ways, in the sneaky form of side quests! Well, itâ€™s not so sneaky now that I announced it.

Exactly how?

Okay, treasure hunt scene coming up.

You stumbled across Pete the Pirate, whose says something like â€˜Arr! You help me find the treasure by fighting the fiends, Iâ€™ll split it with yer, ya landlubber!â€™ Or something a stereotypical pirate would say.

Poor Example

<> Message: Arr! Ahoy there Alex! I need help finding me treasure, some fiends ran off with it! You recover it for me and I may split it with you, 99:1!
<> Variable Oper: [0001:money] Set, Money
<> Change Money V[0001] Remove
\\ Youâ€™ll see why after the main bit.

So now every time you defeat that fiend which is designed for the stupid quest, you store the same amount of money gained from battle in a variable.

Then you make a parallel process event on the map. Have it started off by a switch.

Preconditions: Switch{0001: moneycollecting] ON

<> Variable Oper: [0002: money gained] Set, Money

Okay, now after you have decided the time limit or whatever. Talk to Pete and have this on his second page.

Preconditions: Switch [0001:moneycollecting]

<>Variable Oper: [0002: money gained] /, 100
<> Switch [0002: Finsihed] ON
<> Switch [0001: money collecting] OFF

Now either make Pete disappear or have him say thanks for the money you returned to him.

Please Note: How you get the money is up to you. Whether it is in a chest or from fighting monsters. You can decide. Also, make sure you gain at least 100 Gold easily, so that you get at least 1 gold in return otherwise youâ€™ll end up with bugger all.

Problems? E-mail or use MSN to contact me or annoy someone else, Iâ€™m not too fussy.

The Only Mutant Pixie

Pathetic little side note

The time now is 12:35 am on November the 7th. 774 Words were used including word tags, and I feel this tutorial is a tad short. The coding is mostly rm2k3 form, but rmxp and rm2kâ€™ers never fear! It isnâ€™t too hard to convert.