Product Chat / At last! Scancodes!

Author
Message
Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 6th Mar 2015 12:46
Quote: "New LUA command added: GetInKey() which will return the character string of the key currently pressed
New LUA command added: GetScanCode() which will get the scancode of the key currently pressed "


I just noticed this in the latest update announcement (v. 1.00.015). Very nice! Thank you, TGC. Now I really have to polish my Lua skills!
MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 6th Mar 2015 14:39
Only just been tinkering checking stuff myself. Good timing this one. At last!


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
GoDevils
10
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 7th Mar 2015 06:01
Would helpful if we had an idea of which keys TGC plans to use in the future (beyond the ones they already use). That way, we can avoid developing key controls now, only to find down the road that TGC will be using those keys for something else.
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
Jerry Tremble
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 5th Nov 2012
Location: Sonoran Desert
Posted: 7th Mar 2015 12:32 Edited at: 7th Mar 2015 12:33
Quote: "Would helpful if we had an idea of which keys TGC plans to use in the future (beyond the ones they already use). That way, we can avoid developing key controls now, only to find down the road that TGC will be using those keys for something else."


Good point, but if they do eventually use a key for some unforeseen function, reassigning a keycode value to another key shouldn't be too difficult. (They are constants). To be safe, I would just use anything from T, G or V and to the right of those. That leaves Q, R, Z and X still available to them!
MAME Cab PC: i7 4770@3.4Ghz (passmark 9945), 12GB RAM, Win 8.1/64, GeForce GTX645 (passmark 1898); Shiny new laptop: i7 4800MQ@2.7Ghz (passmark 8586), 16GB RAM, Win 8.1/64, GeForce GTX870M (passmark 3598); Old laptop: i5@2.3Ghz, 8GB RAM, Win 7/64, Intel 3000 graphics
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th Mar 2015 14:32
Is pretty nice to get control over keycode, because you can break the barrier of g_KeyPressE == 1.
However, I can not help thinking of a game in which the player has to memorize dozens of keys to play.
I think give more prominence to the mouse click event could help.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 7th Mar 2015 14:50
Quote: "However, I can not help thinking of a game in which the player has to memorize dozens of keys to play."

Starcraft

This was my most important feature Just happy now
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Mar 2015 16:03 Edited at: 7th Mar 2015 16:12
Quote: "Starcraft"


lol so true, having to try guess hotkeys was fun though when you're not used to a race

but i dont seem to have this update, anybody have those commands or just an error on the update log?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 7th Mar 2015 16:23
What version do you have SmallG in the about screen.

You may have to log out of steam and back into steam to force the update.
should be this morning .016 mp bld 796

the MP part displays in the lobby section
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

GoDevils
10
Years of Service
User Offline
Joined: 24th Sep 2014
Location: Arizona USA
Posted: 7th Mar 2015 16:42
All great comments, and I agree with the concern about having too many key codes.

Sometime ago I (and others) made feature suggestions that would allow the mouse to be toggled (one key) and released as the directional and firing tool, and returned to a state where you point and click at the 2D screen. I did this in a game I built in DBPro, and it worked very well. Options could be placed on the screen, and with their locations known, this could control things, and give the player a prompt as to effect. That would be a lot cleaner than asking a new player to learn 6-10 key codes.

Just a thought.
"THERE IS NO SPOON"

AMD 6300 6 core 3.5 ghz, Windows 8.1, 8GB ram, GTX 650 2GB ram
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Mar 2015 16:57
seems the GetInKey() works but not GetScanCode() - can't see either in the global though (using .016 - updated it today)

GetScanCode() returns a nil error for the call

btw did anyone else notice the single door has vanished? double doors are there but the original single door is gone - just me?
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 7th Mar 2015 17:21
GetScancode() works OK for me (lower case c in code?)

I get an in engine error if I press the "\" key though .
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Mar 2015 17:36
haha yh that worked, just the small c
as for the error it's because they put an extra " in their code - good to see the pro's make those mistakes too
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Lance
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 7th Mar 2015 18:34
"btw did anyone else notice the single door has vanished? double doors are there but the original single door is gone - just me?"

Yes it is gone . It was for combat building (Sandstone Structure 1 (I believe )) . I checked version 1.006 and is was in there . Glad I make backups of stuff ,sometimes too many and I get mixed up ...
Lance
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 7th Mar 2015 20:59
Quote: "Starcraft"

Sure!

Quote: "as for the error it's because they put an extra " in their code - good to see the pro's make those mistakes too"


Anyway, they sould debug code before release.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 7th Mar 2015 22:21
Finally.
i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce 420 GT
Ravey
Retired TGC Developer
22
Years of Service
User Offline
Joined: 2nd Nov 2002
Location: Southern TGC Nerve Centre
Posted: 9th Mar 2015 11:26
HI guys,

Thanks for spotting the error when pressing "\". Backslash is an escape code in LUA (like many other languages) so if you do actually press it, I needed to send it as \\ rather than \.

I have fixed it so the next patch will not have this issue.
Dave Milton

TGC Team
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 9th Mar 2015 17:17
Like regular expression does (RegeX).
... and this extra (") as smallg point to above, I hope so.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 8.1 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
RustyNuts
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 12th Mar 2015 21:35
So how do you use them as i've tried but with no luck. I must be really thick!!! lol
Lenovo G700 Laptop,i3-6gb ram,Nvidia GT720m
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Mar 2015 22:03
if GetInKey() == "a" then
or
if GetScancode() == 28 then
etc
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
RustyNuts
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 9th Nov 2011
Location: Warwickshire Great Britain
Posted: 12th Mar 2015 22:44
Thanks smallg I was putting the key to scan in the wrong place (GetInKey("a") == 1) what a wally!!!!! lol its been a long day!!
Lenovo G700 Laptop,i3-6gb ram,Nvidia GT720m
PM

Login to post a reply

Server time is: 2024-11-23 03:26:12
Your offset time is: 2024-11-23 03:26:12