Hi,
Well I have this battle menu going on. Looks pretty spiffy and everything. Well the problem is the text is acting very weird when I do stuff. Here is the code:
load music "Battle.mid",1
loop music 1
run_battle$="Run"
attack_battle$="Attack"
magic_battle$="Magic"
item_battle$="Items"
dim monster$(9)
monster$(1)="Goblin"
monster$(2)="Crazed Rat"
monster$(3)="Imp"
monster$(4)="Zombie"
monster$(5)="Angry Bush"
monster$(6)="Treeling"
dim monster_hp#(9)
monster_hp#(1)=10
monster_hp#(2)=15
monster_hp#(3)=30
monster_hp#(4)=50
monster_hp#(5)=70
monster_hp#(6)=90
x=530
y=435
x1=526
y1=385
x2=525
y2=360
x3=526
y3=410
w=text width(run_battle$)
h=text height(run_battle$)
w1=text width(magic_battle$)
h1=text height(magic_battle$)
w2=text width(attack_battle$)
h2=text height(attack_battle$)
w3=text width(item_battle$)
h3=text height(item_battle$)
battle_menu:
sync on : sync rate 50
cls
rem background for menu
Ink 400000,0
BOX 0,325,625,467
rem make menu raw
Ink 5000000,0
`left line
Line 0,465,0,325
Line 1,465,1,325
Line 2,465,2,325
`right line
Line 625,465,625,325
Line 624,465,624,325
Line 623,465,623,325
`Middle 2
Line 475,465,475,325
Line 474,465,474,325
Line 473,465,473,325
`top line
Line 0,325,625,325
Line 0,326,625,326
Line 0,327,625,327
`bottom line
Line 0,465,625,465
Line 0,466,625,466
Line 0,467,625,467
`Middle Line
Line 0,350,625,350
Line 0,351,625,351
Line 0,352,625,352
do
` Text on Menu
Ink 999999999999999999999999999999,0
Perform checklist for fonts
Set text size 20
Set text font "Abaddon"
set cursor 500,328
print "Fight Options"
set cursor 25,328
print "Characters"
set cursor 225,328
print "HP"
set cursor 375,328
print "MP"
set text size 10
set text font "system"
set cursor 230,360
print "/"
set cursor 380,360
print "/"
set cursor 230,400
print "/"
set cursor 380,400
print "/"
set cursor 230,440
print "/"
set cursor 380,440
print "/"
set cursor 25,360
print "Character 1"
set cursor 25,400
print "Character 2"
set cursor 25,440
print "Character 3"
` If Run is Clicked
Set text size 20
Set text font "Abaddon"
if mousex()>=x and mousex()<=x+w and mousey()>=y and mousey()<=y+h
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x,y,run_battle$
`If Magic is clicked
Set text size 20
Set text font "Abaddon"
if mousex()>=x1 and mousex()<=x1+w1 and mousey()>=y1 and mousey()<=y1+h1
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then goto magic_battle
else
ink rgb(255,255,255),0
rollover=1
endif
text x1,y1,magic_battle$
` If Attack is Clicked
Set text size 20
Set text font "Abaddon"
if mousex()>=x2 and mousex()<=x2+w2 and mousey()>=y2 and mousey()<=y2+h2
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then goto attack_battle
else
ink rgb(255,255,255),0
rollover=1
endif
text x2,y2,attack_battle$
` If Item is Clicked
Set text size 20
Set text font "Abaddon"
if mousex()>=x3 and mousex()<=x3+w3 and mousey()>=y3 and mousey()<=y3+h3
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then goto item_battle
else
ink rgb(255,255,255),0
rollover=1
endif
text x3,y3,item_battle$
sync
loop
end
magic_battle:
do
rem background for menu
Ink 400000,0
BOX 298,165,625,325
rem make menu raw
Ink 5000000,0
`right line
Line 625,325,625,165
Line 624,325,624,165
Line 623,325,623,165
`Middle 2
Line 300,325,300,165
Line 299,325,299,165
Line 298,325,298,165
`top line
Line 298,325,625,325
Line 298,326,625,326
Line 298,327,625,327
`Middle Line
Line 298,190,625,190
Line 298,191,625,191
Line 298,192,625,192
`top line
line 298,165,625,165
line 298,166,625,166
line 298,167,625,167
Ink 999999999999999999999999999999,0
if keystate(2)=1 then mode=0
if keystate(3)=1 then mode=1
if keystate(4)=1 then mode=2
if keystate(5)=1 then mode=3
if keystate(6)=1 then mode=4
if keystate(7)=1 then mode=5
if keystate(8)=1 then mode=6
if keystate(9)=1 then mode=7
if keystate(10)=1 then mode=8
if mode=0
Text 430,305,"Page 1"
set text font "system"
text 320,195,"Spell 1"
text 320,215,"Spell 2"
text 320,235,"Spell 3"
text 320,255,"Spell 4"
text 320,275,"Spell 5"
text 500,195,"Spell 6"
text 500,215,"Spell 7"
text 500,235,"Spell 8"
text 500,255,"Spell 9"
text 500,275,"Spell 10"
endif
if mode=1
Text 430,305,"Page 2"
set text font "system"
text 320,195,"Spell 11"
text 320,215,"Spell 12"
text 320,235,"Spell 13"
text 320,255,"Spell 14"
text 320,275,"Spell 15"
text 500,195,"Spell 16"
text 500,215,"Spell 17"
text 500,235,"Spell 18"
text 500,255,"Spell 19"
text 500,275,"Spell 20"
endif
if mode=2
Text 430,305,"Page 3"
set text font "system"
text 320,195,"Spell 21"
text 320,215,"Spell 22"
text 320,235,"Spell 23"
text 320,255,"Spell 24"
text 320,275,"Spell 25"
text 500,195,"Spell 26"
text 500,215,"Spell 27"
text 500,235,"Spell 28"
text 500,255,"Spell 29"
text 500,275,"Spell 30"
endif
if mode=3
Text 430,305,"Page 4"
set text font "system"
text 320,195,"Spell 31"
text 320,215,"Spell 32"
text 320,235,"Spell 33"
text 320,255,"Spell 34"
text 320,275,"Spell 35"
text 500,195,"Spell 36"
text 500,215,"Spell 37"
text 500,235,"Spell 38"
text 500,255,"Spell 39"
text 500,275,"Spell 40"
endif
if mode=4
Text 430,305,"Page 5"
set text font "system"
text 320,195,"Spell 41"
text 320,215,"Spell 42"
text 320,235,"Spell 43"
text 320,255,"Spell 44"
text 320,275,"Spell 45"
text 500,195,"Spell 46"
text 500,215,"Spell 47"
text 500,235,"Spell 48"
text 500,255,"Spell 49"
text 500,275,"Spell 50"
endif
if mode=5
Text 430,305,"Page 6"
set text font "system"
text 320,195,"Spell 51"
text 320,215,"Spell 52"
text 320,235,"Spell 53"
text 320,255,"Spell 54"
text 320,275,"Spell 55"
text 500,195,"Spell 56"
text 500,215,"Spell 57"
text 500,235,"Spell 58"
text 500,255,"Spell 59"
text 500,275,"Spell 60"
endif
if mode=6
Text 430,305,"Page 7"
set text font "system"
text 320,195,"Spell 61"
text 320,215,"Spell 62"
text 320,235,"Spell 63"
text 320,255,"Spell 64"
text 320,275,"Spell 65"
text 500,195,"Spell 66"
text 500,215,"Spell 67"
text 500,235,"Spell 68"
text 500,255,"Spell 69"
text 500,275,"Spell 70"
endif
if mode=7
Text 430,305,"Page 8"
set text font "system"
text 320,195,"Spell 71"
text 320,215,"Spell 72"
text 320,235,"Spell 73"
text 320,255,"Spell 74"
text 320,275,"Spell 75"
text 500,195,"Spell 76"
text 500,215,"Spell 77"
text 500,235,"Spell 78"
text 500,255,"Spell 79"
text 500,275,"Spell 80"
endif
if mode=8
Text 430,305,"Page 9"
set text font "system"
text 320,195,"Spell 81"
text 320,215,"Spell 82"
text 320,235,"Spell 83"
text 320,255,"Spell 84"
text 320,275,"Spell 85"
text 500,195,"Spell 86"
text 500,215,"Spell 87"
text 500,235,"Spell 88"
text 500,255,"Spell 89"
text 500,275,"Spell 90"
endif
Text 335,170,"Push Number Key To Change Page"
if keystate(14)=1 then goto battle_menu
sync
loop
`Attack Menu
sync on : sync rate 50
attack_battle:
do
rem background for menu
Ink 400000,0
BOX 498,300,625,325
rem make menu raw
Ink 5000000,0
`right line
Line 625,325,625,300
Line 624,325,624,300
Line 623,325,623,300
`Middle 2
Line 500,325,500,300
Line 499,325,499,300
Line 498,325,498,300
`top line
Line 498,298,625,298
Line 498,299,625,299
Line 498,300,625,300
`Middle Line
Line 498,325,625,325
Line 498,326,625,326
Line 498,327,625,327
Ink 999999999999999999999999999999,0
if leftkey()=1 then mode=0
if rightkey()=1 then mode=1
if mode=0
text 540,304,"Fight"
endif
if mode=1
text 535,304,"Defend"
endif
if keystate(14)=1 then goto battle_menu
sync
loop
`Item Menu Battle
sync on : sync rate 50
item_battle:
do
rem background for menu
Ink 400000,0
BOX 298,165,625,325
rem make menu raw
Ink 5000000,0
`right line
Line 625,325,625,165
Line 624,325,624,165
Line 623,325,623,165
`Middle 2
Line 300,325,300,165
Line 299,325,299,165
Line 298,325,298,165
`top line
Line 298,325,625,325
Line 298,326,625,326
Line 298,327,625,327
`Middle Line
Line 298,190,625,190
Line 298,191,625,191
Line 298,192,625,192
`top line
line 298,165,625,165
line 298,166,625,166
line 298,167,625,167
Ink 999999999999999999999999999999,0
if keystate(2)=1 then mode=0
if keystate(3)=1 then mode=1
if keystate(4)=1 then mode=2
if keystate(5)=1 then mode=3
if keystate(6)=1 then mode=4
if keystate(7)=1 then mode=5
if keystate(8)=1 then mode=6
if keystate(9)=1 then mode=7
if keystate(10)=1 then mode=8
if mode=0
Text 430,305,"Page 1"
set text font "system"
text 320,195,"Item 1"
text 320,215,"Item 2"
text 320,235,"Item 3"
text 320,255,"Item 4"
text 320,275,"Item 5"
text 500,195,"Item 6"
text 500,215,"Item 7"
text 500,235,"Item 8"
text 500,255,"Item 9"
text 500,275,"Item 10"
endif
if mode=1
Text 430,305,"Page 2"
set text font "system"
text 320,195,"Item 11"
text 320,215,"Item 12"
text 320,235,"Item 13"
text 320,255,"Item 14"
text 320,275,"Item 15"
text 500,195,"Item 16"
text 500,215,"Item 17"
text 500,235,"Item 18"
text 500,255,"Item 19"
text 500,275,"Item 20"
endif
if mode=2
Text 430,305,"Page 3"
set text font "system"
text 320,195,"Item 21"
text 320,215,"Item 22"
text 320,235,"Item 23"
text 320,255,"Item 24"
text 320,275,"Item 25"
text 500,195,"Item 26"
text 500,215,"Item 27"
text 500,235,"Item 28"
text 500,255,"Item 29"
text 500,275,"Item 30"
endif
if mode=3
Text 430,305,"Page 4"
set text font "system"
text 320,195,"Item 31"
text 320,215,"Item 32"
text 320,235,"Item 33"
text 320,255,"Item 34"
text 320,275,"Item 35"
text 500,195,"Item 36"
text 500,215,"Item 37"
text 500,235,"Item 38"
text 500,255,"Item 39"
text 500,275,"Item 40"
endif
if mode=4
Text 430,305,"Page 5"
set text font "system"
text 320,195,"Item 41"
text 320,215,"Item 42"
text 320,235,"Item 43"
text 320,255,"Item 44"
text 320,275,"Item 45"
text 500,195,"Item 46"
text 500,215,"Item 47"
text 500,235,"Item 48"
text 500,255,"Item 49"
text 500,275,"Item 50"
endif
if mode=5
Text 430,305,"Page 6"
set text font "system"
text 320,195,"Item 51"
text 320,215,"Item 52"
text 320,235,"Item 53"
text 320,255,"Item 54"
text 320,275,"Item 55"
text 500,195,"Item 56"
text 500,215,"Item 57"
text 500,235,"Item 58"
text 500,255,"Item 59"
text 500,275,"Item 60"
endif
if mode=6
Text 430,305,"Page 7"
set text font "system"
text 320,195,"Item 61"
text 320,215,"Item 62"
text 320,235,"Item 63"
text 320,255,"Item 64"
text 320,275,"Item 65"
text 500,195,"Item 66"
text 500,215,"Item 67"
text 500,235,"Item 68"
text 500,255,"Item 69"
text 500,275,"Item 70"
endif
if mode=7
Text 430,305,"Page 8"
set text font "system"
text 320,195,"Item 71"
text 320,215,"Item 72"
text 320,235,"Item 73"
text 320,255,"Item 74"
text 320,275,"Item 75"
text 500,195,"Item 76"
text 500,215,"Item 77"
text 500,235,"Item 78"
text 500,255,"Item 79"
text 500,275,"Item 80"
endif
if mode=8
Text 430,305,"Page 9"
set text font "system"
text 320,195,"Item 81"
text 320,215,"Item 82"
text 320,235,"Item 83"
text 320,255,"Item 84"
text 320,275,"Item 85"
text 500,195,"Item 86"
text 500,215,"Item 87"
text 500,235,"Item 88"
text 500,255,"Item 89"
text 500,275,"Item 90"
endif
Text 335,170,"Push Number Key To Change Page"
if keystate(14)=1 then goto battle_menu
sync
loop
Ok here is my problem. The problem only appears to happen in DBC though. Tried in the pro demo and it works fine.
When you click the Attack option it works normal. The problem comes in when you click the Item and Magic portion of the menu. Oh if I forgot to mention, the code also works fine when running code straight from DBC. The problems come from the standalone executable.
Well anyways, When you click the Item and menu portion, the mouseclick portion variables start blinking between default size and the set size. Its crazy because it doesnt do this when you click the Attack. It uses the same code but yet same.
IanM recommended that I used the Get Image command for all my text because changing text sizes is know to have errors. I would do that but I dont know how to use the Get Image command for text.
Terabyte recommended that I fixed up my syncs a little. I dont know what it has to do with syncs.
Please if you can help my problem please do. The added files are the ones that came with DBC and can be deleted with no problem.
Please anyone who can please help.. BTW: Comment on my work.
Thanks
Nicolas
*Current Project: Untitled RPG
*Working With: Vash the Stampede 815
*Future Number: Eleventy