 |
Castle Paradox
|
| View previous topic :: View next topic |
| Author |
Message |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Dec 09, 2007 9:27 pm Post subject: |
|
|
| If the whole reason you are making a fake inn is because of the blank line in the hero stats when you don't have a fll party, you should just use the latest WIP nightly builds. When I was cleaning up the Inn code, I changed it to display hero stats without any blanks. Download http://hamsterrepublic.com/ohrrpgce/nightly/ohrrpgce-wip-default.zip and try a standard Inn |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Dec 09, 2007 11:44 pm Post subject: Using "variable (ctr) do, begin" |
|
|
| msw188 wrote: |
Is this working properly? It does not seem right to me at all. First of all, "hero by slot" does not correspond to "on" and "off" |
The code works "rather" well but there seem to have some problems with waiting: sometimes the variables {P0}, {P1}... appears instead of names because the code has ran too fast.
Then Msw 188 also asked
| Quote: | | I also don't understand what all the different textboxes are for |
As I said in the previous post the text boxes are numerous because it includes all the possiblities with the blank lines (see screenshots+ little table)
| Quote: | | I was cleaning up the Inn code, I changed it to display hero stats without any blanks |
I think that it is to have compelled the display of hero stats without any blanks because you don't know how the player arranged the heroes on the team. Indeed the player is not likely to let blanks between heroes but who knows... Anyway that's only my opinion. Thank you for letting us know about the WIP.
As you have already noticed I had problems to link the several steps between them in the code. I have difficulties to use the if command efficiently.
At the beginning of the first script for example, I would like to make the slots cheked one after another so that for each of the possible cases, the heroes of the active party have their stats stored and we know how many hero they are. The 4 slots of the active party has to be checked which is not the case in my actual script because heroes' counting stops after a full slot has been founded. To do so , I need to use "variable (ctr) do, begin"
but I don't see what to put after...
Then when the hero is with one or two another heroes, I also need to check slots one after another, until I know in what situation I am. So "variable (ctr) do, begin" may also useful here
How shall use this variable to make it check slots one after another?
Thanks for answering so quickly! Good luck in making your game everybody _________________ It's time to make games! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Dec 10, 2007 3:05 am Post subject: |
|
|
| msw188 wrote: | Well, it depends. NPC copy count (ID#) basically asks the computer, "How many NPCs are there on the map right now that have this ID#?" It will return numbers bigger than 1 if there are more NPC 5's. Furthermore, if you delete the original one but make a new one in its place, then your code will still return true. If none of this is a problem for you, then yes, the code you have is enough and you don't need any variable work.
However, if there might be other NPC 5's coming and going, and you need to keep track of the original copy placed in custom, then you will probably need to use a global variable to store this specific NPC 5's reference in. Define a global variable as NPC Storage, say, and have the following line in your map autorun script:
| Code: | | NPC storage:=npc reference(5,0) |
Then anywhere you want to check if this NPC 5 is still on the map, have this:
| Code: | if(npc reference(5,0)==NPC storage), then
begin |
This line will check to see if the first (or zero-th copy, you might say) of NPC 5 on the map is the same as the one you stored when the map first loaded. It it is, then the NPC is still there. If not, then the original NPC 5 is gone.
PS: This is not tested, but I am pretty sure that this is how it would work. Confirmation from a developer or other plotscripting master would be helpful. |
A good way check if an NPC reference refers to an existing NPC is "get NPC id (npc ref) >= 0" (getNPCid returns -1 if the NPC doesn't exist)
I don't know what situation you're using it in (I haven't followed the thread), but it still won't prove that the NPC wasn't destroyed and a new one was given its ID. However NPCs placed in custom and those created with createNPC are given references in different ways, so they won't collide unless you have close to 300 NPCs on the map. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Dec 11, 2007 10:38 pm Post subject: Use "variable (ctr) do, begin" |
|
|
| Code: |
if (get NPC id (npc ref) >= 0) then, begin #getNPCid returns -1 if the NPC doesn't exist
|
Thanks! This code also seems to be usefull to check the number of copies of an given Npc. Anyway, could somoene help me to use so that it can check the slots in active party?
| Code: |
"variable (ctr) do, begin"
|
Thanks in advance for the help! _________________ It's time to make games! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Wed Dec 12, 2007 9:02 am Post subject: |
|
|
Well, I am not sure what you want the inn to do and why you are not just using the WIP version that gets rid of the blank line for you. Do you want the blank line to appear, or are you trying to get rid of it in your text box? If you are trying to get rid of it, then the best thing to do is probably to only have four text boxes based on party totals, and manipulate them using strings like this:
| Code: | variable(ctr)
nb hero:=0 #initialize hero count; we will count first hero in the next part
for(ctr,0,3),do
begin
if(hero by rank(ctr)<>-1),then #Note RANK, not SLOT. This command skips over blank slots.
begin
increment(nb hero, 1) #if the hero is there (not -1), add one to hero count
get hero name(ctr+1,hero by rank(ctr))
#this part puts the hero's name into string with ID number (ctr+1).
#The +1 is because there is no string with ID number zero.
write global(2*ctr+9, get hero stat(find hero(hero by rank(ctr)), stat:HP))
write global(2*ctr+10, get hero stat (#same thing but read maximum stat))
end #end of if
end #end of for
end
switch(nb hero),do
begin
case(1),do
(showtextbox(???)) #one hero
case(2),do
(showtextbox(???)) #two heroes
case(3),do
(showtextbox(???)) #three heroes
case(4),do
(showtextbox(???)) #four heroes
end
|
Then, in custom, your textboxes should look like:
${S1} - ${V9}/${V10}
${S2} - ${V11}/${V12}
and so forth. None of them should skip any lines or skip any numbers; the command "hero by rank" correctly skips over blank slots in the party.
On the other hand, if you are trying to fake the blank, as in you DO want the blank to appear in your text boxes, then we need different code, but it is arguably even easier. Just let us know. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sat Dec 15, 2007 2:52 am Post subject: |
|
|
Ok! Here is a new version of the script. The problem is that Hspeak.exe complains that there is a extra begin (or a missing end) in the script but I really don't see where it could be. Here is the new version of the script
| Code: |
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 (368)
wait for text box
variable(ctr)
nb hero:=0 #initialize hero count; we will count first hero in the next part
for(ctr,0,3),do, begin
if(hero by rank(ctr)<>-1),then, begin #Note RANK, not SLOT. This command skips over blank slots.
increment(nb hero, 1) #if the hero is there (not -1), add one to hero count
get hero name(ctr+1,hero by rank(ctr))
#this part puts the hero's name into string with ID number (ctr+1).
#The +1 is because there is no string with ID number zero.
write global(2*ctr+9, get hero stat(find hero(hero by rank(ctr)), stat:HP))
write global(2*ctr+10, get hero stat (#same thing but read maximum stat))
end #end of if
end #end of for
end #???
switch(nb hero) do, begin
case(1) do, begin #one hero
show text box(381)
wait for text box
fake inn 2
resume player
end #end for case
case(2) do, begin #two heroes
if (hero by rank (1) == 1) then, begin # check if the another hero is in slot 1
show text box (378)
wait for text box
fake inn 2
resume player
end, else, begin
if (hero by rank (2) == 1) then, begin # check if the another hero is in slot 2
show text box (383)
wait for text box
fake inn 2
resume player
end, else, begin
if (hero by rank (3) == 1) then, begin # check if the another hero is in slot 3
show text box (385)
wait for text box
fake inn 2
resume player
end
end
end
end# end for the case
case(3) do, begin #three heroes
if (hero by rank (1) == -1) then, begin # if slot (1) is free, then the 2 other heroes are in slot (2) and (3)..
wait (2)
show text box (382)
wait for text box
fake inn 2
resume player
end, else, begin
if (hero by rank (2) == -1) then, begin # if slot (2) is free, then the 2 other heroes are in slot (1) and (3)..
wait (2)
show text box (384)
wait for text box
fake inn 2
resume player
end, else, begin
if (hero by rank (3) == -1) then, begin # if slot (3) is free, then the 2 other heroes are in slot (1) and (2)..
wait (2)
show text box (379)
wait for text box
fake inn 2
resume player
end
end
end
end# end for the case
case(4) do, begin #four heroes
show text box (380)
wait for text box
fake inn 2
resume player
end # end for the case
end #end for switch number hero
end# end of plotscript
|
If somoene sees something that I didn't, please tell me! Good luck in making your games everybody! _________________ It's time to make games! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Dec 15, 2007 8:46 am Post subject: |
|
|
I think you misunderstand what my code is doing. Because I am using the "hero by rank" command instead of "hero by slot", there is no need for any of your "if(hero by rank(number)==1)" sets of code at all. There should only be four separate textboxes in custom for all of this junk: one for one hero, one for two heroes (no matter what slots they are in, my for loop will assign the strings correctly), one for three heroes (again, it doesn't matter where the empty slot is because my for loop uses hero by rank), and one for four heroes. See my previous post for what sort of things need to go into those four textboxes in custom.
If you don't feel confident with using strings in plotscripts (the command "get hero name", for example) and using strings in textboxes (the whole ${S1} business) you should read up on them in the wiki. Just search for strings and you should be able to find some generally helpful information.
As for your specific code, every single 'case' should look exactly the same:
[fake code (needs stuff filled in)]
| Code: |
case(2) do, begin #two heroes
showtextbox(#textbox number with correct use of ${S1} and ${S2})
wait for text box
fake inn 2
resume player
end #end for case 2
case(3) do, begin #three heroes
showtextbox(#textbox number with correct use of ${S1} and ${S2} and ${S3})
wait for text box
fake inn 2
resume player
end #end for case 3
case(4) do, begin #two heroes
showtextbox(#textbox number with correct use of ${S1}, ${S2}, ${S3} and ${S4})
wait for text box
fake inn 2
resume player
end #end for case 4
|
[end of fake code]
As for the Hamsterspeak complaints, this is because you did not finish filling in my code. The part that says "get hero stat (#same thing but read maximum stat)" needs you to put the correct stuff in those parantheses to read the hero's maximum HP.[/code] _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Dec 23, 2007 12:09 am Post subject: I"ve changed the global variables |
|
|
Sorry to make you waiting but after testing it appears that the script doesn't work.
That is certainly due to the fact that I'm using other references for global variables
| Code: |
Global variable (28, hero1 stat)
Global variable (29, hero1 stat max)
Global variable (39, hero0 stat)
Global variable (40, hero0 stat max)
Global variable (41, hero2 stat)
Global variable (42, hero2 stat max)
Global variable (43, hero3 stat)
Global variable (44, hero3 stat max)
|
Note that I've modified the text boxes but not the code because I didn't know precisely in which part make of the code the stats of the heroes are stored.
Thanks in advance for help and Merry Christmas to everybody! _________________ It's time to make games! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Thu Jan 03, 2008 10:44 pm Post subject: |
|
|
Okay, here we go. You need to understand a few things. First of all, the code I posted was meant as an example that would use Global Variables 9,10,11,... to store hero stats in a specific order. If you need your global variables to be spread out like you show in the last post, then my script needs rewritten. On the other hand, if you could just redefine some globals to all be in a row for storing this stuff, that would be very helpful.
I am going to assume that you have done so, like this:
| Code: | Global variable (50, hero0 stat)
Global variable (51, hero0 stat max)
Global variable (52, hero1 stat)
Global variable (53, hero1 stat max)
Global variable (54, hero2 stat)
Global variable (55, hero2 stat max)
Global variable (56, hero3 stat)
Global variable (57, hero3 stat max) |
Thus, all of the globals are in a set order - VERY IMPORTANT. Then my part about the text boxes will use ${V50} instead of ${V9}, and so forth.
Let me try to explain a little better. The goal of my code is to take the names of all the heroes in the party (in the order that they appear, not counting blanks) and store these names as strings. Specifically, the first hero's name will be stored as String1, the second as String2, and so forth and so on up to (but not necessarily including) String4. At the same time, my code will take the current and maximum HP of the heroes to store these stats in global variables.
In order to do this efficiently, I would like the globals to have their ID numbers to be all in a row so I can access them all at once. This is so that when I use a for loop, I can use the command "write global". This command stores information in global variables based on the global's ID number instead of it's name. In the code I posted before, I had the lines:
| Code: | write global(2*ctr+9, get hero stat(find hero(hero by rank(ctr)), stat:HP))
write global(2*ctr+10, get hero stat (#same thing but read maximum stat)) |
Here, the variable "ctr" is being used by the for loop. When ctr is zero, these lines store the zero'th (first) hero's HP into whatever global variable has ID number 9, and store his maxHP into whatever global variable has ID number 10. This is because the formula:
2*ctr+9
is equal to 9 when ctr is zero. However, when the variable ctr is increased to 1 by the for loop, all of this changes. I'm now finding the one'th (second) hero in the party (not counting blanks), and I am storing his HP into whatever global variable has ID number 11 (and maxHP into global variable ID 12). This is because when ctr is equal to 1, that same formula comes out to be 11 instead of 9.
And so that entire for loop was contrived in such a way as to store HP's and maxHP's in a specific order, not based on the names of Global Variables, but rather by their ID numbers. This is why it needs the globals to be defined in order, and why it won't work with your current global definitions. If you use my global definitions in this post, you will need to change the lines above to read:
| Code: | write global(2*ctr+50, get hero stat(find hero(hero by rank(ctr)), stat:HP))
write global(2*ctr+51, get hero stat (#same thing but read maximum stat)) |
Notice the change of the 9 and 10 to now be 50 and 51, because those are the ID numbers of where my global definitions for this part start. Whatever global variable ID's you end up using, the first ones will need to go where I have my 50 and 51.
As for the text boxes, if you need further help understanding those parts, let me know. You will probably have to re-type the textboxes in custom so that the ${V number} uses the correct ID number. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jan 04, 2008 12:33 am Post subject: |
|
|
bis_senchi should ignore this post, but prehaps it would have been less trouble to just use strings totally (a single ${S#} on each line) or menus (which are variable size of course) to avoid this mess. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Jan 04, 2008 8:33 am Post subject: |
|
|
| Quote: | | less trouble to just use strings totally (a single ${S#} on each line) or menus |
When we first started wading through this mess, I'm pretty sure that custom menues did not exist, or at least, were not workable. And I still don't feel very comfortable at all with strings and their commands. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jan 04, 2008 6:00 pm Post subject: |
|
|
Admittedly strings are a little messy. I hope that they will be cleaned up after Voxhumana. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Jan 04, 2008 11:36 pm Post subject: after some reflexion |
|
|
A Msw188 said in a previous post using
| Code: | | strings totally (a single ${S#} on each line |
I think that I choose this option. The trouble is that I've never used strings before. I guess at that begins there will be something like
| Code: |
$52="stat hero 1"
get hero stat (2, stat:hp)
$53="max stat hero 1 "
get hero stat(2, stat:hp,maximum stat)
|
The trouble comes after. Please remember that I try to fake the "old inn" that is to say where it was possible to have blank spaces in hero slots (I mean by that it was possible to have at the same one hero in slots 1 and 3 and nothing in slots 2 and 4, which is not possible anylonger.)
| bis_senchi wrote: |
I've studied the case nearly all yesterday for 3 hours and it appears that they are 8 cases (_ = no hero on slot)
hero 0, hero 1, hero 2, hero 3 (no pb hero nb== 4)
hero 0, _ , hero 2, hero 3
hero 0, hero 1 , _, hero 3
hero 0, hero 1 , hero 2 , _
hero 0, hero 1 , _ , _
hero 0, _ , hero 2, _
hero 0, _ , _ , hero 3
hero 0, _ , _ , _ (np pb hero nb==1)
|
The other problem that left and which is also very important is to get the heroes in the active party. As we have 8 possibilities, I think that strings will really be helpful!
Good luck in making your games everybody! _________________ It's time to make games! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Sat Jan 05, 2008 1:17 am Post subject: |
|
|
Wait a moment, are you saying that you want blank lines to appear in the middle of the text boxes if there are blank slots between heroes? I mean, do you want it to look like:
Bob - HP/maxHP
Bobby - HP/maxHP
Bobbaroo - HP/maxHP
or do you want it to look like:
Bob - HP/maxHP
Bobby - HP/maxHP
Bobbaroo - HP/maxHP
I've been assuming the whole time that you wanted the first example here. _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Jan 06, 2008 2:48 am Post subject: new version of the scripts! |
|
|
| msw188 wrote: | | Wait a moment, are you saying that you want blank lines to appear in the middle of the text boxes if there are blank slots between heroes? I mean, do you want it to look like |
Yes that's exactly what I want: fake the inn the old way when it was possible to have blank lines. As I've said several times before, we have 8 possibilities.
Ok! I've worked on a new version of the script. Tell me what you think about it.
| Code: |
Global variable (32, hero 1)
Global variable (36, MyMoney)
Global variable (39, hero0 stat)
Global variable (40, hero0 stat max)
Global variable (41, hero2 stat)
Global variable (42, hero2 stat max)
Global variable (43, hero3 stat)
Global variable (44, hero3 stat max)
Global variable (46, hero2)
Global variable (47, hero3)
#---------------------------------------------------------------------------
# script test fake inn
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 (368)
wait for text box
#store main hero's datas
increment (nb hero, 1) #main hero is here by default so nb hero is always # at least 1 before counting starts.
set variable (hero0 stat, get hero stat)
set variable (hero0 stat max, get hero stat(1,stat:hp,maximum stat))
set hero stat (hero0 stat max) #prevents hspeak for complaining that the variable is unused
set hero stat (hero0 stat)
set variable (hero 1, hero by slot (1))
set variable (hero 2, hero by slot (2))
set variable (hero 3, hero by slot (3))
#check the number of heroes
if (hero 1 == 1) then, begin #if slot (1) is occupied store his stats
set variable (hero1 stat, get hero stat)
set variable (hero1 stat max, get hero stat(1,stat:hp,maximum stat))
set hero stat (hero1 stat max) #prevents hspeak for complaining that the variable is unused
set hero stat (hero1 stat)
increment (nb hero, 1)
end, else, begin
if (hero 2 == 1) then, begin #if slot (2) is occupied store his stats
set variable (hero2 stat, get hero stat)
set variable (hero2 stat max, get hero stat(2,stat:hp,maximum stat))
set hero stat (hero2 stat max) #prevents hspeak for complaining that the variable is unused
set hero stat (hero2 stat)
increment (nb hero, 1)
end, else, begin
if (hero 3 == 1) then, begin
set variable (hero3 stat, get hero stat)
set variable (hero3 stat max, get hero stat(3,stat:hp,maximum stat))
set hero stat (hero3 stat max) #prevents hspeak for complaining that the variable is unused
set hero stat (hero3 stat)
increment (nb hero, 1)
end, else, begin #no heroes in slots 1,2 and 3
wait (1) # do nothing
end #end for no heroes in slots 1,2 and 3
end #end for the else begins
end
wait (2)
if (nb hero == 1)then, begin #1 hero= hero (0) is alone
show text box (381)
wait for text box
set tag (tag:inn case 8, on)
fake inn 2
resume player
end # end for if (nb hero == 1)then...
if (nb hero == 2)then, begin # 2 heroes (0) is with one another hero
while (nb hero == 2) do, begin
if (hero 1 == 1) then, begin # if slot (1) is occupied, then hero (0) is (alone) with hero (1)...
show text box (378)
wait for text box
set tag (tag:inn case 1, on)
fake inn 2
resume player
end, else, begin
if (hero 2 == 1) then, begin # if slot (2) is occupied, then hero (0) is (alone) with hero (2)...
show text box (383)
wait for text box
set tag (tag:inn case 2, on)
fake inn 2
resume player
end, else, begin
if (hero 3 == 1)then, begin # if slot (3) is occupied, then hero (0) is (alone) with hero (3)...
show text box (385)
wait for text box
set tag (tag:inn case 3, on)
fake inn 2
resume player
end # end for the else begin
end
end
end # end for the while
end # end for if (nb hero == 2)then, begin...
if (nb hero == 3)then, begin #case 3 hero (0) is with 2 another heroes
while (nb hero == 3) do, begin
if (hero 1 == -1) then, begin # slot (1) is free then the 2 other heroes are in slot (2) and (3)...
show text box (382)
wait for text box
set tag (tag:inn case 4, on)
fake inn 2
resume player
end, else, begin
if (hero 2 == -1) then, begin # slot (2) is free the 2 other heroes are in slot (1) and (3)...
show text box (384)
wait for text box
set tag (tag:inn case 5, on)
fake inn 2
resume player
end, else, begin
if (hero 3 == -1) then, begin # slot (3) is free the 2 other heroes are in slot (1) and (2)...
show text box (379)
wait for text box
set tag (tag:inn case 6, on)
fake inn 2
resume player
end #end for the else begin
end
end
end # end for the while
end # end for if (nb hero == 3)
if (nb hero == 4)then, begin # all the slots are full
show text box (380)
wait for text box
set tag (tag:inn case 7, on)
fake inn 2
resume player
end # end for if (nb hero == 4)
end# end of plotscript
#---------------------------------------------------------------------------
#suite script fake inn
script, fake inn 2, begin
suspend player
if (check tag(tag: go to team)==ON) then, begin
if (pay money(500)), then, begin # we check if we have enough cash
nb hero:= 0 # nb hero comes back to zero
set tag (tag: enough cash, on)
wait (1)
resume player
end #end for if pay money
end # end for if check tag
if (check tag(tag: go to team)==Off) then, begin
wait for text box
resume player
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)
nb hero:=0
set tag (tag: inn case 8, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 1, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 2, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 3, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 4, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 5, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 6, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
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)
nb hero:=0
set tag (tag: inn case 7, off)
fade screen out
fade screen in
resume player
end, else, begin
show text box (369) # Sorry. You don't have enough cash
wait for text box
resume player
end #end for the if
#---------------------------------------------------------------------------
|
When I test my script, the text box repeats 7 times and there's also a fade out.
The other problems is that the text boxes that pops up is not the right one (which indicates a problem in hero counting) I have 2 heroes with me but the code has "stopped" when he found the first one .
So I'm waiting for your advice to embetter the code and make all this problems disappears!
As always thank you very much for your help! _________________ It's time to make games! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|