Gw Temp

Menu

Tutorial - 'Pressure Sensitive Switch' by arch_enemy

An item about RPGMaker 2000 posted on

Blurb

Simple tutorial on how to make a switch that is activated by stepping on it or pushing on object on top of it.

Body

This is my first tutorial so I'll try my best to explain.

In this tutorial I will explain how to make a switch that turns on when the hero stands on it or a object is moved on top of

it.

There will be 8 events, 4 switches, and 4 variables.

You will need knowledge of switches, variables, and forks.

For the first event which is the object that can be placed on the switch here is the coding:
Event Name: Box (or what ever object)
Graphic: set to desired
Movement type: stay still
Event Start Condition: Push Key
Position: Same Level as Hero
Animation Type: Fixed
Events Commands:
<>FORK Optn:Hero - Up Face Direct
<>Move Event...: this Event, Up
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Hero - Rt Face Direct
<>Move Event...: this Event, Right
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Hero - Dw Face Direct
<>Move Event...: this Event, Down
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Hero - Lf Face Direct
<>Move Event...: this Event, UP
<>
:ELSE Case
<>
:END Case

The Second Event will be The X and Y Coordinates for the box. This event will be in a location out of the way on the map. The

Coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>Variable Ch:[????:Box X]Set, Box X pos
<>Variable Ch:[????:Box Y]Set, Box Y pos

The Next event will be for the X coordinate of the box. Here's the coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>FORK Optn:Varbl[????:Box X]-10? (the X Coordinate on the map)
<>Change Switch:[????:Box X OK]-ON Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Box X]-9? (One less than the above)
<>Change Switch:[????:Box X OK]-OFF Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Box X]-11? (One more than the above)
<>Change Switch:[????:Box X OK]-OFF Set
<>
:ELSE Case
<>
:END Case

The Next event will be for the Y coordinate of the box. Here's the coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>FORK Optn:Varbl[????:Box Y]-10? (the Y Coordinate on the map)
<>Change Switch:[????:Box Y OK]-ON Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Box Y]-9? (One less than the above)
<>Change Switch:[????:Box Y OK]-OFF Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Box Y]-11? (One more than the above)
<>Change Switch:[????:Box Y OK]-OFF Set
<>
:ELSE Case
<>
:END Case

The Fifth Event will be The X and Y Coordinates for the Hero. This event will be in a location out of the way on the map. The

Coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>Variable Ch:[????:Hero X]Set, Hero X pos
<>Variable Ch:[????:Hero Y]Set, Hero Y pos

The Next event will be for the X coordinate for the hero. This event will be in a location out of the way on the map. Here's

the coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>FORK Optn:Varbl[????:Hero X]-10? (the X Coordinate on the map)
<>Change Switch:[????:Hero X OK]-ON Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Hero X]-9? (One less than the above)
<>Change Switch:[????:Hero X OK]-OFF Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Hero X]-11? (One more than the above)
<>Change Switch:[????:Hero X OK]-OFF Set
<>
:ELSE Case
<>
:END Case

The Next event will be for the Y coordinate For the Hero. This event will be in a location out of the way on the map. Here's

the coding:
Graphic: None
Event Start Condition: Parallel Process
Position: Below Hero
Event Commands:
<>FORK Optn:Varbl[????:Hero Y]-10? (the Y Coordinate on the map)
<>Change Switch:[????:Hero Y OK]-ON Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Hero Y]-9? (One less than the above)
<>Change Switch:[????:Hero Y OK]-OFF Set
<>
:ELSE Case
<>
:END Case
<>FORK Optn:Varbl[????:Hero Y]-11? (One more than the above)
<>Change Switch:[????:Hero Y OK]-OFF Set
<>
:ELSE Case
<>
:END Case

The Last event will be for what ever you want the switch to open or whatever. For this we'll open a door. Here is the coding:
Page One:
Graphic: Closed door
Movement type: stay still
Event Start Condition: Push Key
Position: Same Level as Hero
Animation Type: Fixed
Events Commands:
<>Messg:The door is locked.

Page Two:
Switch:????:Hero X OK
Switch:????:Hero Y OK
Graphic: Open door
Movement type: stay still
Event Start Condition: Push Key
Position: Below Hero
Animation Type: Fixed
Events Commands:
NONE

Page Three:
Switch:????:Box X OK
Switch:????:Box Y OK
Graphic: Open door
Movement type: stay still
Event Start Condition: Push Key
Position: Below Hero
Animation Type: Fixed
Events Commands:
NONE

There you have it a switch that is activated by steping on it or pushing an object on top of it.