Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (AndrewAMD), 14,661 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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