| Tutorial: | Inns with changing Prices |
| Difficulty: | Intermediate |
| RPG Maker: | 2000/2003 |
| Author: | Thejackyl |
Why use this tutorial?
Ever want to make an Inn's price change as you progress through the game? Maybe the inn charges "Per person", maybe the inn charges by how wounded you are?. I'll be covering the "per person" method.
What do I need to know?
- Variables
- Conditional Branches
Okay, so what's the code?
Alright, lets say the inn charges per living person in the group.
First we need to set up a variable to tell how many people are alive in the group, and another to determine the price.
This will be coded right before the inn, in the same event.
<>Variable [Living Allies] Set 0
<>Variable [InnPrice] Set (Cost per person)
<>If [Hero1] Condition = Dead
<>
<>Else
<>Variable [Living Allies] +1
<>If [Hero2] Condition = Dead
<>
<>Else
<>Variable [Living Allies] +1
<>If [Hero3] Condition = Dead
<>
<>Else
<>Variable [Living Allies] +1
<>If [Hero4] Condition = Dead
<>End
<>Else
<>Variable [Living Allies] +1
<>Variable [Innprice] * [Living Allies]
<>End
That should work to determine how many allies are alive, and the total price. Now on to the actual inn.
<>Welcome to Test Inn. It cost \v[#InnPrice]. Would you like a room?
<>Show Choices: Yes/No
<>[Yes]
<>If money => [InnPrice]
<>Full Recovery(or whatever you want the Inn to heal)
<>Else
<>You don't have enough Money
<>End
<>[No]
<>Have a Nice Day
<>End
<>End
<>End
There you go, an Inn that charges per living person.
Click to Return to the Tutorials Page