How do I make a "fake inn"?

From OHRRPGCE-Wiki
Jump to: navigation, search
Revise.png
This article does not meet the standard of quality we would like to have. Feel free to revise it and make it better by using the edit link at the top of the page. This tag should be removed when an editor feels it is of high quality.

The reason this article has been marked is: needs to be re-written for user-defined menus

In this article, you're going to see how to make an inn that is exactly like the one included in custom.exe but that will restore certain stats only.

Indeed, it won't be very useful except if you ONLY want an inn that looks exactly the one in custom.exe. Note also that the script is very complex (use many global variables, and many tags. The caode has many codelines. ) An embettered version of the script will be posted above once it will have been embettered.


All right here we go!

First go under custom.exe and edit the tags. You'll need 12 tags. I called them "inn case 1", "inn case 2", "inn case 3" ... but you can indeed give them the name you want. We'll also need one that named 'enough cash' , another one called 'stats checked' and a last one 'stay for the night')

Then edit the text boxes :

Pick up a free one a write in it something like

Would you like to stay at the inn? Come on it's cheap! Only $ 34 a night

We'll say that it will be text box 112.

Then pick up another one and write in it "Sorry but you don't seem to have enough cash" (let's say that it will be text box 113)

Go back to the main menu and export the tags' names. Now, you can save the whole thing and go back under windows (or linux if you're using this system)

Edit your .hss file.

Add the following global variables (if you have never used global variable, read the last section in *Everything You Ever Wanted to Know About Text Boxes, But Were Afraid To Ask)

 Global variable (13, MyMoney)
 Global variable (14, hero0 stat)
 Global variable (15, hero0 stat max)
 Global variable (16, hero1 stat)
 Global variable (17, hero1 stat max)
 Global variable (18, hero2 stat)
 Global variable (19, hero2 stat max)
 Global variable (20, hero3 stat)
 Global variable (21, hero3 stat max)

Once you have given them number, pick them on a piece of paper, of just print it. One it's done, save your hss file and go back under custom.exe on windows mode. You have to be able to zap between custom.exe and your .hss file.

Under custom.exe edit new text boxes. (We'll use 8 text boxes, one for each case) To make the cheat perfect you HAVE to left blank lines when a slot is free.


First case : the main hero (hero 0) is with hero 1 and their stats appears using variables. (If this seems strange to you please check the article and ask questions on the forum)

${S0} ${V14}/${V15} 
${S1} ${V16}/${V17} 

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"
#All thoses pieces of informations are on text box 114

Second case : 2 Main hero (hero 0) is with hero 1 and also hero 2. Their stats appears using variables.

${S0} ${V14}/${V15} 
${S1} ${V16}/${V17} 
${S2} ${V17}/${V18}

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"
#All thoses pieces of informations are on text box 115

Third case : All the slots are occupied. There are 4 heroes in your party and their stats appears using variables.

${S0} ${V14}/${V15} 
${S1} ${V16}/${V17} 
${S2} ${V17}/${V18}
${S3} ${V19}/${V20}

The inn costs $34. You have ${V13} 

#Like before, you have to edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"
#All thoses pieces of informations are on text box 116

Fourth case : The main hero is alone and his/her current stats appears using always the same method.


${S0} ${V14}/${V15} 

The inn costs $34. You have ${V13} 

Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"
#All thoses pieces of informations are on text box 117

Fifth case : This time there's a hole. Slot 1 is left empty.

${S0} ${V14}/${V15} 

${S2} ${V17}/${V18}
${S3} ${V19}/${V20}

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"
#All thoses pieces of informations are on text box 118

Sixth case : 2 holes this time. Slot 1 and 3 are free. (which means we only have 2 heroes)

${S0} ${V14}/${V15} 

${S2} ${V17}/${V18}

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"

#All thoses pieces of informations are on text box 119

Seventh case In this situation slot 2 is free

${S0} ${V14}/${V15} 
${S1} ${V16}/${V17} 

${S3} ${V19}/${V20}

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"

#All thoses pieces of informations are on text box 120

Eighth (and last) case Slot 1 and 2 are made.

${S0} ${V14}/${V15} 


${S3} ${V19}/${V20}

The inn costs $34. You have ${V13} 

#Then edit the choice. Make it enable and make sure that you can read
option 0 Pay
set tag 47 = ON "stay for the night"
Option 1 Cancel
set tag 47 = OFF "stay for the night"

#All thoses pieces of informations are on text box 121

After making all those manipulations you may want to edit a second time the tags names and to save your work. You can now include the following scripts in your hss file

# ----------------------------------------------------------------
# script fake inn part 1
script, fake inn , begin

suspend player

set variable (MyMoney, party money) #store the amount we currently have
get money (MyMoney) #prevents Hspeak from saying the variable is unused
lose money (MyMoney) 

show text box (112)
wait for text box

nb hero:= 0 #reset heroes' counting

# store main hero stats
set variable (hero0 stat, get hero stat (0,stat:hp,current stat))
set variable (hero0 stat max, get hero stat(0,stat:hp,maximum stat))
set hero stat (0, stat:hp, 6, current stat) #prevents hspeak.exe from complaining
set hero stat (0, stat:hp, 6, maximum stat)
set hero stat (0, stat:hp, hero0 stat, current stat)
set hero stat (0, stat:hp, hero0 stat max, maximum stat)
get hero name (0,find hero(hero by slot(0)))
increment (nb hero, 1) #store main hero's datas
wait (2)

if (hero by slot (1) <> -1) then, begin #if slot (1) is occupied then, store his stats and names
set variable (hero1 stat, get hero stat (1,stat:hp,current stat))
set variable (hero1 stat max, get hero stat(1,stat:hp,maximum stat))
set hero stat (1, stat:hp, 6, current stat) #prevents hspeak.exe from complaining
set hero stat (1, stat:hp, 6, maximum stat)
set hero stat (1, stat:hp, hero1 stat, current stat)
set hero stat (1, stat:hp, hero1 stat max, maximum stat)
get hero name (1,find hero(hero by slot(1)))
increment (nb hero, 1)
wait (2)
end, else, begin
wait (1)
end

if (hero by slot (2) <> -1) then, begin #if slot (2) is occupied store his stats
set variable (hero2 stat, get hero stat (2,stat:hp,current stat))
set variable (hero2 stat max, get hero stat(2,stat:hp,maximum stat))
set hero stat (2, stat:hp, 6, current stat) #prevents hspeak.exe from complaining
set hero stat (2, stat:hp, 6, maximum stat)
set hero stat (2, stat:hp, hero2 stat, current stat)
set hero stat (2, stat:hp, hero2 stat max, maximum stat)
get hero name (2,find hero(hero by slot(2)))
increment (nb hero, 1)
wait (2)
end, else, begin
wait (1)
end
 
if (hero by slot (3) <> -1) then, begin #if slot (3) is occupied store his stats
set variable (hero3 stat, get hero stat(3,stat:hp,current stat))
set variable (hero3 stat max, get hero stat(3,stat:hp,maximum stat))
set hero stat (3, stat:hp, 6, current stat) #prevents hspeak.exe from complaining
set hero stat (3, stat:hp, 6, maximum stat)
set hero stat (3, stat:hp, hero3 stat, current stat)
set hero stat (3, stat:hp, hero3 stat max, maximum stat)
get hero name (3,find hero(hero by slot(3)))
increment (nb hero, 1)
wait (2)
end, else, begin
wait (1)
end

set tag (tag: inn case 1, off) #reset situation checking
set tag (tag: inn case 2, off)
set tag (tag: inn case 3, off)
set tag (tag: inn case 4, off)
set tag (tag: inn case 5, off)
set tag (tag: inn case 6, off)
set tag (tag: inn case 7, off)
set tag (tag: enough cash, off)
set tag (tag: stats stored, on)
wait (2)

if (check tag (tag: stats stored) == ON) then, begin
if (nb hero == 1)then, begin #1 hero= hero (0) is alone
show text box (117)
wait for text box
set tag (tag:inn case 8, on)
resume player
fake inn 2
end # end for if (nb hero == 1)then...

if (nb hero == 2)then, begin # 2 heroes (0) is with one another hero

if (hero by slot (1) <> -1) then, begin #  if slot (1) is occupied, then hero (0) is alone with hero (1)...
show text box (114)
wait for text box
set tag (tag:inn case 1, on)
resume player
fake inn 2
end

if (hero by slot (2) <> -1) then, begin #  if slot (2) is occupied, then hero (0) is alone with hero (2)...
show text box (119)
wait for text box
set tag (tag:inn case 2, on)
resume player
fake inn 2
end

if (hero by slot (3) <> -1)then, begin  # if slot (3) is occupied, then hero (0) is alone with hero (3)...
show text box (121)
wait for text box
set tag (tag:inn case 3, on)
resume player
fake inn 2
end 

end # end for if (nb hero == 2)then, begin...


if (nb hero == 3)then, begin #case 3 hero (0) is with 2 another heroes

if (hero by slot (1) == -1) then, begin # slot (1) is free then the 2 other heroes are in slot (2) and (3)...
show text box (118)
wait for text box
set tag (tag:inn case 4, on)
resume player
fake inn 2
end

if (hero by slot (2) == -1) then, begin # slot (2) is free the 2 other heroes are in slot (1) and (3)...
show text box (120)
wait for text box
set tag (tag:inn case 5, on)
resume player
fake inn 2
end

if (hero by slot (3) == -1) then, begin # slot (3) is free the 2 other heroes are in slot (1) and (2)...
show text box (115)
wait for text box
set tag (tag:inn case 6, on)
resume player
fake inn 2
end #end for the else begin

end # end for if (nb hero == 3)

if (nb hero == 4)then, begin # all the slots are full
show text box (116)
wait for text box
set tag (tag:inn case 7, on)
resume player
fake inn 2
end # end for if (nb hero == 4)

end #end for the check tag
end# end of plotscript
#---------------------------------------------------------------------------

And also this one

#script fake inn part 2
script, fake inn 2, begin

suspend player

if (check tag (tag: go to team) == ON) then, begin
if (MyMoney >= 34), then, begin # we check if we have at least 34 dollars
set tag (tag: enough cash, on)
wait (1)
resume player
end

if (MyMoney << 34), then, begin # if we have less than 34 dollars then...
set tag (tag: enough cash, off)
show text box (113) # Sorry. You don't have enough cash
wait for text box 
resume player
end

end #  end for the if check tag

if (check tag (tag: go to team) == OFF) then, begin
resume player
wait (1)
end

if (check tag(tag: inn case 8)==ON, and, check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set tag (tag: inn case 8, off)
lose money (34) # pay the inn tender
fade screen out
fade screen in
resume player
end 

if (check tag(tag: inn case 1)==ON, and, check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat) #restore stats hero 1
set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
set tag (tag: inn case 1, off)
lose money (34) # pay the inn tender
fade screen out
fade screen in
resume player
end

if (check tag(tag: inn case 2)==ON,and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat) #restore stats hero 2
set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
set tag (tag: inn case 2, off)
lose money (34) # pay the inn tender
fade screen out
fade screen in
resume player
end

if (check tag(tag: inn case 3)==ON, and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat) #restore stats hero 3
set hero stat(3,stat:mp, get hero stat(3,stat:mp,maximum stat), current stat)
set tag (tag: inn case 3, off)
lose money (34) # pay the inn tender
fade screen out
fade screen in
resume player
end

if (check tag(tag: inn case 4)==ON, and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat) #restore stats hero 2
set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat) #restore stats hero 3
set hero stat(3,stat:mp, get hero stat(3,stat:mp,maximum stat), current stat)
set tag (tag: inn case 4, off)
lose money (34) # pay the inn tender
fade screen out
fade screen in
resume player
end

if (check tag(tag: inn case 5)==ON, and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat) #restore stats hero 1
set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat) #restore stats hero 3
set hero stat(3,stat:mp, get hero stat(3,stat:mp,maximum stat), current stat)
set tag (tag: inn case 5, off)
lose money (34)  # pay the inn tender
fade screen out
fade screen in
resume player
end


if (check tag(tag: inn case 6)==ON, and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat) #restore stats hero 1
set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat) #restore stats hero 2
set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
set tag (tag: inn case 6, off)
lose money (34)  # pay the inn tender
fade screen out
fade screen in
resume player
end


if (check tag(tag: inn case 7)==ON, and ,check tag (tag: enough cash)== on) then, begin 
set hero stat(0,stat:hp, get hero stat(0,stat:hp,maximum stat), current stat) #restore stats hero 0
set hero stat(0,stat:mp, get hero stat(0,stat:mp,maximum stat), current stat)
set hero stat(1,stat:hp, get hero stat(1,stat:hp,maximum stat), current stat) #restore stats hero 1
set hero stat(1,stat:mp, get hero stat(1,stat:mp,maximum stat), current stat)
set hero stat(2,stat:hp, get hero stat(2,stat:hp,maximum stat), current stat) #restore stats hero 2
set hero stat(2,stat:mp, get hero stat(2,stat:mp,maximum stat), current stat)
set hero stat(3,stat:hp, get hero stat(3,stat:hp,maximum stat), current stat) #restore stats hero 3
set hero stat(3,stat:mp, get hero stat(3,stat:mp,maximum stat), current stat)
set tag (tag: inn case 7, off)
lose money (34)  # pay the inn tender
fade screen out
fade screen in
resume player
end

end #end of plotscript

#---------------------------------------------------------------------------------

Modify the scripts above and include you own tags names and bill amont for the inn tender. Be careful with the tag "stay for the night". It's the name for the tag that is used for the yes/no questions: you have to understand how the yes/no questions works to make this script fully works.

The main difficulty in adapting the script will consist in linking the right inn case with the right text box'Bold text. To prevent mistakes I strongly advise you to keep the comments and not to paste code lines.

To be sure to give the correct numbers, make a little table on a piece of paper which include

case (nb)/ heroes in the party / number of text box

Example case nb3/ 4 heroes in the party/ 116

It will make things much more easier when you adapt the script "fake inn1" to your own needs.

Save your game datas and leave custom.exe. Then you'll need to save and .hss file and use hspeak.exe to compile it. Take your time and check carefully that you have given all the infos the heroes global variable, the amount for the inn tender... To make things easier, I advise you to keep the name of the tags and of the global variables. The one I've chosen may not be the best one possible but you clear see what are used for.

Remember that this script is not very useful except if you want you inn to lo /ok like the one you have with custom and if you want to restore certain stats only. Keep also in mind that this system consume tags global variables and text boxes so you need to be sure that you really need before implementing it!

For all those reasons the articles are more likely to feet your needs.


See also[edit]