Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
getting keystrokes in a string #237869
11/23/08 01:50
11/23/08 01:50
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
Hi,
I would like to have the player enter his (her) name in a string. I am trying to use inkey(plyername) but I move the player with the arrow up, arrow down etc and these arrows abort inkey.
Are there other ways to allow the player to enter info?
Thanks
Gerrit
PS. I did define playername as a string. So no problem there

Re: getting keystrokes in a string [Re: Gerrit] #237881
11/23/08 04:58
11/23/08 04:58
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
You can use the inkey_active command to see if the player is trying to input commands and then use inkey_active to disable player movement while the player is typing.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: getting keystrokes in a string [Re: heinekenbottle] #237921
11/23/08 17:30
11/23/08 17:30
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
I can indeed use inkey_active to verify that the player is entering text but can I somehow disable the cursur keys? Even if I dissable player movement the player can still hit the cursor keys and abort the inkey process.

Re: getting keystrokes in a string [Re: Gerrit] #238385
11/27/08 00:07
11/27/08 00:07
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
just reenable it if a cursor key is pressed

Re: getting keystrokes in a string [Re: MrGuest] #238417
11/27/08 04:30
11/27/08 04:30
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
Thanks I solved the problem just like you suggested. Put the inkey in a do loop until the player hits the enter key or the tab key

Best regards
Gerrit


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1