About Store Forum Documentation Contact



Post Reply 
Custom input problem
Author Message
Kobaltic Offline
Member

Post: #1
Custom input problem
I am working on the MMO. I put in the default inputs to control the player. WASD moves the player. I really want the player to be able to change the keys to what they want. I don't want to have to hard code the W to be forward and etc.

I followed the File Text.cpp tut. I integrated it into the MMO and called it CustomControls.cpp.

1. The problem is that the game never reads the file. I added breaks everywhere but it never gets read. Do I have to put something in the game.cpp or player.cpp to tell the game to read those files?

2.Also I am not exactly sure on how to put in the forward and backward into the input.

I have
input.move.z=Kb.b(KB_W);
input.move.z-=Kb.b(KB_S);

I am using forward and backward for the input file names.
So I am not sure how it should be coded.

input.move.z=Kb.b(forward);
input.move.z-=Kb.b(backward);

or

input.move.z=forward;
input.move.z-=backward;

or anything else it should be.
Thanks in advance.
04-17-2011 12:56 AM
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #2
RE: Custom input problem
Code:
//forward
Int forward; // backward/left/right/crouch etc

//Change controls
forward=17 //Enum of KB_BUTTON::KB_W is 17
...
input.move.z=Kb.b(KB_BUTTON(forward));
04-17-2011 01:51 AM
Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #3
RE: Custom input problem
Hi
I'm trying to map key press.
This makes sense but is there a way to get 17 dynamically for w?
Using Kb functions?

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
05-24-2013 10:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
gwald Offline
Member

Post: #4
RE: Custom input problem
Oh.. it's okay, I found it in the code here:
http://www.esenthel.com/community/showth...p?tid=4229

My Blog
http://www.esenthel.com/community/showthread.php?tid=6043

I hang out at Esenthel IRC Channel
http://webchat.freenode.net/?channels=#Esenthel
05-24-2013 02:30 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply