Darklordhalos Posted February 2, 2010 Author Share Posted February 2, 2010 Hey All, Just wondering if anyone had an idea how to implement this:What I want to do is when a player holds a certian key down, the player'scharacter shall fix its direction (the way he/she is facing) but still be able tomove in all four directions. Ive tried editing the source at all SetPlayerDir();so that when a key is held, the code ignores the commands to alter the player'sdirection. but all this produced is some strange movement and teleporting characters.Any one have any advice on what would be the best way to create this?Thanks in advance, Halos. Link to comment Share on other sites More sharing options...
Swordsower Posted February 3, 2010 Share Posted February 3, 2010 Instead of editing the Sub SetPlayerDir(), you want to edit where that sub is called. I think the sub is CanMove, or PlayerMove or something, find the actual movement sub, and put and If-Then-Else sequence before the line "Call SetPlayerDir" so that if shift is held, it skips that line. Sorry about the vagueness, I don't have VB6 at work anymore. Link to comment Share on other sites More sharing options...
Darklordhalos Posted February 3, 2010 Author Share Posted February 3, 2010 Thanks for the help, Ill give it a try :) Link to comment Share on other sites More sharing options...
Darklordhalos Posted February 7, 2010 Author Share Posted February 7, 2010 Ive tried adding IFs in where the SetPlayerDir is being called, and it almost worked:When the key was presse it stopped the character turning, but they only move in thedirection they are facing. for e.g. my character is facing UP, and I hold down the "Strafe"key but when I move pressing the LEFT key, the character Still moves UP, in the directionthey are facing. I think its because when the character is moved by the code, it directly usesthe character's direction to work out the changes in X + Y coodinates. Ill keep trying though.Think im going to have to edit the core of the movement code to get it working. Thanks againfor your help though Crypto :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now