About Store Forum Documentation Contact
Donations:
167$/mo



Post Reply 
WASD MMO movement
Author Message
uncuepa Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
A_Gris Offline
Member

Post: #2
RE: WASD MMO movement
mhhh are you talking about the snippet mmo-project ?
02-27-2015 08:43 AM
Find all posts by this user Quote this message in a reply
uncuepa Offline
Member

Post: #3
RE: WASD MMO movement
I mean based off the MMO Source code
02-27-2015 10:51 AM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #4
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
Visit this user's website Find all posts by this user Quote this message in a reply
Fex Offline
Bronze Supporter

Post: #5
RE: WASD MMO movement
you can also buy the ineisis code
02-27-2015 07:00 PM
Find all posts by this user Quote this message in a reply
uncuepa Offline
Member

Post: #6
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
Find all posts by this user Quote this message in a reply
Post Reply