Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to make a Reflection/Mirror in RMXP!

Hey guys and gals...
This is my first tutorial ...
I programed this step by step,so there might be some bugs...
I hope you like it...
This was made on RPG XP but is easily passed to others systems...
Don't know about RMVX though...

D.Level-Easy
What do you need:
-Switches
-Variables

In this tutorial i will make a 3 Tiles mirrors with 3 Reflections...

Starting off...
1)
Set those variables...

0001-Hero-X
0002-Hero-Y
0003-Hero Face
0004-Ref. X
0005-Ref. Y

and those switches...

0001-Ref.1
0002-Ref.2
0003-Ref.3
2)
Make the Map you want your mirror to be...
The mirror will be in the Upper Wall of my example...
Make Three events with the character you want to be reflected in the mirrors
Name the events "R1" ,"R2",and "R3".
These events will be your Reflection.
So make the graphics the same of your hero and  a low level of opacity...
something between 80 or 140 would be good.

Make a precondition on this events...

Switch Ref.X On...

Being X the number of the event...

Ex:R1
Switch Ref.1 On...
The rest of this event is whatever you like.
In my case i put an action key event that sends a message when you try to "Speak" with your own reflection...

3)
Make an event like this...

First Page

preconditions:
Switch Ref.1 - ON
Parallel Process

Commands:
Variable Hero-X = Player X coordinate
Variable Hero-X = Player Y coordinate
Variable Hero Face= Player Direction
Variable Ref-X = R1 X coordinate
Variable Ref-Y = R1 Y coordinate
End
Second Page

preconditions:
Switch Ref.2 - ON
Parallel Process

Commands:
Variable Hero-X = Player X coordinate
Variable Hero-X = Player Y coordinate
Variable Hero Face= Player Direction
Variable Ref-X = R2 X coordinate
Variable Ref-Y = R2 Y coordinate
End

Third Page

preconditions:
Switch Ref.3 - ON
Parallel Process

Commands:
Variable Hero-X = Player X coordinate
Variable Hero-X = Player Y coordinate
Variable Hero Face= Player Direction
Variable Ref-X = R3 X coordinate
Variable Ref-Y = R3 Y coordinate
End
4)
Make another Event with 3 Pages...

First Page:

Preconditions:

Switch Ref.1 On
Parallel Process

Commands:

Conditional Branch:Variable [Hero Face]==2
    Move Event: [R1]:
                    Face away from Player
Else Handler
Conditional Branch:Variable [Hero Face]==4
    Move Event: [R1]:
                    Face Left
Else Handler
  Conditional Branch:Variable [Hero Face]==6
    Move Event: [R1]:
                    Face Right
Else Handler
Conditional Branch:Variable [Hero Face]==8
    Move Event: [R1]:
                  Face Player
                   
Else Handler

: End
<>
: End
<>
: End
<>
: End
<>

Conditional Branch:Variable [Hero X] == Variable [Ref.X]
   
Else Handler
Conditional Branch:Variable [Hero X] > Variable [Ref.X]
    Move Event:[R1] (ignore if Can't Move)
    <>Move Right
Else Handler
      Move Event:[R1] (ignore if Can't Move)
    <>Move Left
   
: End
<>
: End
<>

Second Page:

Preconditions:

Switch Ref.2 On
Parallel Process

Commands:

Conditional Branch:Variable [Hero Face]==2
    Move Event: [R2]:
                    Face away from Player
Else Handler
Conditional Branch:Variable [Hero Face]==4
    Move Event: [R2]:
                    Face Left
Else Handler
  Conditional Branch:Variable [Hero Face]==6
    Move Event: [R2]:
                    Face Right
Else Handler
Conditional Branch:Variable [Hero Face]==8
    Move Event: [R2]:
                  Face Player
                   
Else Handler

: End
<>
: End
<>
: End
<>
: End
<>

Conditional Branch:Variable [Hero X] == Variable [Ref.X]
   
Else Handler
Conditional Branch:Variable [Hero X] > Variable [Ref.X]
    Move Event:[R2] (ignore if Can't Move)
    <>Move Right
Else Handler
      Move Event:[R2] (ignore if Can't Move)
    <>Move Left
   
: End
<>
: End
<>

Third Page:

Preconditions:

Switch Ref.3 On
Parallel Process

Commands:

Conditional Branch:Variable [Hero Face]==2
    Move Event: [R3]:
                    Face away from Player
Else Handler
Conditional Branch:Variable [Hero Face]==4
    Move Event: [R3]:
                    Face Left
Else Handler
  Conditional Branch:Variable [Hero Face]==6
    Move Event: [R3]:
                    Face Right
Else Handler
Conditional Branch:Variable [Hero Face]==8
    Move Event: [R3]:
                  Face Player
                   
Else Handler

: End
<>
: End
<>
: End
<>
: End
<>

Conditional Branch:Variable [Hero X] == Variable [Ref.X]
   
Else Handler
Conditional Branch:Variable [Hero X] > Variable [Ref.X]
    Move Event:[R3] (ignore if Can't Move)
    <>Move Right
Else Handler
      Move Event:[R3] (ignore if Can't Move)
    <>Move Left
   
: End
<>
: End
<>
5)
Make 3 events just down the mirrors.
Put a precondition:
activate at Hero Touch...

First page is simple

Command:
Switch Ref.X On
End

Being X the number of the Reflect Event one tile up from this...

Second and third have one precondition...

Switch Ref.Y On

and

Switch Ref.Z On

Being Z and Y the numbers of the other 2 Events ...

There are no commands on those...
6)
Make an Event like this:

activate: On hero touch.


Commands

Swicth Ref.1 Off
Swicth Ref.2 Off
Swicth Ref.3 Off
Change Event Location: [R1],(The place it is suppost to be...)
Change Event Location: [R2],(The place it is suppost to be...)
Change Event Location: [R3],(The place it is suppost to be...)
End

This Event will turn off the Reflection when you're not in front of the mirror ...
Put those around the event of the part 5....
And that's it!
You now have a cool new feature for your game!
I hope you like it!
^_^

And i really hope you understand it...
because i don't know if it's very clear...

Oh well...
Enjoy!
 

mawk

Sponsor

And maybe put this into a demo so that people can check out how it works in practice? It's not totally necessary, but it'd be nice.
 
Why? When scripts exist to do this simpler? Sure, less lag, but if you're lagging for stupid eye candy...just why? Good tutorial, but why?
 
Sic Semper Tyranosaurus":3vj8d16d said:
You might want to put spoilers on this. You know.

I scrolled a lot.

Sorry for that...
I just changed it...
That was a great idea!
it makes the tuto looks way better!
:thumb:

Chimmy Ray":3vj8d16d said:
And maybe put this into a demo so that people can check out how it works in practice? It's not totally necessary, but it'd be nice.

Ok.
I will do this as fast as possible...Maybe it will be there tomorow... :thumb:
Can't use the PC after midnight at home...i'm on college now...

Mundane":3vj8d16d said:
Why? When scripts exist to do this simpler? Sure, less lag, but if you're lagging for stupid eye candy...just why? Good tutorial, but why?

Well...
I wasn't using RMXP for a while ...and i'm not good at scripts yet...
I think it might help people that aren't very good with scripts too...
Thanks for the compliment...
Speaking of which,my eyes just love some candy...^_^

I may sound like a Noob or something but i love those image effects that look useless...
When i see they working...
It makes all that time of programing worthwhile....

:thumb:

Thanks for the posts everyone!
 
Mundane":120k4t93 said:
Why? When scripts exist to do this simpler? Sure, less lag, but if you're lagging for stupid eye candy...just why? Good tutorial, but why?

What? Ugghhh

What if you only want one part of your game to have reflections, such as, for a puzzle? Must you really insert a whole script for a such a small bit?

If someone can find a way around plugging in a script, that works just as well, I say it's a good thing. Don't discourage it.
 
Venetia":2omref2s said:
Mundane":2omref2s said:
Why? When scripts exist to do this simpler? Sure, less lag, but if you're lagging for stupid eye candy...just why? Good tutorial, but why?

What? Ugghhh

What if you only want one part of your game to have reflections, such as, for a puzzle? Must you really insert a whole script for a such a small bit?

If someone can find a way around plugging in a script, that works just as well, I say it's a good thing. Don't discourage it.

Thanks...
I really appreciated that...
 

Nachos

Sponsor

I never thought of making something like this... :lol: Great tut man.

Anyway.. Just for curiosity.. Why did you put "Hero touch"?
 
nahchito":34au8c8h said:
I never thought of making something like this... :lol: Great tut man.

Anyway.. Just for curiosity.. Why did you put "Hero touch"?
Hero Touch? I think that's a command from Postality- GASP! :scream:
  -KRoP
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top