Sup,
Just bought Dark Basic Pro at Compusa today because if I used DBC any more than I would have ripped all my hair out.
Ok anyways... First off, I hear there is a discount or something. I purchased DBC from Game Creaters in January 2003. Now I purchased DBP from Compusa. Do I still get a discount if I cant prove purchase?
I started up DBP and went to some examples and showcase, and with my luck, I already received problems. Now shouldnt the built in stuff work.
Anyways here is my main purpose of the purchasing of DBP. In Classic I have been working on an item menu. Well since it is pretty much 99% impossible to do in Classic I came over to this side to try. I hear that the name of what I am looking for is called listing, queues, and stacking.
Of course the tutorials dont help so I was wondering if anyone in here could help me out. Maybe give me some easy understanding snippet examples. Here is a detailed explanation of what I am trying to do, cause most people dont understand what I'm talking about.
Say I got a menu for items. Say I have coded these simple item variables and integers.
dim item$(9)
item$(1)="Potion"
item$(2)="Sword"
item$(3)="Elixer"
dim item#(9)
item#(1)=3
item#(2)=3
item#(3)=3
Ok those are my 3 items for my menu (just keeping simple). Ok say you buy or find an item. Then the item increases by 1. Say you use, drop, or sell an item. Then the item decreases by 1. The items build up. Supposively not too hard to do.
Well say I have got set spots like so.
for x=1 to 9
text 140,20+i*25,item$(x-1)
text 320,20+i*25,STR$(item#(x-1))
next x
Umm and say that when an item equals zero it turns into the text "Empty" on the menu. Well if you dont understand here is my DBC code. Maybe you can help me transform into DBP style.
heal_menu$="Healing"
weapons_menu$="Weapons"
armor_menu$="Armor"
access_menu$="Accessories"
damage_menu$="Damage"
keys_menu$="Keys"
gift_menu$="Gift"
contain_menu$="Container"
other_menu$="Other"
waitup=20
sunglass=4
necklace_hp=4
necklace_mp=4
necklace_power=4
necklace_defense=4
necklace_mattack=4
ring_power=4
ring_hp=4
ring_mp=4
ring_heal=4
ring_antidote=4
ring_apacolypse=4
ring_icebolt=4
ring_firebolt=4
ring_earthstrike=4
bracelet_power=4
count=1
rem Start arrays
DIM Item$(15)
DIM Item#(15)
DIM Item_Description$(15)
x=35
y=60
x1=30
y1=100
x2=40
y2=140
x3=20
y3=180
x4=35
y4=220
x5=45
y5=260
x6=45
y6=300
x7=25
y7=340
x8=40
y8=380
w=text width(heal_menu$)
h=text height(heal_menu$)
w1=text width(weapons_menu$)
h1=text height(weapons_menu$)
w2=text width(armor_menu$)
h2=text height(armor_menu$)
w3=text width(access_menu$)
h3=text height(access_menu$)
w4=text width(damage_menu$)
h4=text height(damage_menu$)
w5=text width(keys_menu$)
h5=text height(keys_menu$)
w6=text width(gift_menu$)
h6=text height(gift_menu$)
w7=text width(contain_menu$)
h7=text height(contain_menu$)
w8=text width(other_menu$)
h8=text height(other_menu$)
` Everything empty to start with
ResetItems()
rem background for menu
Ink 400000,0
BOX 0,0,575,425
rem make menu raw
Ink 5000000,0
`left line
Line 0,0,0,425
Line 1,0,1,425
Line 2,0,2,425
`Middle left Line
Line 120,0,120,425
Line 121,0,121,425
Line 122,0,122,425
`right line
Line 575,0,575,425
Line 574,0,574,425
Line 573,0,573,425
`middle line
Line 0,35,575,35
Line 0,36,575,36
Line 0,37,575,37
`top line
Line 0,0,575,0
Line 0,1,575,1
Line 0,2,575,2
`bottom line
Line 0,425,575,425
Line 0,426,575,426
Line 0,427,575,427
` Text on Menu
Ink 999999999999999999999999999999,0
Perform checklist for fonts
Set text size 20
Set text font "Abaddon"
gosub click_item_menu
Text 45,10,"Item"
text 300,10,"Amount"
text 150,10,"Name"
text 470,10,"Effect"
get image 1,0,0,640,480
sync on : sync rate 50
accessories_menu:
do
sync
paste image 1,0,0
gosub click_item_menu
dec waitup,1
set text size 10
set text font "system"
rem print the Items
for i=1 to 15
if mousex()>140 and mousex()<140+text width(Item$(i-1)) and mousey()>20+i*25 and mousey()<20+i*25+text height(Item$(i-1))
ink rgb(255,255,0),0
if mouseclick()=1
if item$(i-1)="Sun Glasses" and waitup<0
waitup=20
gosub sunglass
endif
if item$(i-1)="Necklace Of Power" and waitup<0
waitup=20
gosub necklace_power
endif
if item$(i-1)="Necklace Of HP" and waitup<0
waitup=20
gosub necklace_hp
endif
if item$(i-1)="Necklace Of MP" and waitup<0
waitup=20
gosub necklace_mp
endif
endif
else
ink rgb(255,255,255),0
endif
text 140,20+i*25,Item$(i-1)
text 320,20+i*25,STR$(Item#(i-1))
text 435,20+i*25,Item_Description$(i-1)
next i
if spacekey()=1 and waitup<0
waitup=20
UpdateItemCount("Cheat Code Accessory", 1, "Does Anything")
cls
endif
if mouseclick()=2 and waitup<0
waitup=20
gosub sunglass
endif
if count<>0
count=20
UpdateItemCount("Sun Glasses", sunglass, "Too Cool To Fight")
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Necklace Of Power", necklace_power, "Adds +30 To Attack")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Necklace Of HP", necklace_hp, "Adds +100 To HP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Necklace Of MP", necklace_mp, "Adds +100 To MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Necklace Of Magic Attack", necklace_mattack, "+30 Magic Attack")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Necklace Of Defense", necklace_defense, "+30 To Defense")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Ring Of Power", ring_power, "Adds +100 To Attack")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Ring Of HP", ring_hp, "Adds +200 To HP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Ring Of MP", ring_mp, "Adds +200 To MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Magic Ring Of Healing", ring_heal, "Heal Spell +0 MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Magic Ring Of Ice", ring_icebolt, "Ice Spell +0 MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Magic Ring Of Fire", ring_firebolt, "Fire Spell +0 MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Magic Ring Of Antidote", ring_antidote, "Antidote Spell +0 MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Magic Ring Of Earth", ring_earthstrike, "Earth Spell +0 MP")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Bracelet Of Power", bracelet_power, "Adds +150 To Attack")
count=20
PASTE IMAGE 1, 0, 0
endif
if count<>0
UpdateItemCount("Ring Of Apacolypse", ring_apacolypse, "Unlimited MP")
count=0
PASTE IMAGE 1, 0, 0
endif
sync
rem end loop
loop
function ResetItems()
for Pos = 0 to 15
Item#(Pos) = 0
Item$(Pos) = "Empty"
Item_Description$(Pos) = ""
next Pos
endfunction
function UpdateItemCount(Name$, Count, Description$)
Pos = LocateItem(Name$)
Pos1 = LocateItem1(Description$)
if Pos < 0 then Pos = LocateItem("Empty")
if Pos1 < 0 then Pos1 = LocateItem1("Empty")
Item#(Pos) = Item#(Pos) + Count
if Item#(Pos) <= 0
Item#(Pos) = 0
Item$(Pos) = "Empty"
Item_Description$(Pos) = ""
else
Item$(Pos) = Name$
Item_Description$(Pos) = Description$
endif
endfunction
function LocateItem(Name$)
for Pos = 0 to 15
if Item$(Pos) = Name$ then exitfunction Pos
next Pos
endfunction -1
function LocateItem1(Description$)
for Pos = 0 to 15
if Item_Description$(Pos1) = Description$ then exitfunction Pos1
next Pos1
endfunction -1
sunglass:
PASTE IMAGE 1, 0, 0
set text size 10
set text font "system"
UpdateItemCount(Item$(i-1), -1, Item_Description$(i-1))
return
necklace_power:
PASTE IMAGE 1, 0, 0
set text size 10
set text font "system"
UpdateItemCount(Item$(i-1), -1, Item_Description$(i-1))
return
necklace_hp:
PASTE IMAGE 1, 0, 0
set text size 10
set text font "system"
UpdateItemCount(Item$(i-1), -1, Item_Description$(i-1))
return
necklace_mp:
PASTE IMAGE 1, 0, 0
set text size 10
set text font "system"
UpdateItemCount(Item$(i-1), -1, Item_Description$(i-1))
return
`Left Hand Menu For Item Menu
click_item_menu:
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,heal_menu$
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 end
else
ink rgb(255,255,255),0
rollover=1
endif
text x1,y1,weapons_menu$
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 end
else
ink rgb(255,255,255),0
rollover=1
endif
text x2,y2,armor_menu$
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 accessories_menu
else
ink rgb(255,255,255),0
rollover=1
endif
text x3,y3,access_menu$
if mousex()>=x4 and mousex()<=x4+w4 and mousey()>=y4 and mousey()<=y4+h4
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x4,y4,damage_menu$
if mousex()>=x5 and mousex()<=x5+w5 and mousey()>=y5 and mousey()<=y5+h5
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x5,y5,keys_menu$
if mousex()>=x6 and mousex()<=x6+w6 and mousey()>=y6 and mousey()<=y6+h6
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x6,y6,gift_menu$
if mousex()>=x7 and mousex()<=x7+w7 and mousey()>=y7 and mousey()<=y7+h7
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x7,y7,contain_menu$
if mousex()>=x8 and mousex()<=x8+w8 and mousey()>=y8 and mousey()<=y8+h8
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1 then end
else
ink rgb(255,255,255),0
rollover=1
endif
text x8,y8,other_menu$
return
Well thanks in advance for the help.
Nicolas
*Current Project: Untitled RPG
*Working With: Vash the Stampede 815
*Future Number: Eleventy