Off Topic / Need Scan codes for keyboard in game

Author
Message
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Feb 2015 11:44 Edited at: 4th Feb 2015 11:45
Please give me somebody the Scan codes for keyboard in game.

I've try to find it but no one correct results of key codes for GAMEPROFILE in the "setup.ini" file.





Thanks in advance !

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Feb 2015 12:03 Edited at: 4th Feb 2015 14:28
Found it the keyboard scan codes at

http://www.thegamecreators.com/pages/newsletters/newsletter_issue_57.html

Scroll down in that page to find the "Custom Keys" chapter (article).

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."

Attachments

Login to view attachments
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Feb 2015 14:01 Edited at: 4th Feb 2015 16:30
I have no clue where can I make a new key to use it in game... Custom Keys

I've read the tutorial but I'm still in fog

For example, I need player to use the "n" key for activate the "night vision"

- for "n" letter is assignee "49" (key code)

- or "v" letter = "47" key code.

Any help please ?

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 4th Feb 2015 16:34 Edited at: 4th Feb 2015 16:39
I've try to use "argument" for "v" key, but sure I mist something...



Any idea please ?

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 5th Feb 2015 12:55
I think you can use other keys with tomjscott's Omegacore plugin. Without Omegacore, you can only use the 'E' key.
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 5th Feb 2015 20:46 Edited at: 5th Feb 2015 20:51
I've downloaded the Omegacore v 107a, but there is just a "omegacore.dll" and "omegacore.docx" file.

How can I use that Omegacore to change the key ?



https://www.dropbox.com/s/7flh5dtcn9sekj4/Omega%20Core%20-%20v107a.zip?dl=0

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 5th Feb 2015 23:31
The docx file has instructions for installing and adding the plugin in the global.lua script file. But here you go:

Copy the omegacore.dll file into your main Reloaded directory (e.g. C:\\Program Files (x86)\\The Game Creators\\FPS Creator Reloaded).

To use the extension library. Add the following lines of code to the top of the global.lua script.



Then you can do something like the following:



If you have errors from missing OpenAL32.dll then follow directions in the docx file to get the dll or find it on the web and install OpenAL.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 6th Feb 2015 09:43 Edited at: 6th Feb 2015 10:03
When I put the first script in the top of global.lua I've got a lot of script errors like "weapon_name - must have a nill value at line 5" and more other similar errors.

Maybe need some "toggle" command to not altered the default "E" key for "use", for example to can use "Shift + E" for activate the Night Vision in the nightvision.lua script ...

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 6th Feb 2015 09:50 Edited at: 6th Feb 2015 09:54
Here is my global.lua with your omegacore in the top of script:



And here is my nightvision.lua (by smallg) :



Maybe can you help me @ tomjscott ?

Thanks in advance

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 6th Feb 2015 14:53 Edited at: 6th Feb 2015 14:54
I tried this with a fresh install of Reloaded and it worked fine for me. I put the omegacore stuff at the top of global.lua and even used the provided nightvision script and it works fine with the E key. The omegacore input does not affect the default E key behavior.



The only thing I didn't do was the actual loading and showing images code in this script because I don't have the images and didn't have time to find them and download them. So, with just the load and show images commands commented out, the script worked with the omegacore plugin activated. I suspect that you have some other code issue that's causing your problem.



I would suggest reducing your test down to just the bare minimum and then add back in one script at a time to try to pinpoint the culprit.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Feb 2015 20:21
dont forget you are also using avrams addon - could possibly be some conflicts there?

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 6th Feb 2015 21:19 Edited at: 6th Feb 2015 22:14
With Avram's script down of global.lua all scripts are working perfect.

with omegacore on the top, no one script is working. I got error with all scripts, including the original scripts like ai_soldier.lua

I will try to cut some scene for you in a short video, to see the errors. Stay in tune !

@ tomjcott, use image from attachments and multiply 3 times (000, 001, 002) in images folder.



Later edit with this video:



Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 6th Feb 2015 21:54
What does Avram's code look like in the global file? That might help me see what the conflict is.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 6th Feb 2015 22:00 Edited at: 6th Feb 2015 22:01
The Avram's it's for load custom images like compass, for example.

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 6th Feb 2015 23:10
I recall having similar problems when developing omegacore. Once it fails to load, you'll get all kinds of bogus script errors. They are cascading and not relevant. The main issue is that the plugin is not loading. I am fairly certain that if you didn't have the OpenAL32.dll that it would crash with a specific OpenAL error, but I'm not 100% sure of that now. You might want to verify that you have OpenAL installed and that might fix the plugin not loading issue.

However, I'd still like to see what Avram's add-on looks like. If it has some code in the global.lua file as well then it might cause a conflict. Do you have a link to where Avram's code was taken from?

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
tomjscott
User Banned
Posted: 6th Feb 2015 23:17 Edited at: 6th Feb 2015 23:18
Is this the add-on you are using?



https://bitbucket.org/Avram/fpsc-r-toolkit/wiki/Installation



If so, it has the same package.path command as I use. Are you duplicating the code? I'm not sure what would happen if you used that code twice. Have you tried the following?







I don't see any reason why they both can't work together. So hopefully we can resolve this quickly.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 11:21 Edited at: 7th Feb 2015 15:39
Indeed, working now

Just a little problem with a few music functions in global.lua, ai_soldier.lua and ai_soldier_rpg.lua, but after I disabled this, all is OK.

In global.lua disable:



In the ai_soldier.lua and ai_soldier_rpg.lua I've disabled "PlayCombatMusic(8000,500)":



So, only the part of script with music in the characters was with error pop ups.

Full thanks for your help !!!

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 11:56 Edited at: 7th Feb 2015 11:57
Now, my big question is: how can I use "Shift + E" (or any other key) to activate the Night Vision in the nightvision.lua script with omegacore ?

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 15:33 Edited at: 7th Feb 2015 16:20
tomjscott wrote: "Is this the add-on you are using?



https://bitbucket.org/Avram/fpsc-r-toolkit/wiki/Installation"


Yes, from there I've used the Avram's code, and working fine now with your last code:



btw: I've put the "omegacore" folder in the Avram's folder and the "omegacore.dll" in to the FPSCR path too. For me it wasn't necessary to use "OpenAL32.dll".

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 7th Feb 2015 16:51
Quote: "Now, my big question is: how can I use "Shift + E" (or any other key) to activate the Night Vision in the nightvision.lua script with omegacore ? "


Yes, for shift+e you can use either of the following:



or



For other keys, just change the value in ocGetKey to the key you want. Special keys are all described in the document.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
tomjscott
User Banned
Posted: 7th Feb 2015 16:54
You can also use the mouse buttons as well.



System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 18:21 Edited at: 7th Feb 2015 18:41
So, that "Prompt" from omegacore script REALLY CHANGE the button, or just prompt the player with a text ???

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 7th Feb 2015 18:41
Quote: "So, that "Prompt" from omegacore script REALLY CHANGE the button, or just prompt the player with a text ?"


The Prompt in my sample code is simply there to show on the screen when the player actually presses the keys that we are checking for. It's a way to test that it's working. What you have to do is replace the Prompt with some code that does whatever you want to happen when the player presses those special keys.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 18:45 Edited at: 7th Feb 2015 22:29
I've tested this code, but obtained just the same default "e" key for "use" :



The night vision can be use with the default key "E" and with "Shift+e" too.....

This is very frustrating when it's night, player use night vision and when he must press "e" key to use a weapon for example, the night vision go in off mode.

For this reasons I need another key button for "use" or "activate" ....

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Feb 2015 19:21
lines 56 and 74 should read
if ocGetKey("SHIFT") == 1 and g_KeyPressE == 1 then

line 93 should read
if ocGetKey("SHIFT") == 0 and g_KeyPressE == 0 then

that should fix it i guess

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 7th Feb 2015 19:22 Edited at: 7th Feb 2015 22:23
SOLVED !!! I've forgot to change the "g_KeyPressE" with the ocGetKey("e") .

It was MY MISTAKE , I am so sorry...

Here is the correct smallg's nightvision.lua with adapted key "Shift+E" by tomjscott's omegacore :



Be involved and share with the FPSCR community all your "tricks" !

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
tomjscott
User Banned
Posted: 7th Feb 2015 22:50
I'm happy to see you got it all working like you wanted. Congrats.

System Specs: OS - Windows 7 Home Premium 64-bit SP1, CPU - AMD Phenom II X4 945, 3.0Ghz, RAM - 8Gb DDR3, GFX Card - 2048MB NVIDIA GeForce GT 640, FPSC-R Version - Beta 1.0085
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Feb 2015 00:19 Edited at: 8th Feb 2015 00:31
Why we need more keys for "use" or "activate" command in the FPSCR games making ?

watch this video





Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 8th Feb 2015 10:35
tomjscott wrote: "I'm happy to see you got it all working like you wanted. Congrats."

Full thanks @tomjscott

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 10th Feb 2015 12:10 Edited at: 10th Feb 2015 12:31
I've put back the default global.lua script with Avram's and tomjscott's omegacore:





Then, to you can have sounds for enemies, just replace from ai_soldier.lua (or whatever other entity you use) the lines "PlayCombatMusic(8000,500)" with

"PlaySound(e, 8000,500)" and of course, then must manual set the sounds in the each characters options.





One short video with characters sounds:





See the attached picture.

Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."

Login to post a reply

Server time is: 2024-11-21 14:58:07
Your offset time is: 2024-11-21 14:58:07