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 »
  • RHOE from Don Miguel's forum (NOOBS, READ HERE!)
« previous next »
  • Print
Pages: [1]

Author Topic: RHOE from Don Miguel's forum (NOOBS, READ HERE!)  (Read 3761 times)

Offline SleepAid

  • Anime made baby Jesus cry.
  • Zealot
  • *
  • Posts: 732
  • I uh... like sleeping?
RHOE from Don Miguel's forum (NOOBS, READ HERE!)
« on: April 04, 2005, 12:52:46 AM »
I'm tired of seeing people asking how to some of the most basic stuff  on here. SO, here's one of the most helpfull guides ever written. It was written by The Blob From Hell who is a regular at Don Muigel's forum.

Quote
Ok, this post will answear every question you have until you are smart enough to think for yourself.

(* to set the start party position, right click the map (when the event layer is selected) where you want it, and select "set start party position" *)

Because you are lazy and refuse to read the whole thing, it is nice and indexed so you can look for your question and then go straight to the answer.

Since this post exists, if you ask a question that is in this post, you will be yelled at.

INDEX--------------------------------------------Page 1

Page 2 - Avoid being flamed: Think for yourself

Page 3 - How do I get rm2k to work?
What's the RTP and where to I get it?
How do I fix the font?
My character is always moving to even in the sample game.
Common bugs and errors
How to rebuild your project (in case of Lucifer, or corrupt map tree)

Page 4 - How do I get someone to disappear?
How do I make a chest stop giving me stuff?
How do I make change or stop after ?

Page 5 - How do I make an intro/cut scene?
Move all vs. Wait

Page 6 - How do I get my pictures to work?
What are the picture sizes?
How do I get the right color to be transparent?
Quick tip on picture positionning.

Page 7 - What is a switch?
What is a variable?
How do I make a random event?
What is mod?
What is fork?
Making a quest

Page 8 - What is a CBS?
What is a CMS?
How do you go about creating a CBS? - General hints
Arrays, which are important for CBSs and useful for lots of other stuff too so you might as well learn at some point...

Page 9 - Some debugging tips

Page 10 - known RM2k weirdness
Some RM2k error message

Page 11 - Misc stuff
Layers, or "why is my graphics all weid looking liek teh hero is on teh wallz!"

Page 12 - Link Section

Any suggestion for this topic can be posted right after this post.

Avoid being flamed: Think for yourself-----------Page 2

Ok, so you're a newbie. You downloaded rm2k an hour ago and the only thing stopping you from making the best DBZ fan game ever is your inability to do anything. Welcome to the club. We get half a dozen of you everyday, and frankly, you all ask the same questions and we're tired of answering them over and over.

So here are some tips.
- Do not come here unless you've tried to solve the problem for at least half an hour on your own. Ideally, you shouldn't come here unless you've spent a day trying to fix it, and looking at the help file, and trying to find it on the internet, but we realize that you don't have that kind of time and patience.
- Click on the buttons before asking us what they do. You'd be surprised at what you can learn by thinking and experimenting.
- Do not title your thread "Help". Title it "How do I ?” That way, we can tell your posts apart.
- Do not insult the people who help you. This includes using the finger or angry face icon, telling people they are stupid or mean when they don't understand your question, or in general being an ***.
- Try communicating clearly. State your problem clearly. Type clearly. Use good grammar. It makes people nicer to you.
- DO NOT ASK QUESTIONS THAT ARE IN THIS POST!!!!!

Starting out-------------------------------------Page 3

How do I get RM2k to work?

Install things in the correct order. You need RM2k and the RTP. Install them in THAT ORDER (if you do this wrong, you will get an error about not being able to open the system file) without changing the install path (i.e. just click next a lot instead of looking at the options). There's also a second RTP that's big and huge. I don't recommend installing it as part of the RTP because people will hate you when you make them download your huge game.

What's the RTP and where do I get it?

Get it at the same place you got RM2k. Or search for it at www.google.com

How do I fix the font?

Go to www.google.com and look for the font patch.

My character is always moving to even in the sample game.

Unplug your joystick. Or game pad.

Common Bugs and Errors

This is the list of some of the commons Rm2k error message and how to fix the problem:

A. " Project making failure.”
This is normally caused because your project folder is read only. So take the read only off through your folder properties and apply it to all the sub folders. If that doesn't fix your problem then that probably means that Rm2k was corrupted somewhere and somehow. Only way to fix this is to reinstall.

B. " X is missing”
This means that one of your resources is missing. To fix this you ether has to erase the event using the graphic, add the resource to your RTP or project folder or finally add this in the RPG_RT.ini: FullPackageFlag=1. The FullPackageFlag=1 trick will make RM2k totally ignore any missing resources that your game has. Useful for official release but not recommended when simply debugging.

C. " blablabla\Lucifer\blablabla "
This is a corruption of the project altogether. It's caused by ether Rm2k crashing while editing the database or some weird bug while importing (don’t know if this is entirely true). To fix this refer to the “how to rebuild your project” tutorial just after this section.

D. "Invalid event name"
This little bugger is caused by making a reference to an event (through variable, call event ...) which doesn't exist on the map. You ether teleported to a new map and are trying to make a reference to an event that isn't there or you deleted the event and forgot the make the appropriate changes. Well this is simple enough to fix: delete the line that is causing the error. (submitted by BOB the clown)

E. “Map tree data missing”
This is caused by, you, doing something bad with your files outside RM2k or a corrupted map tree. Refer to the “How to rebuild your project” tutorial just below.

How to rebuild your project (this is advanced @#%$ and you don't really need to read this unless you get Lucifer or a map tree break. Skip to page 4. It's important)

I’m sure you’ve heard about the evil Lucifer or the map tree break errors that have a tendency of destroying your project. Well fear no more because The Blob as the solution to all your problems!

First to understand how to save your project from the pits of hell you’ll need to know about the files that RM2k uses.
1. RPG_RT.exe
This is the engine and you need this file to run your game. It also contains the symbol list and the splash screen that you can change if you know how.
2. RPG_RT.ini
It contains the settings that the engine (RPG_RT.exe) needs to run your game, for example: the title of your game or the FullPackageFlag.
3. Harmony.dll
This is the sound library that RM2k uses. Though it isn’t always included with the game since everyone has it and the file should never change.
4. RPG_RT.ldb
This file contains the entire database of your game. The default database can be found in your main RM2k folder under this name: “RPG_RT.ldb.dat”
To be able to use you simply have to erase the “.dat”. You can also use this to set your own default database. Just copy your own db and rename it to that. From now on every time you create a new project your new database will be copied into your project folder.
5. MAPXXXX.lmu (where the Xs represents the map ID)
This is your map. The only part of your map that isn’t included in this is its properties.
6. RPG_RT.lmt
This is the map tree where a list of all your maps and there properties is stored.
7. rpg2000.exe,
This is the maker where you create your *.ldb, *.lmt and your *.lmu files.
8. Unlha32.dll and the Unlha32.txt
I think these are used by the maker but I have no idea in what way. Anyway if this file gets corrupted just download another copy of it.

So now that you know about all the files, here’s how you can safely copy your project.
1. Create a new project.
2. Go to your old project folder and look for the map with the highest map ID. Then create that number of file in your new project
3. Copy all your maps from your old project to your new project.
4. Copy the RPG_RT.ldb from old to new.
5. If you’ve made any modifications to your RPG_RT.exe then copy this as well.
6. Copy all the resources.

Though there’s one problem that comes up with the Lucifer bug. If you follow the previous steps you will still get the same error in your new project that’s because your database is corrupted and there’s no real way to get around this. So just copy the default database and your project will be working like new.

-The Blob From Hell

Better advice: BACK UP YOUR GAME OFTEN!

-monika


Paging and switches------------------------------Page 4

How do I get someone to disappear?
How do I make a chest stop giving me stuff?
How do I make change or stop after ?

::yank out hair:: Thank you for coming here instead of asking this. We get this question like 5 times a day.

The specific answer:

As an example, I'm going to answer the getting someone to disappear question. The chest and other variations of the question are explained farther down.

1. Ok... so you've coded in a bunch of things that the person should do. Now you want him to disappear. AT THE END OF THE PERSON'S CODE, click the "change switch" button, click the [...], pick an empty switch, give it a name, and turn it on.

2. At the top of the event page, click "new page". This should add a second page to the event.

3. On the left of the second page, check the box next to "switch", click the [...], and select the switch you used in part 1.

4. Delete the graphic on the second page, and set it to over hero or under hero.

The generic answer:

There are 5 or 6 common questions that have this same answer, and dozens other that you will have if you do not learn this NOW. To make it easy, I'm going to answer all these questions in one fell swoop.

You want to happen in after happens in . (In many cases, Event #2 and Event #1 are the same.)
Example: You want to happen in after happens in .

For this, you need to understand paging and switches.

I'll start with switches:

You know that thing that you use to turn on and off your light? That's a switch. It can be on or off. You can turn it off, turn it on, or "toggle" it (toggle: to change from off to on or from on to off). There are a lot of switches in the game. They all start as "off" and none of them have names.

When you see something that looks like this - Switch[_________][...], you can click on the [...] to choose a switch and give it a name. Remember that.

On to pages:

An event can have pages. When it starts to run, it looks at all the different pages, starting at the BACK and does the first one it can do. Remember that.

To make a new page, click the "new page" button.

HOW TO PUT IT ALL TOGETHER!!!!

Ok, in , you have the code for . After that code, add a "Change Switch" command. In the "Change Switch" command, pick an unused switch, name it, and turn it on.

In , you now add a new page. On the left of this second page, you see something that lists "Event Conditions". Check the first box next to "Switch", and select your switch. Put on this second page.

Intro/cut scene------------------------------Page 5

How do I make an intro/cut scene?

Well this all begins with an Auto start event. Since the auto start will be the first thing executed when you enter a map you'll have to create one and put all your cut scene movement, speech, special effect... in one of those.

Now if you leave like that first the event will begin as soon as you enter the map (which is good in the case of intros but bad in cut scene) and it will repeat itself endlessly. But good thing you read the above post because that explained how to stop the infinite loop.

Now for the next problem: “What if I don't want my event to start just after the hero enters the map?”
Well the answer is easy! On the first page of your event simply put a switch as its condition. Now all you have to do is flip the switch whenever you’re ready to get things working. Tada! You got a brand new cut scene!

If you do not want your hero visible in the cut scene, either (and this is important) make your hero invisible by changing his graphics, or have an invisible hero (a "dummy" hero) and make the party consist of him.

Hints:

1. You can make text do stuff other than just show up and go away when the person hits enter. I won't go over this here. It's in the help file. Click the help button in the message dialogue.

2. Move events don't happen all at once. They start, and then continue in the background. Solutions? Use a wait command or the move all command...

3. Battle animations make good special effects.

Move All vs. Wait

Move all is a special event command that must follow a Move Event command, but need not immediately follow the Move Event. In its simplest use, we can have the following:

                                                     
<>Move Event: hero; up, down, left, right
<>Move All


Normally, the hero would move up and continue moving up and until he encounters an obstacle, then he will move down and so on. By placing a Move All after the Move Event, the hero will move in the designated manner.

Move all can follow two ore more Move Event commands as well. Please, consider the following:

                                                     
<>Move Event: hero; up, up, up
<>Move Event: dog; down, down, down
<>Move Event: man1; wait, right, down, down, down, down
<>Move All


In this situation, all three Move Event commands will execute at the same time. So, the hero will move up and the dog will move down to meet the hero, while the man waits for one step, moves right and then down, then runs down three more steps while the hero and dog wait for him to catch up.

Lastly, other events can exist between Move Event and Move All. For example:

                                                     
<>Move Event: hero; start jump, end jump, change graphic blink1, change graphic Chara01
<>Show Face Graphic: Hero1
<>Show Message: Wow! You startled me!
<>Move All


Now, the Move Event will execute and the message will appear at the same time; however, all other event commands will pause until the Move Event finishes. If we want the Show Message to appear after the hero jumps, the Move All would go before the Show Message.

In summary, a Move Event command should generally be followed by a Move All command. Commands between the Move Event and Move All will execute at the same time as the Move All, while commands after the Move All won't execute until after the Move Event command finishes.

- Leimagnuschan (I hope I got that right...)

Now I'll just make a quick comparison to the wait command. Unlink move all, with the wait command you have to calculate the time that the movement will take. If memory serves, it's somewhere around 0.6 secs for each step at normal speed and frequency.
Here's what the previous coding would look like with a wait instead of a move all command:

                                                     
<>Move Event: hero; up, down, left, right
<>wait 2.4 secs

                                                     
<>Move Event: hero; up, up, up
<>Move Event: dog; down, down, down
<>Move Event: man1; wait, right, down, down, down, down
<>wait 3.6 secs


                                                     
<>Move Event: hero; start jump, end jump, change graphic blink1, change graphic Chara01
<>Show Face Graphic: Hero1
<>Show Message: Wow! You startled me!
<>wait 0.0 secs


The numbers given may not be totally right but you get the idea. Personally I used to be able to tell almost exactly the time needed for the wait command but that takes experience.

Anyway in a more practical matter, if you have simple move and commands then it might be better to simply use move all but the more your events get complex the more your code should tend toward the wait function. For example if you'd make 2 characters and once in a while you'd want a message to pop up then a wait command might do a better job then having to do a bunch of Move event, show message, move all, Move event, show message, move all...

In conclusion, it all depends on what you’re the most comfortable with. SO use your brain and think of what would fit best in your code.

- The blob from hell

P.S. We need to give a line of silence to our dear Lei who was so nice as to show us the holiness of move all:

There, now were all happy :)

Pictures------------------------------Page 6

How do I get my pictures to work?
What is the picture size?
How do I get the right color to be transparent?
Quick tip on picture positionning.

In this section we won't be talking about the RM2k events for handling pictures but the resources pictures.

In order for your picture to work, it must be set to 8bit (256 colors) and must respect the various resource type limitations.
This page will help you in formatting correctly some of your pictures (and ripping some of them at will) www.angelfire.com/anime3/.../snesripz/
Now there's 2 ways to add your new resource to your RTP. The first way is to simply use the import button in RM2k. The other is to add them manually.

The Rm2k way:
Simply open Rm2k then click on the import/export button located beside the database icon in the toolbar. Next select the correct folder to import your resource too. Then click import and select the correct graphic. Now there should be a new window that pops up. Click on the color you want to be transparent and then click ok.

The Manual way:
Here you must get a program like charamucker or Idraw. You need to be able to view the palette the picture uses. Now once you've got it open, the top left corner of your palette is defined as the transparent color for RM2k. Fill in what you want to be transparent in your picture with the color and then place the picture in the folder you want.


Now here's the different file sizes with there respective tile size. A little addition from CDH.

Having troubles importing graphics onto RM2k?
Here are some things to know.
All graphics must be 256 colors, no more, no less.
The following dimensions are in PIXELS.

*Backdrops must be 320x160.
*Battle animations are 480x480 with the animation being 96x96.
*Char sets must be 288x256 and the sprite must fit into a box of 24x32.
*Chipsets are 480x256 and each chip is 16x16.
*Face sets are 192x192 and each face must fit into a box of 48x48.
*Game Over and Title screens are both 320x240.
*Pictures and panoramas are 640x480.
*Monsters are 320x160.
*Systems are 160x80, last but not least.

One last thing, you have to use either .png or Rm2k's own .xyz to import, other extensions don't work. (.bmp works only if you use the importer.)

Quick tip on positioning pictures

If you want to know where to display your picture on the screen all you have to do is get the scene X/Y coordinates (Yes, it's a very bad translation) and add 8 to these numbers to make your picture nice and centered.
If for some reason you want to convert some event coordinates into pixel coordinates all you have to know is that each tile is 16 pixels large. So all you need to do is multiply your event coordinate by 16 and there you go!

happy numbers------------------------------Page 7

What is a switch?

Switches are down right easy to use and understand.
They can only be ON or OFF.
Now that you know you can mix them with forks or event starting condition to get some things accomplished. An example of this can be found on page 4.

What is a variable?

Variables are a tad more complicated, but if you have ever done algebra then you have already used variables! (Yes you’re that smart!)
Just think a variable as being a letter. Let's say "a"
You can make "a" become whatever you want.
Let’s say I want "a" to be 500
Then "a" set 500
"a" is now equal to 500
Now let's say I want to divide "a" in 2
So "a" / 2
Now "a" is equal to 250
Now let's say I have mister "b" waiting on the side. And I want him to be a random number. Between 5 and 10
So rand "b" 5 to 10
So now "b" is equal to 6 which was randomly chosen by the computer.
Well now I want to add "b" to "a"
So I so "a" + "b"
"a" will now be equal to 256.
The pure and simple magic of numbers :)
How do I make a random event?

1. use set variable, random, 1 to number of possibilities
2. use a fork or multiple pages.

What is mod?

Quick definition:
"Mod: The remainder left over when variable A is divided by variable B, which replaces the value of variable A"
MODulus operation gives you the remainder of a division problem
Take oh say 143 divided by ( / ) 6
143 / 6
Well that equals...
23.83 3
But the remainder is... 5
23 * 6 = 138
143 - 138 = 5
so...
if Varb A = 143
if Varb B = 6
then A mod B = 5
capiche?

Probably not, so let’s make a more practical example. Let's say we have a variable that holds the Hp of someone and for some reason we want to extract each decimal for display. Here's how you'd go about to do this:
Let’s say variable 0001 is equal to 123456:
123456 mod 10 = 6
(123456 / 10) mod 10 = 5
(123456 / 100) mod 10 = 4
(123456 / 1000) mod 10 = 3
(123456 / 10000) mod 10 = 2
(123456 / 100000) mod 10 = 1

What is fork?

Fork is THE basic programming structure. It lets you pick from two different paths, like a fork in the road.

Say you want an NPC to say "you suck!" if the variable "score" is less than 3, or "kick ***!" otherwise.

In standard pseudocode, this looks like (and pay attention, because if we write it like this, we don't want to have to explain ourselves):

if score < 3
<>message "you suck!"
else
<>message "kick ***!"

In rm2k, you do this:

1. Choose the "fork conditions" command on page three of the event commands.
2. select "variable", choose the variable "score", choose "set" and put in 3, and then select "below".
3. Make sure "Add ELSE Case" is selected. Press enter.
4. Enter the messages in the correct parts of the fork.

== Quests in Rm2k - using variables ==
by Vitenka

-- First, plan your quest. --

I can't stress this enough. Before you start creating any events, plan what you want to have them do. The example I am using here is terrible - but because it is simple, I'm sticking with it. Your quest will be a lot more interesting.

This example quest is pretty simple. Get a mission from the king, go to the cave of doom, kill the monster of doom, get the shiny-thing (of doom?) from the chest behind the monster and then go back to the king for his reward.



-- Secondly, give each step a number. --

This is more important if you have branching quests, and quests which interlock:
Leave gaps in the numbers

This is so that it is easier to add extra steps in between existing steps later (For example, maybe you want to have to get a special sword after the king tells you the quest but before you fight the monster.)

So don't just number the steps 1,2,3 etc.

What is a 'step' that you should number? Any time that the player could go get a cup of tea is a time that you need to have a step. Even if you are disabling saving, your game still needs to know what has been done.

You don't have to number everything - just things that the player has to do (or, for optional side-quests might choose to do) that have something to do with the quest.

Also - you number states. So "After the king has given the player a quest" is a sensible state, but "The king is giving the player his quest" is not. (For this example, anyway. It is quite possible to have to talk to the king multiple times to get him to tell you the whole story - and then you WOULD need intermediate states)

So, for our example quest, we will number it:
0 - Not started the quest. (It is easiest to always use zero for this, since all variables have zero in them until you use them)
10 - Got the quest from king
20 - Gone into the cave
30 - Killed the monster
40 - Got the thing from the chest
9999 - All finished. (Every quest needs something to say 'done' - some quests may need an extra value for 'you failed and you cannot retry')

You'll want to write your state numbers down on a bit of paper or in a text file or something, so that later you can work out why an event is talking about '40'.



-- Choose a variable for the quest state --

Any old variable will do - it just has to not be being used by anything else at any time when you could interact with the quest.

However, it keeps things a bit more organised if you keep all your quest variables together.



-- Now, each step of the quest needs to respond to this variable --

You'll need to do something like this for everything that knows about the quest - every villager and every talking tree - and of course the king and the cave and the monster and the chest.

For all the onlookers, the code is pretty simple. You have a fork, and if the variable is zero then the hero hasn't even heard about the quest yet, so you maybe talk about it. If it's 30 or more then you can sing the heroes praises, because he's done the deed (or at lest mostly has, the villagers only care about the monster being dead, right?) and otherwise say things like "Thank you for promising to help us. Now hurry up."

Now, the cave, the monster and the chest are the second simplest types of quest object. They are single step things.
First they check to see if the state is right (cave won't let you in unless it is 10, monster won't fight you unless it is 20, chest won't open - and maybe even calls forth the monster unless it is 30) then if they do interact with you, they advance the variable one step, setting it to 20, 30 and 40 as appropriate.

Lastly, and with greatest complexity, the king. He is both your quest giver, and the guy who gives you the reward at the end.

He probably needs a different speech for every step of the quest (0 "Great hero, we have a problem!" 10 "I've told you what to do, do you need reminding?" 20 "Yes, THAT cave. now fight the monster!" 30 "Well done. Where's the trinket I asked for?" 40 "All hail the conquering blah blah blah here is your reward" and 9999 "Thank you, come again.")

He also needs to update the quest variable. From 0, when he gives you the quest, he needs to set it to 10 - and from 40 he needs to give you your reward and set it to 9999.



-- Isn't this Overkill? --

Well, yes. For this stupid example, it is. You can do the same thing with switches.

But when you have a ten step quest, with four different branches, it can be very useful to have this more structured approach to the storyline.



--- Advanced tip for horrible branches --

Heh. Poor advanced person. Well, for starters, draw a diagram. A bubble for each step and arrows showing what you have to do to get from one step to another can really help you sort it out in your mind.

Secondly, you should probably set up most of the branches as separate quests. Then the main branch can have steps like "About to start the subquests" and "Has done enough sub-quests"

However, if you still find that your quest is getting too complicated, here is a trick that can help:

Create a global event which has three variables associated with it.
To use this event, you put the number of the quest variable into the first one, the step you want to compare to in the second one, and then you call the result and look at the contents of the third variable. If it's -9999 then that quest hasn't been started yet, if it's 9999 then that quest has completed - otherwise the number is -1 if the quest is at a step before the step you are asking about, and +1 if it is after it.

You'll have to create this event yourself, but it will be something like: "If step is from 50 to 90" then it's BEFORE step 100, but so are steps 600 to 700" - to deal with these horrible branches. Putting it in a separate event helps keep all your villagers simpler to maintain.



CBS/CMS------------------------------Page 8

What is a CBS?
What is a CMS?
How do you go about creating a CBS?

Well frankly this is the most annoying question of all, since there's no real practical answer for that and here's why:

C : custom
B : battle
S : System

C : custom
M : menu
S : system

You see custom means that's it will be different for each system. The best thing you can do to learn a CBS is to:

1. Learn all your RM2k functions (you will most likely be using almost all of them)
2. Get some experience by doing various custom systems (mini games and such).
3. Get thinking! This will be the best way to learn, and to get something going.

Don't worry if it doesn't work at first! It took my 3 tries to get my first CBS working correctly and flawlessly and up to recently I was making my fourth edition. So trial and error will be your friend! Also planning ahead never hurts!

But don not despair you young newbie! Here's a little Tutorial that will start you in the right direction. If there's anything that you don't understand then you’re not ready to make a CBS. I suggest you go back to step one. If you’re not able to continue from where my Tutorial stops then I suggest you go to step 2.

The CBS basic


If you tear down just about every CBS out there (ABS excluded) and only leave the essential you'll notice that it's a simple tree of menus. So making a CBS is no harder then making menus which is very simple itself.

For example, a BoF CBS start with a menu at the beginning prompting the user for the series of command to execute. You'll have a series of menus directing you toward what you want. Then after configuring everyone's action, these are stored in variables (may also be done with array). Then the rest of the engine is simply executing the array/list of action demanded by the user. Which is no harder then forks and call event.

To make a simple menu you'll have to start knowing the enter password function (you can always live with a show choice menu but they're not as good looking). Here's a basic one.

In an Auto Start event (switch 001 as starting condition):

                                                     
<> Enter password ( var 001) all keys enabled, wait until input
<> fork ( var 001 == 1)
  <> var 002 - 1
<> end case
<> Fork (var 001 == 4)
  <> var 002 + 1
<>end case
<>Fork (var 001 == 5)
  <> Fork ( var 002 == 1 )
    <> comment : insert first option here
    <> goto label 1
  <> end case
  <> Fork ( var 002 == 2 )
    <> comment: insert second option here
    <> goto label 1
  <> end case
  <> Fork ( var 002 == 3 )
    <> comment: insert third option here
    <> goto label 1
  <> end case
<> end case
<> label 1


Quick explanation. This code should be placed in some kind of loop (auto start event that doesn't turn off, Parallel process, cycle...) so that it repeats till it should quit. Now the code starts off with an enter password to get a selection and the next forks that checks the password variable are to check for selection. Here's what each do:
-the first 2 are to change the position of the cursor within the menu. In other words, your menu should have a variable that holds the cursor position (which will be later translated into X/Y coordinates when it's time to show the picture). This variable is incremented and decremented as the cursor moves around the menu. It is also very important that you have some forks to know if the cursor it out of bounds.
-The next fork is for when a selection is made. The first thing it does is check the position variable, which indicates toward what menu item it is pointing 2, then performs the appropriate action.
That's it! It's no more complicated then that!


Now you'll also have to make a function to show your pictures for your menu. There are many ways of doing this and it really depends on your coding style so I'll leave that job up to you to figure out. CBS making is all about thinking anyway...

And one last thing:
Put some comments in your codes or when you go back to it and you see this huge blob of lines you'll make yourself want cry...

Arrays, again advanced stuff. Not for the first time reader, but here in case you need to know.

Say you have 5 heroes and you need to store their HP and their MP and their Max HP and Max MP. This can be expanded for enemies and such.

For this you need 4 arrays of size 5.

Allocate variables 101-105, 106-110, 111-115, and 116-120 as these arrays.

Basically:

101 - HP of hero 1
102 - HP of hero 2
...
105 - HP of hero 5
106 - MP of hero 1
...
111 - Max HP of hero 1
...
116 - Max MP of hero 1
...

Easy enough.

Now set two variables aside as pointers. The first holds the hero index. If you're working with hero 3, this is "3". I'll call it "AIndex"

The second is used to actually access the array. I'll call it Index.

Say you want to access the HP of the hero whose value is currently being held in AIndex. (for our example, this is "3", but it could be anything from 1 to 5.)

Set Index to 100, and then add AIndex to it. 100+3 = 103, which is the variable that holds the HP of hero 3.

For the other arrays, do the same.

100 + AIndex = HP of hero AIndex
105 + AIndex = MP of hero AIndex
110 + AIndex = Max HP of hero AIndex
115 + AIndex = Max MP of hero AIndex

And in case you didn't know, if you now set "change variable - variable no. Index" (variable no. is the third option); you can change the variables in question.

You should be able to figure out the rest yourself. How exactly you work it depends on exactly what you're doing.

- monika the great

Debugging------------------------------Page 9
Tips on debugging.

I'm here to teach you about some very useful debugging tips that will probably save you from baldness. This is probably your first step toward not ever asking for help.
First I’d like to say that even if this tutorial was written for RM2k it can still be applied in most parts to any other maker or programming language that you might be using. You just need to use your brain a little to adapt them.

First you need to know about the special keys that RM2k uses in test mode.
F4- toggles between full screen and window mode
F5- toggles between big window and small window (must be in window mode)
F9- Switch/Variable menu (only available in test play)
F12- Returns to titles screen (only available in test play)
Ctrl- Walk through everything and ignores on hero touch events (also avoids the default random encounter system)
Shift- Instant text (only available in test play)

This is normally the most direct ways to your problem. For example if you’re wondering why your event isn’t doing anything. Press F9 when it should and you’ll probably realize that the switch isn’t ON. Quick trip to the event that was supposed to triggering it and you’re done!

Hopefully that will be the worst of it. But as we all no, it won’t always be limited to that. Your brain is quite smart when it comes to screwing up your code. So here are some techniques that will help you localize the error:

1. Make sure that you’re using your commands correctly. This can be fixed with a quick tour to the help file.

2. Another way of knowing if your event is starting and is not totally being overlooked, you can stuff a simple show message at the very beginning of the event. If the message pops up then the event is being triggered correctly, if not then I suggest checking your starting condition among other thing. This trick can also be used after forks or things like that to verify if portions of the code are being read correctly.
For other makers, simply writing a message or drawing a special something on screen can act as an indication.

3. F9 can be quite useful to see what happens to your variable and switches. You can easily check if they were properly set or what weirdness happened to them. It will help you understand some problems when doing big custom stuff like a CBS.
Another way to check multiple variables at any given time is to simply put an empty message which will act like a breakpoint in your code. When the message pops up, simply press F9 and check the status of all your variables.
If you’re using other makers you can use the same trick by simply outputting your variables on the screen or using some wait command to act as your break point.

5. Deleting portions of coding can be useful sometime to help you localize the problem. If you’re too scared of deleting a piece of code then you can use message box to separate portions of code. To use the message effectively you put one at the beginning of the coding you want to check and one at the end. This can help you pinpoint the area where some error message might come up or other bad things

4. If absolutely nothing is working and you've checked every single parcel of coding about a billion time, then the answer resides in the most stupid and little thing. It might sound a bit too simple, but I've got enough experience to say it's true and will be true on whatever platform you decide to use. But the previous tip might help you in locating exactly that little bugger.

Well there we go. Now you should be able to easily find the most common errors that you might get while you’re coding those systems of yours. Good luck and I hope you still have hairs ;)

Weirdness------------------------------Page 10

Here's a list of the things you have to watch out while making your project. One of these can get you stuck for days of endless hair yanking and never find the problem until you decide to try something stupid... Unfortunately that stupid thing is always the last thing you try and it always ends up working. Nothing to make you look smart.
Also there will be a little list of known bugs or bad thing the game does and the how to fix.

1. While using set Event ID remembers that if 2 events are in the same case RM2k will choose the one with the highest ID.

2. If you’re using an older version of RM2k then you'd have noticed in the change health that there's a case labeled: Impossible death. Well that case means: Possible death. So to make someone have 1 Hp then simply decreases its life by 999 and don't check that case.

3. When an event is moving around, at the very beginning of the step from the case he is in Rm2k will automatically change its value to the next case. So this might explain why sometimes your "On hero touch" event seems to be triggering even if that event is still one case from your hero.

4. Clear Timer (Delete Event in Emperor Evil’s version) will immediately delete an event and all of its coding until the hero leaves the map if that event is a Parallel Process. If the event is an Auto start event, Clear Timer will delete that event and all of its coding after all commands fire until the hero leaves the map. The same holds true for Push Key, On Hero Touch and On Touch (Event, Hero) except when the coding has a Cycle or Label loop, which will continue to run even after the event has been deleted.

P.S. if this definition is incorrect go complain to lei.

5. The enter hero name function. If you have ever tested it you'll notice that it's pure gibberish and that you can't even exit from the dam thing! But before you ask, yes there is a patch. You need to go download the Italian RPG_RT.exe.
Now there are 2 known versions to me. The first one that was released worked correctly at first glance. Each time you typed a letter in it would appear in its respective case. Although once you actually looked at the name you'd notice that it has space every other letter. This is due to the Japanese font taking more places then the English font.
Now that problem was fixed in the second release. Now every other letter you type will appear alone then the next one will appear alongside to it. Though one word of warning: When you erase a case make sure you erase twice or you will only be erasing one of the letters.

6. When the event conditions (switch, variable, timer. and so on) are met on several event pages, the event that will happen is of the highest page number in which the requirements are met. - rm2kguy

misc.------------------------------Page 11

Bits of wisdom by the RM2k forum people. (this grows and shrinks as stuff gets added and then put into relevant sections)

Layers (from top to bottom most)
1- Movies
2- Pictures ranking from 20 (topmost) to 1
3- Battle animation
4- Event above hero then the slip through version*
5- Event same level as hero then the slip through version*
6- Event below hero then the slip through version*
7- Second layer of chipset (ranking from star (topmost) to X)
8- First layer of chipset (ranking from star (topmost) to X)
9- Panoramas

* If 2 event overlap the one on top will be determine by the ID (not sure how yet)

-The Blob from Hell
Logged

Offline Ace of Spades

  • Photobucket</li>
								<li class=Leader
  • *
  • Posts: 2,137
(No subject)
« Reply #1 on: April 04, 2005, 12:56:54 AM »
This should DEFINATELY be stickied. Unless of course it's already here somewhere...XD
Logged
Photobucket - Video and Image Hosting

Offline MSlash67

  • Professional Internet Dwarf
  • Zealot
  • *
  • Posts: 502
  • Back in my day...
    • sprngr.me
(No subject)
« Reply #2 on: April 04, 2005, 01:14:22 AM »
:bend: Thank You  The Blob from Hell for writing this, and thanks Shino for posting it here..maybe this'll keep down the n00bish questions for a while..
Logged

Offline VahnGrave

  • Behind the Wall of Sleep
  • Zealot
  • *
  • Posts: 599
(No subject)
« Reply #3 on: April 04, 2005, 03:00:26 AM »
Sticky this please.
Logged
Glen Benton is a pedophile.

Offline Kijuki_Magazaki

  • Member
  • Exemplar
  • *
  • Posts: 1,966
(No subject)
« Reply #4 on: April 04, 2005, 02:05:01 PM »
it's important alright. Sticked for thr time beign.
Logged

Offline Iceman50046

  • Member
  • Initiate
  • *
  • Posts: 7
Thanks
« Reply #5 on: January 18, 2008, 07:41:31 AM »
Thanks for this post it has helped alot but i have one more thing that might be added. How do you change the graphics on the pictures and things to be supported. like how do you change color depth and picture size :hi:
Logged

Offline A Forgotten Legend

  • Your neighborhood box of colors
  • Royal
  • *
  • Posts: 4,428
    • Website
(No subject)
« Reply #6 on: January 20, 2008, 02:44:02 AM »
That was a 2+ year kick!


Anyway, you use a program like photoshop or ultimate paint, and save it with 256 colors.  I think vidian can tell you how if you reply in the topic I made that had the invalid image size thing.
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #7 on: January 20, 2008, 03:13:41 PM »
Err yeah, huge kick there... Anyway, since this is technically a 'stickied' topic, I won't do do anything about it. But yeah, great thread, stickied, read it if you're new to rpg maker.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

Offline Linkizcool

  • Doesn't exist for official purposes.
  • Exemplar
  • *
  • Posts: 1,290
  • I am Canadian.
(No subject)
« Reply #8 on: February 09, 2008, 02:04:29 AM »
Uhh dont mean to topic kick....but why is it unstickied all of a sudden?
Logged

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • RHOE from Don Miguel's forum (NOOBS, READ HERE!)
 

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