 |
Castle Paradox
|
| View previous topic :: View next topic |
| Author |
Message |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jan 06, 2008 4:36 am Post subject: Re: after some reflexion |
|
|
| 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)
|
But it's also possible that slot 0 is empty, unless you are somehow preventing this! If not, there are in fact 15 cases.
| bis_senshi wrote: | | Code: | 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)
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) |
|
You don't actually use these variables anywhere. Why do you want to save the money and HP of the heroes? Are you going to use them later?
| msw188 wrote: | | Code: | | #The +1 is because there is no string with ID number zero. |
|
No, strings are numbered from 0 to 31. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Jan 08, 2008 12:41 am Post subject: I think I understand why... |
|
|
| The Mad Cacti wrote: |
it's also possible that slot 0 is empty
|
Well, when you moves heroes in the order, it's impossible to have no hero on slot 0 because the player needs to see a hero moving when he/ she presses the arrow keys.
| The Mad Cacti wrote: |
| Code: |
set variable (MyMoney, party money)
get money (MyMoney) #prevents Hspeak from saying the variable is unused
lose money (MyMoney)
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) |
You don't actually use these variables anywhere. Why do you want to save the money and HP of the heroes? Are you going to use them later?
|
I fact I use this variables to make appear the current stats of the heroes in the text boxes.
I understood why hero counting is not right. In my first part of the script I made a bunch "if"... end, else, begin. This kind of line are when you are searching for something and when you want the stop when it returns true, which is not the case here.
Each slot has to be checked and the variable has to be incremented each time a hero has been found.
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: Tue Jan 08, 2008 5:14 am Post subject: Re: I think I understand why... |
|
|
| bis_senchi wrote: | | The Mad Cacti wrote: |
it's also possible that slot 0 is empty
|
Well, when you moves heroes in the order, it's impossible to have no hero on slot 0 because the player needs to see a hero moving when he/ she presses the arrow keys. |
I just tried it, it is possible to have no hero in slot 0.
| bis_senchi wrote: | | The Mad Cacti wrote: |
| Code: |
set variable (MyMoney, party money)
get money (MyMoney) #prevents Hspeak from saying the variable is unused
lose money (MyMoney)
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) |
You don't actually use these variables anywhere. Why do you want to save the money and HP of the heroes? Are you going to use them later?
|
I fact I use this variables to make appear the current stats of the heroes in the text boxes. |
Oh! I missed that. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Jan 08, 2008 11:54 am Post subject: Re: I think I understand why... |
|
|
| bis_senchi wrote: |
Well, when you moves heroes in the order, it's impossible to have no hero on slot 0 because the player needs to see a hero moving when he/ she presses the arrow keys.
|
You are confusing caterpillar slots with party slots. With caterpillar slots there is always a hero 0. With party slots there might not be.
caterpillar slots used with any command that moves the hero walkabouts on the map.
party slots are for everything else, like stat manipulation or equipment manipulation |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Wed Jan 09, 2008 10:57 pm Post subject: Party slot is what I need! |
|
|
| James Paige wrote: |
caterpillar slots used with any command that moves the hero walkabouts on the map. Party slots are for everything else, like stat manipulation or equipment manipulation.
|
You are right. Party slot is what I need. How do I check if this kind of slot is empty?
As always thank you very much for your help! _________________ It's time to make games! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Jan 10, 2008 8:49 pm Post subject: |
|
|
Use 'plot:hero by slot' instead of hero by rank. Test in the same way:
| Code: | | if (hero by slot (0) <> -1) then ( # theres a hero in slot 0 |
_________________ "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 11, 2008 11:02 pm Post subject: Now all I need is... |
|
|
All right. Here again the first part of the script (it will prevents from searching for my old posts)
| Code: |
script, inn first version, 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.
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)
if (hero by slot (1) <> -1) then, begin
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 by slot (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 by slot (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
|
The problem with the code above is that the script stops when a slot with a hero in has been found. Could somoene help me to modify the code so that all the slots, one after another can be check.
I appears to be a good idea to delete the lines with "end, else, begin" in it but I'm afraid that it makes the script ends before it should be.
Any suggestions of improvements are welcomed.
Good luck in making your games 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: Sat Jan 12, 2008 1:37 am Post subject: Re: Now all I need is... |
|
|
| bis_senchi wrote: | The problem with the code above is that the script stops when a slot with a hero in has been found. Could somoene help me to modify the code so that all the slots, one after another can be check.
I appears to be a good idea to delete the lines with "end, else, begin" in it but I'm afraid that it makes the script ends before it should be. |
Your problem is that you didn't indent your script. If you did, you could safely delete any else and know exactly what you would be doing. Do you know how to indent? I can't find any generic tutorials on the net.
Anyway, you want to structure your script like this:
| Code: | if (hero by slot (0) <> -1) then, begin
#hero 0 stats
end
if (hero by slot (1) <> -1) then, begin
#hero 1 stats
end
if (hero by slot (2) <> -1) then, begin
#hero 2 stats
end
if (hero by slot (3) <> -1) then, begin
#hero 3 stats
end
|
_________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Jan 14, 2008 10:28 am Post subject: Help to use this command. |
|
|
I'm using the following command
| Code: |
get hero name (3,find hero(hero by rank(3)))
|
Under Custom I put ${0} but when I test the whole the hero's name don't appear. Does somoene understand why? _________________ It's time to make games! |
|
| Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Jan 14, 2008 10:48 am Post subject: |
|
|
You're storing the name into string 3. You should use ${S3} or get hero name(0, find hero(hero by rank(3))). _________________
|
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jan 14, 2008 5:26 pm Post subject: |
|
|
And remember, you're meant to be using hero by slot instead of hero by rank _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Jan 15, 2008 11:58 pm Post subject: After a few more tests |
|
|
All right! The little problem that left is that sometimes I see ${42} appearing instead of the stat stored in the global variable.
I think that it may be due to lack of time. Has anyone ever seen something like that?
A always thanks for keeping answering my questions! _________________ It's time to make games! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Jan 17, 2008 4:46 pm Post subject: |
|
|
You forgot the V: ${V#} _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Jan 17, 2008 11:13 pm Post subject: Are you sure about ${V3} ? |
|
|
All right so I use first to store in the string
| Code: |
get hero name(3, find hero(hero by rank(3)))
|
And then ${S3}. (Are you sure about ${V3} ? S stands for "string isn't it?")
I've made tests and the script works with ${S3} but the problem is that sometimes figures don't appear as if they weren't been stored.
Has somoene already have this kind of problem? _________________ It's time to make games! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Jan 18, 2008 2:15 am Post subject: |
|
|
But you were asking about embedding a global variable into a textbox. ${V#} is for global variables, and ${S#} is for strings. _________________ "It is so great it is insanely great." |
|
| 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
|