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.

Save Circle

Save Points
points_zps50e75cba.png

In RMXP it was common for save points to appear as crystals or maybe a book. All they needed was an action button trigger to open the save screen. But since RMVX and VXACE it has became possible to place event graphics under the player character. This was only possible in RMXP if the event was set "through"; but even then if the graphic was too big it would pop above the player if they were to walk a tile behind it. With the new "below character" option people started using magic circles as save points. It could function with an action button trigger, but it is much more fashionable for the circles to light up and enable saving when the player touched them and then turn off when the player walked away.

Design Issue
However, engineering the save circle to work this way can get tricky. The touch triggers work fine when the player walks onto an event, but they don't work when the player walks off an event. I've seen some pretty messy event systems to work around this. Most of the time I see people using switches and placing extra events around the save circle to determine if a player has walked away.
A better way would use conditional branches to watch for the arrow keys being pressed, which would normally mean the player is walking away. Except this has it's problems when the save circle is placed next to a wall or some solid object; if the player hit an arrow in that direction the circle would turn off while the player is still on it.
Lastly, you could rig a collision detection system by recording the event and player's X and Y positions in in-game variables and comparing them in a couple conditional branchs. But it's a lengthy process to do through the event menu, takes up a lot of variables, and not very efficient since its duplicating data and processing it every moment to check for a collision.

Solution
This can be done all on one event page, but I prefer not to have a parallel process running at all times if it doesn't need to be so it doesn't cause lag. So I have the first event page a deactivated circle graphic and a touch trigger that will turn on self switch A and play a sound effect.
The second event page, with a self switch A = on condition, has the activated circle graphic and a parallel process trigger. We'll use a conditional branch to turn off self switch A and disable saving when the player isn't over the save circle, but as long as the player is on the circle it'll remain active.
How do we do that? We'll use the last option in the conditional branch menu to write a line of script. "Scripting" sounds complicated and hard to understand to some people but this is easy to implement; even if you don't understand coding language you can just copy and paste. For the save circle to work it needs to properly detect the player's position relative to it's own. The X and Y positions for everything already exists within the game's code so all you need to do is compare:
[$game_player.x , $game_player.y] == [$game_map.events[@event_id].x , $game_map.events[@event_id].y]
In English this is asking if the player's x and y position is the same as this event's (the save circle) x and y position. Within the conditional branch you can tell how the event processes each case; stay active while sharing coordinates else turn circle off.
(click to enlarge)


Not only is this method easier to look at. But it works in a way that the event can be copy and pasted where ever and each one will work independently without needing to change anything and can be used for things like a pressure plate that must have someone standing on it or revealing a hidden path by walking under a ceiling tile.
 

Jason

Awesome Bro

I've actually got something very similar to this in my game, but I like how yours is more streamlined with the script call... good work :thumb:
 

Ares

Member

It is indeed a nice touch to the typical use of a saving point, and it looks like you have a clean and working solution to the problem!

So if I understand it right it works like this: when the player steps on the tile, the 'save' option in the menu is enabled?
Personally I'd rather pop the player right into the save screen when he steps on it, that way the player has to make less effort to save his/her game; and it becomes clear what the magic circle thing does right away, without having to explain it.

And also, thanks for pointing that vx/vxace option out, I'm going to try and implement that in my rmxp game too, now.
 
You could add another conditional branch that opens the save screen when the player presses the action button. Some people might use the circles to heal the party so having the save screen come up automatically might not be desirable. Like a normal save point is blue, but green save point also heals. Maybe a red save point warps you to another location. You can make it work however you like.
 

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