Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Help with events
« previous next »
  • Print
Pages: [1]

Author Topic: Help with events  (Read 3747 times)

Offline Eetio

  • Initiate
  • *
  • Posts: 26
Help with events
« on: August 19, 2010, 02:28:56 PM »
I have been using RPG maker 2000 and 2003 now for around 2 years but have never really gone into depth with variable and any triggers or scripts. I'm planning on making a new 1 and making it awsome, but I wanna know the basics if anyone can help? I.E how to use variables, how to stop events from repeating over and over making me have to make loads of maps just to get away from some events (but this means you can't go back through the game at all). Just don't want the gameplay to be Linear like in all my RPG games so far.

EDIT: I checked some tutorials and now know roughly how to use switches :D
« Last Edit: August 19, 2010, 04:48:51 PM by Eetio »
Logged

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Help with events
« Reply #1 on: August 19, 2010, 08:06:59 PM »
I don't get it. Every time I read a thread like this I could swear that I've read it before. And I'm pretty sure that I've replied to all of them as well. But when I try to find one to simply copy the whole deal it is with no success.
So I'll write a new one... once more.

Variables are the core of all programming. A Variable can have a value written to it. A switch is basically a variable BUT it can only have 2 values: Yes or No.

So welcome to "Introduction in use of switches and variables" and you!
Before we set out lets introduce our heroes. We have Frank the fire mage, Bob the berserker and Nigel our friendly necromancer.
When the adventure start the game wants to know one thing. Which character do you want to use? Is it 1. Frank, 2. Bob or 3. Nigel?

To answer the game's question you could simply use the "Show choices" event command.
Now, if the player answers Frank. 1 of two things could happen.
1. You either switch ON a switch called "Frank"
2. You set the value to 1 in a variable called "Character choice"
The result will be the same when you create a conditional branch to check what character the player chose but still.
-----------------
What I'm trying to say is this. Switches are generally inflexible, with only 2 choices they are best used to check the status and/ or progress of things.
If you wanted to do this with switches you would need 3 of them. One for each character. Instead you could simply use one variable and decide what value will represent what character (1 is frank, 2 is bob and 3 is nigel).

_____________________________________LINE_BREAK_____________________________________
PART 2

Switches and YOU!

"When is it jolly fine to use switches then?" you might ask.

Case 1. Avoiding chesthogging.

Well here's the thing. Let's say that the party of Frank, Bob and Nigel reaches a very dark cave. They travel around, fight some mangy beasts and in the end happen upon a treasure chest. Nigel really wants to open it and see if it holds a dark tome of unspeakable horrors. So they open it and find the [Hero's Sword].
Nigel gets sad but Bob is bloody happy.

Now, if the party would go out of the room and then return Nigel would get his hopes up for an evil book of evil again as the chest would be back. And we don't want that do we?

-----------------------------
What you can do is this:
in the chest event you turn ON a switch called "Very Dark Cave chest2"
And then you give the chest a second page. In this page you could change the chest graphics to an open chest OR nothing. But what you need to do is to set a precondition that says "Very Dark Cave chest2" is ON.
If the precondition is TRUE - the game will show that page instead of the first one. So if you click on it again - it will display whatever you entered into the second page and not the first.

So when you enter that room again, the chest will appear open and if you click it the message "It's empty you tol" will appear. Or perhaps a face of Nigel and the text "Still no book here..."

--------------------------------------------------------------------------------------------------

Case 2. Reapeative and / or boring goons.

Our brave party ventures deeper into the Very Dark cave and happen across a strange tomb. Upon entering the room an ugly critter appear from behind the tomb and says many stupid things about his diabolic plan which ends with him ordering a large creature to attack that Frank, Bob and Nigel somehow missed when they entered the room.

Now if Frank feels that he needs to get back to town and restock Mana potions before going any deeper and then return later on - the same thing will happen again!(?) It's a real deja'vu moment.
----------------------------
This is what we'll do:
In the event(possibly an auto start event) we do the same thing as with the chest.
At the end of the event you turn a Switch ON. Perhaps called "Met goon in very dark cave"
And in the auto start event you add a second page, in this page you set a precondition to be "Met goon in very dark cave is ON".
And what do you put on this page? Absolutely nothing. Either an erase event or change it from being an auto-start.

When the party enters the room the next time, the switch will prevent the same thing from happening again. In fact, nothing will happen. Peace and joy.


_____LINE_BREAK___________________________________________

Variables and YOU!

Lots of people ask what these are and how they work. Luckily enough the game got a great event command called "Variable operations. In here you can change, set and alter the very value of the variable of choice.

Case 1. Crazy Herb

Frank, Bob and Nigel return from the Very Dark Cave and enter the Kinda Small Town.
In this town there is a person standing pretty open with strange clothing.
When the party talks to this person he will offer to make a permanent Health Boost potion for the party.
All of them agrees that this could be worth their time.
The crazy man says that he'll need 2 Red Herbs and 1 Bidoof.
The part is only carrying 1 Red herb and needs to find the rest of the items.
The party discusses this quest for a moment and Bob comes up with the idea to simply say that they brought the reagents so they can get their potion.
They do so and the crazy man asks to see if they have all the stuff.
Bob holds out the red herb and says. Here we go.
The crazy man nods, takes the herb and hands over the potion.

The day after, the crazy man realizes that he does not have the right amount of reagents to cure his sick kitten and she dies a very painful death just because the party cheated him.

----------------------------------------------
What was done was this:
In the event someone simply put a conditional branch that checked it "Red herb in possesion"

What can be done is this:
In the event, before the conditional branch add a variable operation. In this variable operation you set the value of a variable > SET EQUAL > Item > Red Herb > number held.
If the party is carrying 1 Red herb - the value of the chosen variable will become 1.
If the party have harvest 86 red herbs the value of this variable will become 86.
When you enter the conditional branch you set the condition to "Variable (the one you picked) > number : 2  > equal to or greater than".
The conditional branch will now be able to see how many red herbs the party is carrying.
In the YES / TRUE bracket we add another variable operation to see how many Bidoofs the party have(only needs to be done if it needs more than 1) and then another Conditional Branch to see if it is true.
If both statements are true / yes. Remove item Red herb 2, Bidoof 1. Add item HP boost potion 1.

So what will happen now?

When Bob says "here we have the red herb" the crazy man will say "You need more herb".
If they return with 2 herbs but no bidoof the crazy man will answer "you no have bidoof".
If they have 2 red herbs AND a bidoof the crazy man will glady take them and hand over the potion.

---------------------------------------------------------------------------------------------

Case 2. Vendor Discount

Variables are not only used to check things. It can also be used as a counter. For example how many times Frank entered the Brothel, how many times the party spent a night at the in, how many times they talked to the barmaid (talking to her 256 times will allow a secret scene, it's true!) or in this case - how many times you've shopped.

Frank, Bob and Nigel carry their newfound cash to the local market. In this market is a moustached man with a neat accent.
He says "You buy from me 10 times and I give you potion", "You buy from me 15 times, you regular and get to see my ... "special goods" "
The party feels that this is a good idea.
But after 15 different transactions they realize that they've been screwed.

-------------------------------------------------
How do you actually make this work?
Well, in the "Open shop window" you can fill in a box that says "Define custom handlers" or something.
Then under "Transaction made" you insert a variable operation, choose a variable > add > number: 1.
So every time you make a transaction the value of the variable will increase by 1.
Then you either make a conditional branch at the start of the event that checks if the value of the variable matches 15 and then 10. (NOTE: Or simply add a new page to the event)

Now when the party have made their 15 transaction the merchant will show them his special goods (expanded inventory with the Hero's Sword).

________________________________________________________________________END_LINE



So there you have it. A short introduction and some examples of switch and variable uses. I hope it helps some.
If you come up with something specific later on I'll be able to help you out though.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

Offline Eetio

  • Initiate
  • *
  • Posts: 26
Re: Help with events
« Reply #2 on: August 20, 2010, 03:47:42 AM »
yep thanks mate read it all and makes alot more sense, any idiot can understand what you put too... good context ;P
Logged

Offline A Forgotten Legend

  • Your neighborhood box of colors
  • Royal
  • *
  • Posts: 4,428
    • Website
Re: Help with events
« Reply #3 on: August 20, 2010, 04:23:43 AM »
Quote from: Prpl_Mage on August 19, 2010, 08:06:59 PM
"special goods" "
The party feels that this is a good idea.
But after 15 different transactions they realize that they've been screwed.

BAHAHAHAHAHA
Logged

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Help with events
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum