Bookmark RPG RPG Revolution! RPG RPG Revolution RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > Tutorials > RPG Maker XP > Traps with random chance + AGI modifier

Traps with random chance + AGI modifier


I had an idea today about two chests, one, a simple chest, contained an amount of gold. The second, a fancy chest, was trapped. In this tutorial I will show how to make that trapped chest. Put all the events listed below on the trapped chest or object.

Have the chest open, if its not a chest, then skip this next step.
@>Set Move Route: This Event
: :$>Turn Left
: :$>Wait: 4 Frame(s)
: :$>Turn Right
: :$>Wait: 4 Frame(s)
: :$>Turn Up
: :$>Wait: 4 Frame(s)

Once it looks like that, create a variable, call it whatever, but for the purposes of this tutorial, it will be called AvoidTrap. Use the control variables function, select AvoidTrap, and look down set it to random (1...100). It should look like this:

@>Control Variables: [####: AvoidTrap] = Random No. (1...100)

Now that you've had the random chance set up, let's set the AGI modifier. It will be called "HerosAGIMod" for the purposes of this tutorial.

@>Control Variables: [####: HerosAGIMod] = [Actor Name]'s AGI
@>Control Variables: [####: HerosAGIMod] /= 5

This sets the modification to 1/5 of the actor's AGI. I recommend the first actor to be the one that opens the chest ((s)he is the "leader" of the group, anyway).
Now that you've set the modifier, let's do something with it. For the purposes of this tutorial, I will have the AGI Modifier subtracted from AvoidTrap, because I want it so that if you roll lower than the set amount, you avoid the trap.

@>Control Variables: [####: AvoidTrap] -= [###: HerosAGIMod]
@>Conditional Branch: Variable [####: AvoidTrap] <= 25
@>Set Move Route: Player
: :$>Change Speed: 6
: :$>1 Step Backward
: :$>1 Step Backward
: :$>Change Speed: 4
@>Show Animation: This Event, [Explosion 1]
@>Wait for Move's Completion
@>Text: (You successfully avoided the trap!)
@>
: Else
@>Show Animation: This Event, [Explosion 1]
@>Change HP: Entire Party, -500
@>Text: (You failed to avoid the trap! Your entire
: : party has suffered 500 damage!)
@>
: Branch End
@>Text: (You failed to avoid the chest!)

If you wish the player not to be able to open the other chest (if there is one), use this command:

@>Control Switches: [####: ChestChosen] = ON

If not, simply add this command:

@>Control Self Switch: A = ON

Now create a second page, with the graphic as the open graphic (or activated), and set the conditions to Switch
[####: ChestChosen] = ON
and/or
Self Switch A = ON

For the other chest, on the first page, give the player whatever he deserves for not being greedy and dealing 500 damage to his whole party, and on the second page do the same as listed in the paragraph before this, if there is another chest.

And there you have it, a trapped whatever for you to get severely damaged from.

- Xarak 
Details
Tutorial: Traps with random chance + AGI modifier
Date Listed: 2008-08-12
Author: Xarak
Total Hits: 365


Embed
Short URL:

HTML:

BB Code:



RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal