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

From OHRRPGCE-Wiki
Jump to navigationJump to search

There are various ways to enable save at the inn.


Place a save point in the inn[edit]

If you are using save points, you may want to place it one on the inn. Note that in old game which were using save points, there were generally no save point in inns but in the village. There are some exceptions like Sailor Moon Another Story

Activate the save function on the shop "inn"[edit]

To activate it, just go under custom.exe. Edit the shops. Use the arrows until you find your inn. Go down and edit the bitsets. Make save active. Save your game and test. You'll see save under Inn.


Offer to save after recovering[edit]

This is what is most likely to fit your needs. It consists in offering the player to save the game using the inn script.

1) Offer to save using a "save shop"

We'll use choices and they requiere tags, so feel free to click above (on "how do I make choice in a dialogue box?") if you are not at ease with them.

The first thing you need to do is make a shop. From the main menu pick Edit Shops. Then, in the shop editor, make a new shop and name it "Save Point". Now pick Edit Shop Bitsets and enable Save, and make sure everything else is disabled.

Now go back to the main menu. Pick up a free tag and name it go to save or anything else then can make you remember what the tag is used for.

Then go into Edit Text Boxes. Make a new text box that says "Would you like to save the game?" (It will be text box 21 in this example) Go back and edit choice. Make choice enabled. If the player chooses yes then tag is turned on and if the player choose no the tag is turned off.

Then edit the conditionnals. If tag is turned off, then "jump to the text box 21 instead"

Then you You will see a line that says:

Never do the following
  restore party's HP and MP

Change that to:

Always do the following
  go to shop # Save Point

Next, you need to include it in the Inn script

#-------------------------------------------------------------------------------
plotscript, inn script, begin

suspend player
suspend npcs

walk hero to x (me, 4) # your heroes go to bed
walk hero to y (me, 3)

fade screen out 
wait (8)
fade screen in

show text box (21) #offer to save
wait for text box

resume player
resume npcs

end #end for the script
#------------------------------------------------

Now go back under custom.exe and edit your game. Import the scripts. Edit the shops. Find your inn and edit it. Go down to the inn script and give it the script you've just made.


2) Offer to save using the save function of the menu

Here again we'll use the Inn Script. Pick up a free text box. Write in it : Would you like to save the game. It will be text box 23 in our example. Pick up a free tag and name it "go to save" or any name that can help you to recall what the tag will be used for. To save some time afford the occasion to create another one you'll call "save" (Well use it to activate the save function of the menu) Tag "go to save" is tag 12 and tag "save" is tag 15.

Edit again the text boxes. Enable choices. We want 2 choices. "yes" is the first one and no the second one. If you choose yes tag is turned on, and if you choose no the tag is turned off.

Export the tags and save the game without leaving custom.exe. Now we will modificate the main menu. Edit the menus and then the items menu. Go down to save. Make sure you see the line

  caption: save
  type 1 special screen
  subtype8 : [if allowed by map]
  enable if tag 15=ON (save)

Then go back under windows and edit your hss files.


#------------------------------------------------
plotscript, inn script, begin

suspend player
suspend npcs

walk hero to x (me, 4) # your heroes go to bed
walk hero to y (me, 3)

fade screen out 
wait (8)
fade screen in

show text box (23) #offer to save
wait for text box

if (check tag (tag: save)==on) then, begin
set tag (tag: save, on) #save is activated. you can save
main menu
end #end for the if check tag

resume player
resume npcs

end #end for the script
#------------------------------------------------

We'll also need a keypress script

#---------------------------------------------------------------------------
# The on-keypress script. Add keys for player. Customize the pre-defined ones
#to embetter gameplay.

script, my OnKeypress, begin

#prevents player to save more than one time. if key esc is press and save menu 
#activated, it unactivates it.

if (key is pressed(key: esc),and, check tag (tag: save )) then, begin
set tag (tag: save, off)
end

end #end for the script
#---------------------------------------------------------------------------

No edit the inn map and make sure that "save is enabled". And give it the keypress script. Feel free to ask questions and make some tests!


See also[edit]