uncuepa
Member
|
WASD MMO movement
Is there anyway to easily change the stock MMO code over to WASD movement, or any pre-existing code for it? If not, that's my weekend plan.
|
|
02-27-2015 07:03 AM |
|
A_Gris
Member
|
RE: WASD MMO movement
mhhh are you talking about the snippet mmo-project ?
|
|
02-27-2015 08:43 AM |
|
uncuepa
Member
|
RE: WASD MMO movement
I mean based off the MMO Source code
|
|
02-27-2015 10:51 AM |
|
TBJokers
Member
|
RE: WASD MMO movement
Code:
virtual bool update()
{
if(action)
{
if(Kb.b(KB_W) || Kb.b(KB_S) || Kb.b(KB_A) || Kb.b(KB_D) || Kb.b(KB_Q) || Kb.b(KB_E))actionBreak();
}
if(!action)
{
// turn & move
input.turn.x=Kb.b(KB_Q)-Kb.b(KB_E);
input.turn.y=Kb.b(KB_T)-Kb.b(KB_G);
input.move.x=Kb.b(KB_D)-Kb.b(KB_A);
input.move.z=Kb.b(KB_W)-Kb.b(KB_S);
input.move.y=Kb.b(KB_SPACE)-Kb.b(KB_LSHIFT);
// dodge, crouch, walk, jump
input.dodge = Kb.bd(KB_D)-Kb.bd(KB_A);
input.crouch= Kb.b (KB_LSHIFT);
input.walk = Kb.b (KB_LCTRL );
input.jump =(Kb.bp(KB_SPACE ) ? 3.5 : 0);
// mouse turn
flt max=DegToRad(900)*Time.d();
angle.x-=Mid(Ms.d().x*1.7, -max, max);
angle.y+=Mid(Ms.d().y*1.7, -max, max);
}
return super.update();
}
Place that in you Update loop for the Player class. This is straight from EE Tutorials
|
|
02-27-2015 05:20 PM |
|
Fex
Gold Supporter
|
RE: WASD MMO movement
you can also buy the ineisis code
|
|
02-27-2015 07:00 PM |
|
uncuepa
Member
|
RE: WASD MMO movement
(02-27-2015 05:20 PM)TBJokers Wrote:
Code:
virtual bool update()
{
if(action)
{
if(Kb.b(KB_W) || Kb.b(KB_S) || Kb.b(KB_A) || Kb.b(KB_D) || Kb.b(KB_Q) || Kb.b(KB_E))actionBreak();
}
if(!action)
{
// turn & move
input.turn.x=Kb.b(KB_Q)-Kb.b(KB_E);
input.turn.y=Kb.b(KB_T)-Kb.b(KB_G);
input.move.x=Kb.b(KB_D)-Kb.b(KB_A);
input.move.z=Kb.b(KB_W)-Kb.b(KB_S);
input.move.y=Kb.b(KB_SPACE)-Kb.b(KB_LSHIFT);
// dodge, crouch, walk, jump
input.dodge = Kb.bd(KB_D)-Kb.bd(KB_A);
input.crouch= Kb.b (KB_LSHIFT);
input.walk = Kb.b (KB_LCTRL );
input.jump =(Kb.bp(KB_SPACE ) ? 3.5 : 0);
// mouse turn
flt max=DegToRad(900)*Time.d();
angle.x-=Mid(Ms.d().x*1.7, -max, max);
angle.y+=Mid(Ms.d().y*1.7, -max, max);
}
return super.update();
}
Place that in you Update loop for the Player class. This is straight from EE Tutorials
Didn't work. The stock right-click movement is in the Game script but this one was for the Player script, so either I am missing something or this isnt right.
|
|
03-01-2015 09:12 AM |
|