Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Need help... Its Sorta Kinda Menu/Item Related

Author
Message
The Lone Programmer
21
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 7th Oct 2003 06:49
Hi I got some nice menus going down and now I am working on Items and stuff.

My question is. Say I have a sword in my item menu. I want to click the sword and have it go into the equip menu. I want to use the minimal amount of code as possible.

Say I have my game start out with 3 potions. When I use a potion how do I make it so it says I got 2 left? How do I make it so when I use all of them, potion disappears off my list entirely until I find or buy one?

How do I move my mouse over a line of text and get a rollover text that disappears when I remove the mouse?

If these questions could be asnwered I would really appreciate it. I have DBC.

I know how to use GOSUB, GOTO and some other stuff. Dont know how to use functions so please if you explain with a function please explain.

Thanks for the help. I post in codebase soon.
Nicolas

Future Company Name = Blazing Fire
Current Website Name = Blazing Fire
Future Number is Eleventy
zzabb
21
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 7th Oct 2003 08:26
well how i do it is with if statements
not sure how you have your menus setup, but something like

potions$=str$(potions)
if potions>0 then text 50,50,"potion name"+""+potions$

or if you have several potions then give each one a separate variable
I keep the text placement by inc the carried objects variable I use it to keep track of all objects and object placement


1potions$=str$(1potions)
if 1potions>0
inc carriedobjects
text 50, carriedobjects * 50,"potion name"+""+1potions$
endif

2potions$=str$(2potions)
if 2potions>0
inc carriedobjects
text 50, carriedobjects * 50,"potion name"+""+2potions$
endif

3potions$=str$(potions)
if 3potions>0
inc carriedobjects
text 50, carriedobjects * 50,"potion name"+""+3potions$
endif


hope it helps

My advice is free -
unfortunately you get what you pay for (-:
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th Oct 2003 15:02
Functions are very simple. Heres an example of a print command that sets the cursor

Function SuperPrint(X,Y,String$)
Set cursor x,y
Print String$
Endfunction

Then declare the function in your code

str$="Hello World!"
SuperPrint(10,10,str$)

Simple eh?

RPGamer

Current Project: Eternal Destiny
We need a texture artist!
If your interested email me - Johnrocs@aol.com

Login to post a reply

Server time is: 2024-11-25 11:29:43
Your offset time is: 2024-11-25 11:29:43