How do I make an inn in which you can also save the game?

From OHRRPGCE-Wiki
Jump to navigation Jump to search

In RPGs that don't just let you save everywhere, it's common (though by no means universal) for inns to provide the ability to save the game. There are various ways to provide this feature in your game, ranging from easy to complicated.

Place a save point in the inn[edit]

The easiest option is to simply place a save point in the inn. This is a very straightforward method that's used in many commercial RPGs.

Use shop menu items[edit]

In some cases you may not want to put a separate save point in your inn. Maybe it's too crowded inside. Maybe your inn is just an NPC on the map and doesn't actually have an interior that the heroes can enter. Maybe you just don't want to. Fear not! You can make a shop that offers the Inn and Save functions in one convenient package. The process is actually very similar to creating a save point.

From the main menu pick Edit Shops. In the shop editor, make a new shop and name it "Inn" or something similar. Now pick Select Shop Menu Items and enable Inn and Save, and make sure everything else is disabled. Back out to the shop editor, and set the Inn Price to whatever you'd like. Now, have your NPC activate this shop. Ta-da! You have an Inn where you can also Save.

Prompt to save when staying at the inn[edit]

In some games, simply healing your characters at the inn causes the save menu to appear. (This can be a good method of helping the player not forget to save!) This will involve a little bit of plotscripting, but don't worry! It's still pretty simple.

When the player uses an inn from a shop, you have the ability to automatically run an inn script. We'll be taking advantage of this to have the inn script bring up the save menu.

Add a plotscript to your game to use as your inn script. All it really has to do is run the save menu command, so it can be as simple as this:

plotscript, save at inn, begin
 save menu
end

Now, make an "inn shop" like in the previous example, but when you set the Inn Price, also set the Inn Script to run the "save at inn" script. Now, when the player stays at this inn, they'll also be prompted to save. Neat, right?

Prompt to save, and also do other stuff, when staying at the inn[edit]

"That's all well and good, but I want to have a scripted scene when the player uses an inn, and I want the save menu to appear before the cutscene, but I don't want the cutscene to play again when the player loads the saved game!" Wow, aren't we picky, imaginary question asker! Well, as a matter of fact, we CAN do that. It is a little more complicated, though, and will force us to abandon our inn-shop in favor of just making our own menu.

First of all, you're going to have to create a longer plotscript. It should look something like this:

plotscript, save at inn, inn price, begin
  
  # Offer the player the option to stay at the inn.
  # The "skip fade" argument for the inn screen command is set to true, on the
  # assumption that you don't want the screen to fade in and out before your
  # cutscene plays. If you do, you can change that.
  if (inn screen (inn price, true) then, begin
    # The player stayed at the inn. Now, prompt the player to save, but don't
    # actually save yet. Instead, just remember what slot they chose.
    variable (slot)
    slot := save menu (false)

    # This is where you put the scripting for your cutscene. As an example,
    # here's a very simple one that fades the screen out and back in while
    # playing music.

    suspend player
    play song (song:save jingle)
    fade screen out
    wait(32)
    fade screen in
    play song (get ambient music)
    resume player

    # Now that that's done, save the game for real in the slot the player
    # selected earlier. If they canceled out of the save menu instead of
    # picking a slot, do nothing.
    if (slot) then (save in slot (slot))
 
  end
end

Now, go to Edit Menus, and create a new menu. Call it "Inn Menu" or something. Select Edit Items and create the following menu items:

  • Caption: Inn
    Type: 4 Run script
    Subtype: save at inn
    Extra data 0: [whatever you want the inn to cost]
  • Caption: Save
    Type: 1 Special screen
    Subtype: 13 Save
  • Caption: Exit
    Type: 0 Label
    Subtype: 0 Selectable
    Edit bitsets: Turn "Close menu when activated" on

All you need to do now is have your inn NPC display this menu (you can do this by creating a text box). Congratulations! You now have a fancy inn that prompts the player to save.

See also[edit]