First, I can almost guarantee that I'm not writing this the most efficient way. If you have any suggestions just let me know.
Here are the issues:
1) When you close the menu with ESC, it will occasionally bring the menu right back up as opposed to properly closing out of it.
2) You can occasionally make part of the menu open while the hero is walking.
Both of these issues have pretty rare occurrences, but they happen nonetheless. I'd like to fix them if at all possible. Any help would be appreciated.
Code:
plotscript,menu,begin
if (current text box == -1) then (
free slice (menuslice)
variable (i)
for (i,10,18,1) do (
clear string (i)
)
if (hero is walking (hero:Fred) == false) then (
if (key is pressed (key: esc), or, key is pressed (key: alt)) then (
suspend player
menuslice := load slice collection (4)
flvl := get hero level (find hero(hero:Fred))
fmc := get hero stat (find hero(hero:Fred),stat:Mastery)
fmm := get hero stat (find hero(hero:Fred),stat:Mastery,maximum stat)
fhc := get hero stat (find hero(hero:fred),stat:Health)
fhm := get hero stat (find hero(hero:fred),stat:Health,maximum stat)
fexp := experience to next level (find hero(hero:Fred))
pmon := party money
append number (10,flvl)
append number (11,fmc)
append number (12,fhc)
append number (13,fexp)
append number (14,fmm)
append number (15,fhm)
append number (18,pmon)
$16 ="/"
$17 ="/"
11 $+ 16
11 $+ 14
12 $+ 17
12 $+ 15
show string at (10,105,10)
show string at (11,120,30)
show string at (12,115,20)
show string at (13,160,40)
show string at (18,260,190)
open menu (0)
while (key is pressed (key: esc), or, key is pressed (key: alt)) do (
wait (1)
)
resume player
)
)
)
wait for all
end
plotscript,cmenu,begin
free slice (menuslice)
variable (i)
for (i,10,18,1) do (
clear string (i)
)
wait for all
end
if (current text box == -1) then (
free slice (menuslice)
variable (i)
for (i,10,18,1) do (
clear string (i)
)
if (hero is walking (hero:Fred) == false) then (
if (key is pressed (key: esc), or, key is pressed (key: alt)) then (
suspend player
menuslice := load slice collection (4)
flvl := get hero level (find hero(hero:Fred))
fmc := get hero stat (find hero(hero:Fred),stat:Mastery)
fmm := get hero stat (find hero(hero:Fred),stat:Mastery,maximum stat)
fhc := get hero stat (find hero(hero:fred),stat:Health)
fhm := get hero stat (find hero(hero:fred),stat:Health,maximum stat)
fexp := experience to next level (find hero(hero:Fred))
pmon := party money
append number (10,flvl)
append number (11,fmc)
append number (12,fhc)
append number (13,fexp)
append number (14,fmm)
append number (15,fhm)
append number (18,pmon)
$16 ="/"
$17 ="/"
11 $+ 16
11 $+ 14
12 $+ 17
12 $+ 15
show string at (10,105,10)
show string at (11,120,30)
show string at (12,115,20)
show string at (13,160,40)
show string at (18,260,190)
open menu (0)
while (key is pressed (key: esc), or, key is pressed (key: alt)) do (
wait (1)
)
resume player
)
)
)
wait for all
end
plotscript,cmenu,begin
free slice (menuslice)
variable (i)
for (i,10,18,1) do (
clear string (i)
)
wait for all
end
Cornbread Chemist



