Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,280 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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