Gw Temp

Menu

Tutorial - 'Equipped Item Events' by fitz_tayo

An item about RPGMaker 2000 posted on

Blurb

A tutorial How to make events change according to what items they have equipped.

Body

Hey, this is Fitz Tayo, with his first Tutorial on Equip Item Events for RPG Maker 2000/3.

First things first, what's an Equip Item Event. Well, it is an event that changes according to an Item that is equipped or the Party is in position of. In this tutorial I will cover how to make three different types of EIEs (Equip Item Events); The Simple Way, The Slightly-less-Simple Way, and The Hard Way.

The Simple Way ?

Explanation ? This is already in the Rm2k/3 commands. It is a plain system that changes an Event according to an Item found in The Inventory.

Programming ? For this you need Open and Closed Door Graphics like in the RTP, and maybe some in between ones to add to the game. For this I am going to create an event called Door, an Item called Key, and a switch called Door Open. Just so you can follow.

Event: Door Page 1.
Graphic: Door (Closed), Stationary, Fixed Direction, Non-Continuous.
Preconditions: None.
Trigger Condition: Action Key.
Event Layer: Same as Hero.
Event Commands: <>Fork Condition: Item ? Key Possessed
<>Play Sound: Door Unlocked
<>Message: Door Unlocked!
<>Move Event: This Event, Face Right (Partially Open Graphic), Wait, Face Up (Even More Open)
<>Switch Operation: [0001 ? Door Open] ON
: Else Handler
<>Play Sound: Locked Door
<>Message: The Door is locked
<>
End
<>

Event: Door Page 2
Graphic: Door (Open), Stationary, Fixed Direction, Non-Continuous.
Preconditions: Switch ? Door Open is ON.
Trigger Condition: Action Key.
Event Layer: Below Hero.
Event Commands: None.

This basically makes the event say the door is locked if you don?t have a key, and it becomes unlocked and opens if you do have it. This is a simple method known widely by many makers, I only put it here as an example for a basic system.

The Slightly-Less-Simple Way ?

Explanation ? This is the same as before, but instead of having to have the item in The Inventory, the player needs the item equipped to activate the event, but the Item and the Character?s who can equip it are variable.

Programming ? For this you I am going to use the same Switches and Events as before but with an Equip-able Item, the item should not have any effects on the character, but it depends on the game. For this, your vocabulary section may need to be changed to suit the needs of the game.

Event: Door Page 1.
Graphic: Door (Closed), Stationary, Fixed Direction, Non-Continuous.
Preconditions: None.
Trigger Condition: Action Key.
Event Layer: Same as Hero.
Event Commands: <>Fork Condition: Character ? Key Equiped
<>Play Sound: Door Unlocked
<>Message: Door Unlocked!
<>Move Event: This Event, Face Right (Partially Open Graphic), Wait, Face Up (Even More Open)
<>Switch Operation: [0001 ? Door Open] ON
: Else Handler:
<>Fork Condition: Item ? Key Possessed
<>Message: Equip the Key!
<>
: Else Handler:
<>Play Sound: Locked Door
<>Message: The Door is locked
<>

End
<>

Event: Door Page 2
Graphic: Door (Open), Stationary, Fixed Direction, Non-Continuous.
Preconditions: Switch ? Door Open is ON.
Trigger Condition: Action Key.
Event Layer: Below Hero.
Event Commands: None.

Basically, this event list makes the door open if a certain character has the item Key equipped, will tell the player to equip the Key to open the door if the Key is in The Inventory but not equipped, and will tell the player the Door is locked if the key is not in The Inventory or equipped. A snazzy little system that can be used with many, many other ideas.

The Hard Way ?

Explanation ? This system requires the player to have the Key equipped to unlock the Door, but the Item option has its own Button that the player is required to press. This system unlocks AND relocks the door. The 1 button on the Number Pad to the Right of the Arrow keys on your key board. Note: You can change the button for your own needs.

Programming ? For this I will use two switches, a variable and ten Events. One Switch will be called, Activate Button, allocating a certain area to the opening of the door, the second switch called, Door Unlocked, to unlock the door. The variable will be called Item, and will be used for the Key input processing. One event will be the Parallel Process, which activates the 1 button, and opens the door (Add more commands if there will be more than one EIE on the page). Another Event will be the door itself; and another two will be the events either side of the door turning the placement on, making the Parallel Process Event activate when the button is pressed. The final four events turn the Area allocated Switch off, and they should surround the two that activate them. Sadly when you press the any other Number Pad button the message ?This Item cannot be used here? is displayed also, but if you remove the message all together it should be fine, but it won?t tell the player that an item cannot be used here. Also this event is slightly more complicated so I shall explain what does what in Brackets like these ( ).

Event: Parallel Process Page 1
Graphic: None.
Preconditions: None.
Trigger Condition: Parallel Process
Event Layer: Any (Usually placed in an inaccessible event square anyway)
Event Commands: <>Fork Condition: Character ? Key Equipped
<> Key Input Process: [0001: Button 1] (Only the Number Keys box and the Wait Until Key pressed boxes should be ticked)
<> Fork Condition: Variable [0001: Button 1] is 11 (11=1 on Number Pad, variable should change for different buttons)
<> Fork Condition: Switch [0001: Activate Button] is ON (To make sure you cannot unlock the door anywhere)
<> Fork Condition: Switch [0002: Door Open] is OFF (Only add this if you want it available to Relock the door)
<> Message: Unlocked the door!
<> Switch Operation: [0002: Door Open] Turn ON
<>
: Else Handler:
<>Message: Relocked Door!
<>Switch Operation: [0002: Door Open] Turn OFF (This just relocks the door if it already unlocked)
<>
End
<>
End
<>
: Else Handler: (This Else handler is from the Fork Condition: Is Button 1 variable equal to 11)
<>Message: The Item cannot be used here. (This shows up if you press any other number pad button unless you have added other button uses, it shows up if the hero is not positioned facing the door)
<> Variable Operation: [0001: Button 1] Set to -1 (This makes sure the message ?This Item cannot be used here.? Does not continuously show up, it is also -1 because none of the buttons, when pressed, set the Button variable to ? 1)
<>
End
<>
End
<>
END


That was the main event, the rest are so much simpler.

Event: Door Page 1
Graphics: Door Closed (Fixed Direction Blah, blah, blah?)
Preconditions: None
Trigger Condition: Action Button
Event Layer: Same Layer as Hero
Event Commands: <> Message: The door is locked!
<>
END

Event: Door Page 2
Graphics: Door Open
Preconditions: Switch [0002: Door Open] is ON
Trigger Condition: Touched by Hero
Event Layer: Above or Below Hero (It doesn?t matter)
Event Commands: <> Switch Operation: [0001: Activate Button] Set OFF (This makes sure you cannot close the door with the hero trapped on top of the event)
<>
END

Event: Activation Event 1
Graphics: None
Preconditions: None
Trigger Condition: Touched by hero
Event Layer: Below Hero
Event Commands: <> Fork Condition: Hero is facing up (This ensures the player is facing the event they are going to activate using an item. The Direction also changed for where the events are placed, but the hero should be facing the Event)
<>Switch Operation: [0001: Activate Button] Set to ON (This allows the Parallel process to continue on to open the door)
: End
<>
END

For other sides of the event just change the direction the Hero has to face.

Event: Deactivation Event (Depending on the map, the number of these events will change)
Graphics: None
Preconditions: None
Trigger Condition: Touched by Hero
Event Layer: Below Hero
Event Commands <> Switch Operation: [0001: Activate Button] Set to OFF (This makes sure the player does not open the door or activate the event from some random place on the map)
<>
END

Make multiple Deactivation Events to surround all Activating Events to make sure the player does no avoid deactivating the Activate Button Switch.

This event, if made correctly, will make an Item Button for use with equipped Items, but you would need to make quite a few more events that can be changed by Items to make the whole thing have a point. Having only one equip-able Item would be pointless, no? This event makes sure the player equips Items to characters and uses an extra button making your game more original.

Well that?s all for now, if you experience any problems, email me at Fitz_Tayo@hotmail.com and I?ll see what I can do to solve any problem. Um, well cya next time then. Fitz Tayo.