Tutorials:Save Point Names Tutorial

From Charas Project

(Difference between revisions)
m
m (Reverted edit of Lord Foil1212, changed back to last version by Admin)
 
(2 intermediate revisions not shown)
Line 12: Line 12:
Note: '''this code does not really work''' and is only being included for explanation<br />
Note: '''this code does not really work''' and is only being included for explanation<br />
{{code|
{{code|
 +
evntname=Don't Use This|
code=<>Show Choice: Save Game/Don't Save<br>
code=<>Show Choice: Save Game/Don't Save<br>
[Save Game] Handler<br>
[Save Game] Handler<br>
Line 31: Line 32:
Note: this code '''does''' work<br />
Note: this code '''does''' work<br />
{{code|
{{code|
 +
evntname=Save Point (Below Hero, Action Key)|
code=
code=
<> Show choices: Save Game/Don't Save<br>
<> Show choices: Save Game/Don't Save<br>
Line 46: Line 48:
{{code|
{{code|
 +
evntname=ChangeNameBack (Common Event, Parallel Process, Trigger: SAVING)|
code=
code=
<> Wait 0.5 Sec<br>
<> Wait 0.5 Sec<br>

Current revision as of 03:58, 6 September 2007

Save Point Names tutorial

Written By: SaiKar
Difficulty: **
Have you noticed that when you save games with RPGMaker2000 or 2003 the name of the saved game is the name of the first character in the party? Wouldn't it be a lot cooler if the name of the saved game was the town or dungeon the game was saved in? Sure it would! Well, this tutorial will help you set that up. I am going to explain a few things first. If you do not really care about why this works, just skip down to the coding. Okay. Now, it seems like it should be pretty easy to do this, right? You just set up some code like this and it works fine, right? Well, no. Note: this code does not really work and is only being included for explanation

RPGM Code:
Event: Don't Use This

<>Show Choice: Save Game/Don't Save
[Save Game] Handler

<>Change Hero Name: Alex's Name Town
<>Open Save Menu
<>

[Don't Save] Handler

<>

<>End
<>Change Hero Name: Alex's Name Alex

<>


This code appears to give you the choice to save, change Alex's name to "Town" (an example for this tutorial) and then change the name back after you save. If you use this in-game, it will work just fine. HOWEVER, if you try to load that saved game, Alex's Name will stay "Town" forever... or at least until you try to save again. That's bad.

Why? Because when RPGMaker loads games, all events that were running when you saved the game are no longer running. That means that the event script never gets to the point where you change the name back.

However, if you are clever, you can fix this problem. The code to make it work is as follows:

Note: this code does work

RPGM Code:
Event: Save Point (Below Hero, Action Key)

<> Show choices: Save Game/Don't Save
[Save Game] Handler

<> Change Hero Name: Alex's Name Town
<> Switch Operation [001: SAVING] ON
<> Open Save Menu
<>

[Don't Save] Handler

<>

<>End

<>


That is your save point. It turns the switch SAVING on before the game is saved. Then, you need a second event either on the same map or in a common event. Make sure that it has the trigger condition SAVING: ON (that is, the switch SAVING is ON) and is a PARALLEL PROCESS.

RPGM Code:
Event: ChangeNameBack (Common Event, Parallel Process, Trigger: SAVING)

<> Wait 0.5 Sec
<> Change Hero Name: Alex's Name Alex

<> Switch Operation [001: SAVING] OFF


That event always activates when you are saving and will activate when you load your saved game because the switch SAVING is always active when you load the game! Thus Alex's name will be switched back to Alex and everthing is good.

If you understand all that, then you are ready to put this in your game! It really helps out and gives a game a more "professional" look, and is also really useful when you are looking at your saved game files.


Potential problems:

  • If is possible, although unlikely, that the player will get into a random battle between when the name is switched to "Town" and before 0.5 seconds pass so it is switched back to "Alex". But it is only for one battle anyway and rarely happens, so do not worry about it.
  • For this to work, you need to know who the front character in the party is. In this case, it is Alex. If the player can switch their party at will, you probably want to change ALL CHARACTERS' names to "Town" and then ALL back to their proper names. A big pain really, but it *does* work.
  • Character names are somewhat limited in letters so you may need to compress the name down. "The Sanctuary of the Fire Spirit" might end up just being "Fire Sanct". But it's way better than nothing.

Personal tools