Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> [help] Managing events and switches, (and other questions about game mechanics)
zshall
post Apr 9 2012, 06:58 PM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: Developer
RM Skill: Intermediate




Hi there,

I'm working on creating some mechanics for a small game I've thought about making in RM2K3. The specific mechanic I'm trying to replicate is one of a block being dropped in water and becoming floor. http://www.youtube.com/watch?v=cisVWVvUGXo for a visual example. The block collides with water, and becomes dirt. The hero runs over the dirt, and it becomes land.

As of right now, I have a single block event that does kind of what I want...
CODE
(This is pseudocode)
PAGE 1
if switch is OFF:
    move
    get x and y coordinates
    if the tile at x and y == water:
        set switch ON

PAGE 2
precondition: switch ON
no commands, graphic is tile floor


I see the "Tile Substitution" call in the list of actions, and ideally I'd use that to replace the single tile at X and Y with floor, then destroy the event, but it seems tile substitution works for all tiles as a 'find / replace all' type of deal. Is there a plugin or a mod out there that has a "find single lower tile / replace it" or is there a way to do it without a mod?

Also, this code works nicely with one block, but for multiple blocks it would appear I would need more switches. Is there a way to do this without switches? Coming from a background in more standard programming, what I'm really looking for are object classes, such that each event has its own switches and is an instance of a definition rather than every block. Is there a mod for something like that as well?

I've been using RM2K for years off and on, and besides a few games I haven't really followed the RPG Maker scene, per se. I was still using 2K until a week ago when I learned of common events in 2K3. I'm not sure I want to make the jump to XP or VX, as I'm familiar with the 2K interface and it looks like I'd need to change a lot of graphics to port everything over, seeing as the XP tile resolution is higher.

Any help is appreciated!
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Rast
post Apr 9 2012, 11:03 PM
Post #2


Level 71
Group Icon

Group: +Gold Member
Posts: 3,273
Type: Musician
RM Skill: Advanced
Rev Points: 10




As it happens, I did something similar(in a sense) in one of my games. It was more or less walls that changed depending on a combination of switches, and it should work for this as well.

First, you'll need to make a custom Character set. Add in the water graphic you're using in this case, and make sure to put each sprite of the animation in the correct position so you can animate it. In my case I tossed a wall sprite into the top layer of the chipset(as events can use character sets and anything in the top layer of the map's chipset for a graphic), but in the case of water you'll need it animated or it won't blend in.

Moving on, put a floor tile where the water that you're dropping the block in will be. Next, make an event on that same tile with the water sprite. Make sure it's animated and set to the same level as the hero. Make a second page with a transparent sprite and set it to "Below hero". For the page's condition, it'll depend on how you're doing this.

As there's only one variable condition per page(and two switch conditions), you can't take the easy way out and just require the movable block's X/Y variables to match up. You can probably throw a conditional branch onto the block to, after each push, check if it's at the correct X/Y position and if so change a variable or switch to change the water event's page. As the second page is below the hero with no visible graphic, it'll create the effect you want and look much like the video you linked.


I can explain a bit more in detail and/or try to whip up some screenshots if needed, just let me know.


__________________________
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 02:34 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker