 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
GlimDoll
Joined: 09 Jun 2008 Posts: 12
|
Posted: Mon Jun 23, 2008 7:23 am Post subject: |
|
|
The Mad Cacti wrote: | GlimDoll wrote: |
bring menu forward (3)
bring menu forward (4)
bring menu forward (7)
bring menu forward (
bring menu forward (9)[/code]
I added the bring menu forward as I thought it would push them to the front...but it didn't. |
bringmenuforward takes a menu handle as an argument, not a menu ID. Nearly all menu commands work with menu and menu item handles. So to move menu 3 to the front you'd write
Code: | bring menu forward (find menu ID (3)) |
But the better solution is to just open the menus in the order of bottommost to topmost that you want them - unless you're saying that that didn't work.
|
Ok also, this doesnt work either. For some reason, the newer menu's do not go to the front. Also, the menus are not pushed to the front with the way you told me to use "bring menu forward (find menu ID (3))" |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jun 23, 2008 7:38 am Post subject: |
|
|
The menu item caption problem was easily fixed.
If you're not using the nightlies, an easy work around is to add a space to the beginning and end of each of those menu items.
I found the reason that the menus weren't displaying on top of the other ones: you have to turn on the "Allow Gameplay" menu bitset, otherwise the menu display script won't run because scripts aren't being processed, which means it won't bring up the other menus until you close those onscreen (and the script is finally run).
Also, instead of 4 copies of heroselect, just use one, and make it take one argument. This script will then get given the menu item handle of the slot that you selected. You can use this handle to read the hero number from either one of the 'Extra Data' fields, or just use the number of the slot. Eg:
Code: | plotscript, hero select, handle, begin
variable (hero)
hero := get menu item extra (handle, 0)
#or
hero := menu item slot (handle)
herobody := getherostat(hero by rank (hero), stat:body, currentstat)
#...
end |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
GlimDoll
Joined: 09 Jun 2008 Posts: 12
|
Posted: Mon Jun 23, 2008 10:15 am Post subject: |
|
|
Ok, I think I have figured out somethings...I am a bit confused as to how the hero by rank, find hero, rank in caterpillar, and hero slot work...But here is my code. Code: |
plotscript, hero select, handle, begin
variable (herochoice)
herochoice := get menu item extra (handle, 0)
herobody := getherostat(herochoice, stat:body, currentstat)
heromind := getherostat(herochoice, stat:mind, currentstat)
herosoul := getherostat(herochoice, stat:soul, currentstat)
open menu (3)
open menu (4)
open menu (7)
open menu (8)
open menu (9)
bring menu forward (find menu ID (5))
end |
I was trying to get the way you showed me below to work... Code: | herobody := getherostat(hero by rank (herochoice), stat:body, currentstat) |
It kept giving me the wrong numbers. So I took out hero by rank. And now it works fine...but I do not understand why it works without hero by rank. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jun 23, 2008 1:01 pm Post subject: |
|
|
Opps, sorry, I should have thought about it instead of just repasting code. Using hero by rank is wrong.
There are 3 ways to refer to a hero. Remember the complication that you can have multiple copies of a hero in your party, so using ID numbers (constants like 'hero:Bob') won't do: it's only used for adding and finding heroes. The main way is by the position in the battle party, 0-40. This is used for referring to nearly all data for an instance of a hero (eg setherostat, setexperience, getheroname). The battle party position is returned by findhero. Finally, there's the caterpillar party position, which is used only for moving the heroes around the map.
You're using the ${c#} tag, for position in the caterpillar party, and need position in the battle party to read stats. These are normally the same, except when you rearrange your party in the Order menu leaving empty slots in the (battle) party.
So you should use
Code: | herochoice := find hero (hero by rank (get menu item extra (handle, 0))) |
(Note that this can't actually handle multiple copies of a hero in the party, which sucks) _________________ "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
|