Ok,
I have decided I wanted to figure out how to use the Stack Commands for my menu. I am told that is what I should use if I have PRO.
Well not sure what I am doing. I thought that its pile ups of stuff. I dont know. Ok I made this very quick very simple Item menu. Well maybe not very simple but its simple enough. If you were a newb I am sure you can understand. Well the items in my menu dont sort themselves.
I got the 4 items.. They go to specific spots.. I want them to go to the empty spot nearest to the top. Well I have code for that with functions but that doesnt work for me...
Here is my code..
waitup=20
type Heal_Item
name$
heal$
heal
quantity
endtype
dim healing(10) as Heal_Item
for x=1 to 10
healing(x).name$="Empty"
healing(x).quantity=0
next x
sync on : sync rate 50
do
dec waitup,1
for x=2 to 10
text 20,x*25,healing(x-1).name$
text 150,x*25,healing(x-1).heal$
text 250,x*25,str$(healing(x-1).quantity)
next x
for x=2 to 10
if mousex()>=20 and mousex()<=20+text width(healing(x-1).name$) and mousey()>=x*25 and mousey()<=x*25+text height(healing(x-1).name$)
ink rgb(0,232,0),0
rollover=2
if mouseclick()=1
if healing(x-1).name$="Potion"
remove from stack healing(1)
dec healing(1).quantity,1
endif
if healing(x-1).name$="Super Potion"
remove from stack healing(2)
dec healing(2).quantity,1
endif
if healing(x-1).name$="Healing Water"
remove from stack healing(3)
dec healing(3).quantity,1
endif
if healing(x-1).name$="Max Heal"
remove from stack healing(4)
dec healing(4).quantity,1
endif
endif
else
ink rgb(255,255,255),0
rollover=1
endif
text 20,x*25,healing(x-1).name$
next x
if upkey()=1
add to stack healing(1)
inc healing(1).quantity,1
endif
if rightkey()=1
add to stack healing(2)
inc healing(2).quantity,1
endif
if controlkey()=1
add to stack healing(3)
inc healing(3).quantity,1
endif
if leftkey()=1
add to stack healing(4)
inc healing(4).quantity,1
endif
if healing(1).quantity<=0
healing(1).name$="Empty"
healing(1).heal$="0"
endif
if healing(2).quantity<=0
healing(2).name$="Empty"
healing(2).heal$="0"
endif
if healing(3).quantity<=0
healing(3).name$="Empty"
healing(3).heal$="0"
endif
if healing(4).quantity<=0
healing(4).name$="Empty"
healing(4).heal$="0"
endif
if healing(1).quantity>0
healing(1).name$="Potion"
healing(1).heal$="10"
endif
if healing(2).quantity>0
healing(2).name$="Super Potion"
healing(2).heal$="70"
endif
if healing(3).quantity>0
healing(3).name$="Healing Water"
healing(3).heal$="400"
endif
if healing(4).quantity>0
healing(4).name$="Max Heal"
healing(4).heal$="Full"
endif
sync
cls
loop
Well any advice on getting it to sort itself. Well since people never know what I am talking about here are good examples..
This is the order it comes in every time all the time.
Potion
Super Potion
Healing Water
Max Heal
What if I got
Empty
Super Potion
Healing Water
Well I want either potion or Max heal to end up in that empty spot.. Depending on what I add next. Or better yet I want all the items to move up a row to fill the empty.
Thanks
Nicolas
*Current Project: Untitled RPG
*Working With: Vash the Stampede 815
*Future Number: Eleventy