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 Professional Discussion / Commands (Help needed)

Author
Message
CocaCola
16
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 10th Aug 2010 00:43 Edited at: 10th Aug 2010 07:17
Well for testing purposes I need something like a textbox on my screen where when I type a command it will do that (I know how i'm gonna make the commands) but how do I make the textbox so when I click on it I can type in it and then how could I make it so when.. hmm.. how to word this.. say in the textbox you typed in something like "command" how could you check if he typed it??

I want coke, not Pepsi!
lms
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 10th Aug 2010 02:28 Edited at: 10th Aug 2010 02:30
if u want a windowslike textbox then u need a gui like bluegui or some free gui ,after putting it and start using it u ll learn how to handle events
u can use input command to get user "strings" but i guess u know that
do
cls
print
input " give command : ",string$
print " he typed: "+string$
wait key
sync
loop

all os break
swissolo
16
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 10th Aug 2010 02:43

like that?(- the textbox)

swis
CocaCola
16
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 10th Aug 2010 03:05
I tried that code swiss, do I have to put that in my code cause when I tested it it didn't do anything

I want coke, not Pepsi!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Aug 2010 18:47
I'm not sure what you are asking.... Are you wanting an in-game command prompt like some games use the "~" key to enter the command mode. Then there are command combinations that cause things to hapen like:
"player 1 health 50"
This command will (for instance) set player 1's health to 50....

Is that what you are wanting?

The fastest code is the code never written.
CocaCola
16
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 10th Aug 2010 20:51 Edited at: 10th Aug 2010 21:14
@Hawblood something like you press something like ~ and a textbox appears and pauses the game, or would the input command do that?

something like

and then later on

Would that work?

I want coke, not Pepsi!
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 10th Aug 2010 21:36
Well..... Some games will pause if you enter the "command mode". It depends on what you want.

The command mode will be enabled and disabled by the "~" key. When enabled, anything you type is placed on the current line. When the [ENTER] key is pressed, the command you typed is parsed and identified to do a specific thing.
So you have a routine that parses the line:
"set player 1 health 50"
you break up the line:
psudo-code


That's basically how it's done. You have to make it specific to your game.

The fastest code is the code never written.

Login to post a reply

Server time is: 2026-07-25 23:12:04
Your offset time is: 2026-07-25 23:12:04