Kobaltic
Member
|
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 |
|
Dandruff
Member
|
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 |
|
gwald
Member
|
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 |
|
gwald
Member
|
RE: Custom input problem
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 |
|