[TUTORIAL][RM2K] EXAMINE ALMOST EVERYTHING IN YOUR GAME - FURNITURE, FLOORS, BOOKCASES, BUILDINGS, EVEN THE LANDSCAPES!

Examine almost everything in your game - Furniture, floors, bookcases, buildings, even the landscapes!

  • Mikemc
  • 08/09/2009 03:22 PM
  • 3627 views
Maker: Rm2k (maybe 2k3?)
Difficulty: Intermediate to Advanced

This tutorial will show you how to create a universal system that will allow players to examine almost everything in your game, WITHOUT littering the world with events. It will seem complicated at first but I assure you once you understand, you'll see that it's all down hill! Please let me know if I made any mistakes or methods for simplifying!

In this tutorial we will be using the following areas of Rm2k:
- PASSWORD
- CONDITION FORKS
- 7 VARIABLES *If you set it up to examine only what is directly in front of you, you only need 5 variables and no pictures.
- SHOW/ERASE PICTURE
- 3 LABELS
- TERRAIN EDITOR + TERRAIN ID
- CHIPSETS EDITOR
- 1 COMMON EVENT for every map

An asterix (*) will mark a comment and I will use open and close bracets () to mark FORK limits, example:
FORK WHATEVER HAPPENS
(
MESSAGE "BLAH" * Any settings not mentioned are assumed left as defaults
)
The map coordinates are measured from the top-left as 0,0


I have readied the following commented 'game' for your reference. Load it up and follow along!
http://members.shaw.ca/drawn2life/_other_/examine_all.rar


================================================

THE RESULT:
This system relies on getting the Terrain ID of the space you want to examine and then displaying a message or what-have-you. So if you examine the terrain marked 'Table', and you are on map 0002 (inside the old shack), then it would call the message "This old table is on it's last legs!". Whereas if you examine the 'Table' and you are on map 0001 (outside) it might say something like "It hasn't been properly weather-proofed!". The beautiful thing about this system is that you can have a readable book event sitting on a table that is activated by the Decision key, and a non-event table that is Examined by another key!

THE STEPS:
Ok, first open your Database and go to the Terrain tab. Here is where the magic happens. What you want to do is create a new terrain type for each different material in your game. As you can see I have created all the materials for our little island map. On my initial testing I had terrain types for the large bookself and rugs found on the 'Inner' tileset. Also notice that each terrain type has a 4-digit ID number - we will be using those later (without the '0's because 0001 is the same as 1)

Next, go to the ChipSets tab and select 'Lower Chip' and 'Terrain Type'. You can only set a Terrain ID for the lower tiles and not the upper ones so a more complex map may require some creativity by mixing the two layers before placement. For example a window upper tile on a stone wall lower tile will be known as a stone wall, unless the window is an event OR both the window and the wall are the same tile.

Now set your terrain types on the right to their respectful tiles in the middle. As you can see tile #10 says 'house'. Every tile that will make up a house such as walls and roof will get this designation. You can be as simple as setting all the houses to describe the same, or set groups of tiles to 'House1', 'House2' etc. You could even set the roof tiles as separate 'Red Roof', 'Blue Roof' if you wanted to be extremely specific :).

Now that we have our terrain types set up we will proceed to the 'Common Events' tab. To keep things easy we will name each event after the map it will affect, in this case 'Map0001_world'. Also set each event to 'Parallel Process'. While each Common Event will be running simultaneously, only one will be fully functional!

THE CODE:
* Here we create a fork that checks if the map we are on matches the common event. We do not want the same terrain ID to be delivering multiple messages at the same time, and all those parallel process checks would probably kill your game.

-----------------------------------------
LABEL 1
VARIABLE 0001 "MapID" Set Event Hero MapID
FORK VARIABLE 0001 "MapID", SET 1, SAME
(
GOTO LABEL 2
ELSE
GOTO LABEL 1
)

* The next line will wait for the 'Menu' button to be pressed

LABEL 2
ENTER PASSWORD into VARIABLE 0002 "Password", KEY 6, WAIT UNTIL HIT

* Now the fun parts. All of the following will sit inside the first Fork - This is our custom Menu.

FORK VARIABLE 0002 "Password", SET 6, SAME
(
LABEL 3
SHOW CHOICE "Examine"/"Call Menu"/"Nothing"
:EXAMINE:
VARIABLE 0003 "Position_X" Set Event Hero X coordinate
VARIABLE 0004 "Position_Y" Set Event Hero Y coordinate

* Here we will use a picture to show the player which directions they can examine. It's not important for the system to function but it helps show that it is waiting for user input.

SHOW PICTURE #1 "4way_arrows" position X:160 Y:120

ENTER PASSWORD into VARIABLE 0002 "Password", KEY 1-6, WAIT UNTIL HIT

* Check what direction you want to look in, including beneath you, as well as canceling the action. The +/- 1 takes your standing coordinates (0003,0004) and moves the looking square adjacent by 1.

FORK VARIABLE 0002 "Password", SET 1, SAME * Down
(
VARIABLE 0004 "Position_Y" + 1
)

FORK VARIABLE 0002 "Password", SET 2, SAME * Left
(
VARIABLE 0003 "Position_X" - 1
)

FORK VARIABLE 0002 "Password", SET 3, SAME * Right
(
VARIABLE 0003 "Position_X" + 1
)

FORK VARIABLE 0002 "Password", SET 4, SAME * Up
(
VARIABLE 0004 "Position_Y" - 1
)

* The tile you are standing on is not checked as they are the initial coordinates.

FORK VARIABLE 0002 "Password", SET 6, SAME * Pressing MENU button will cancel the looking.
(
GOTO LABEL 3
)

ERASE PICTURE #1

* Now we will get the terrain ID from the tile located at the above coordinates and place it into 0005.

CHANGE TERRAIN ID, BY VAIABLE, X = 0003 "Position_X" Y = 0004 "Position_Y", FROM VARIABLE 0005 "Terrain ID"

* And if that ID number matches our terrain...

FORK VARIABLE 0005 "Terrain ID", SET 1, SAME * Is it grass?
(
MESSAGE "Yes it is grass and it's very healthy at that!"
)

FORK VARIABLE 0005 "Terrain ID", SET 2, SAME * Is it dirt?
(
MESSAGE "This dirt is very dirty!"
)

FORK VARIABLE 0005 "Terrain ID", SET 3, SAME * Is it long grass?
(
MESSAGE "Maybe the mayor will pay me to cut this long grass!" * (cough)Secret Quest(cough)
)

* Keep going until you have your messages and/or commands for each terrain type. Remember, you can only give the Lower Layer an ID so if you want to examine a Teleporter or a door before using it, you'll need a descriptive tile underneath (unless you set up a Choice menu upon activation). Why not simply use a Choice menu? Some players may not want to constantly be asked if they REALLY want to open that door or simply look at it!

:Call Menu: * The Call Menu command is added here because we overrid it with our EXAMINE menu, remember?
CALL MENU


:Nothing:
* You can also leave this choice out and simply put an empty ADD CASE command in the Choices Menu

) * And here's the end of our first Fork! :woop:

================================================

TIPS & TRICKS:
The stone walls and roof are marked as 'House' but because the door will cover 2 tiles you could put a special wall tile behind it called 'Door Frame'. That way the player could examine the wall the door is attached to aswell! Instead of simply putting a message there, you could have a hidden key or switch that can only be found with 'Examine'.

Remember you can also exchange chipsets while on the same map. Consider having different descriptions for different times of the day by simply changing the chipset! Example: The morning dew, Afternoon shade, Cool evening breeze


- Mike

Posts

Pages: 1
Magi
Resident Terrapin
1028
I will fix your title for you when I discover the backward way RMN3 would have me take to make that change
Pages: 1