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.

DarkBASIC Discussion / Input that doesn't stop the program?

Author
Message
SpellSword
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 29th Oct 2002 19:29
Is there some whay that the user/player can be able to
type in a command at any give time (Example: Open Door)
while other things are happening? (There has to be an easy
solution I'm missing here.)


I'm trying to make a real-time text based RPG (With 1 or
2 images) and I'm hoping that there's some way to make a
area/field/section where the user/player can type well the
rest of the program is running.

(I still don't know how to make it do two things at once
lol, it can do that right?)
------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 29th Oct 2002 20:35
Yeah, you can't use the input command for that. The input command is pretty useless except for a bit of quick testing or simple programs. Check out Entry$() and Clear entry buffer.
SpellSword
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 29th Oct 2002 22:40
I took a look at the example for 'Clear entry buffer' but
I'm not completly sure how to utilize this.

I looks like the command I need to use though.

Could you point me in the right direction of how it
should be used?

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 30th Oct 2002 09:54
you my friend, need to use event driven code which i just happen to have a snippet for, here ya are, happy coding, if you need more help feel free to ask...hmm no uploading lemme see....

http://jerico2day.tripod.com/snippet.zip

you may need to copy and paste that into your browser window if the download fails to load...
SpellSword
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 30th Oct 2002 19:30
Thanks I'm Downloading it right now.

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
SpellSword
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 1st Nov 2002 04:06
This 'snippet' is code that move abunch of 3d object
around, I couldn't figure most of it out (I'm just
working with 2D and text right now)

I'm trying to create a game that uses 'mostly' text,
when you move from one location to another a Text
discription of the new area will popup, that I can do
with no problem using the input command. But I can't
do combat (Easyly, maybe not at all) with input alone.

What I'm looking for is some way that things can be
happening and well it's running through that set of
code at any time the user/player can type in a command
without stopping the game.

(I'm trying for a Real-Time text RPG with afew images here
and there. I've learned alot as I've tryed to make this
project and I'm having alot of fun so far )

Hmmm, what game can I name as an example?...
Zork, Tele-Arena (The text only one not the other one), ect.

An idea what I need to do?
(If the solution was indeed in that code snippet then I'm
just not skilled enough with DB to see it yet with out some
one pointing the string of code I need see out. )

------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 1st Nov 2002 04:23
u shoulda looked at the code closer it shows how to do that, but lemme see, what you need is this

do

dostuff
checkinput

loop

function checkinput()

userinput$ = userinput$ + inkey$()
if returnkey() = 1 then userinput$ = ""

endfunction

i think thatll work, but its untested, kinda gives you an idea of what you need to do tho
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 1st Nov 2002 04:26
better yet on that line
if returnkey() = 1 then userinput$ = ""

instead put
if returnkey() = 1 then processinput() : userinput$ = ""


you will also have to be careful using functions because normal vars will not carry over into functions and vice versa, use arrays if you are going to be passing a bunch of variables in and out of functions...
SpellSword
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: Cyberspace
Posted: 1st Nov 2002 04:33
Hmmmm. Yes... YES! Thats exactly what I need!
Thanks I'll start experimenting with that right away!


------------------------------------------
When I dream, I carry a sword in one hand,
and a gun in the other...

Login to post a reply

Server time is: 2024-04-25 00:02:40
Your offset time is: 2024-04-25 00:02:40