Carim123 Posted July 22, 2011 Author Share Posted July 22, 2011 Simple little tut, on spinning. This is just direct from IP…In frmMain_KeyUp add...``` ' Spinning If KeyCode = 36 Then Call Spin End If```36 is the Home key. You can change it to whatever you like.I have it in KeyUp, so you can't spin like a madman, but if you want it in _KeyPress, go ahead. I haven't tried it, though. ;pNow, in modDatabase…(or pretty much any module you like, if you want to organise your code. I just have mine in modDatabase.)Add at the bottom...```Public Function Spin()Dim d As String d = GetPlayerDir(MyIndex) If Player(MyIndex).Dir = DIR_DOWN Then Call SetPlayerDir(MyIndex, DIR_LEFT) If d <> DIR_LEFT Then Call SendPlayerDir End If ElseIf Player(MyIndex).Dir = DIR_LEFT Then Call SetPlayerDir(MyIndex, DIR_UP) If d <> DIR_UP Then Call SendPlayerDir End If ElseIf Player(MyIndex).Dir = DIR_UP Then Call SetPlayerDir(MyIndex, DIR_RIGHT) If d <> DIR_RIGHT Then Call SendPlayerDir End If ElseIf Player(MyIndex).Dir = DIR_RIGHT Then Call SetPlayerDir(MyIndex, DIR_DOWN) If d <> DIR_DOWN Then Call SendPlayerDir End If End IfEnd Function```And, that's it. Now, with whatever key you've specified, just hit that, and you'll spin.No credit is required; just don't claim as your own. ;p Link to comment Share on other sites More sharing options...
tsuki Posted July 22, 2011 Share Posted July 22, 2011 simple, but very useful! Link to comment Share on other sites More sharing options...
Darth Tyllo Posted July 26, 2011 Share Posted July 26, 2011 Wait, what exactly does this do? Link to comment Share on other sites More sharing options...
RyokuHasu Posted July 26, 2011 Share Posted July 26, 2011 It flips your direction.If you are getting attacked from 2 sides this helps… I think.. Link to comment Share on other sites More sharing options...
beckymegan Posted July 26, 2011 Share Posted July 26, 2011 I actually laughed when I saw this post (and then I added it and sat staring at my girl spin for 5 minutes). Great/cute little code :) I didn't manage to get it to work in the _key press event though. Link to comment Share on other sites More sharing options...
Carim123 Posted July 26, 2011 Author Share Posted July 26, 2011 @RyokuHasu:> It flips your direction.> > If you are getting attacked from 2 sides this helps… I think..Yep, exactly that.@beckymegan:> I actually laughed when I saw this post (and then I added it and sat staring at my girl spin for 5 minutes). Great/cute little codeHah, same. xD Link to comment Share on other sites More sharing options...
Whackeddie99 Posted July 26, 2011 Share Posted July 26, 2011 for the game I'm making, this is VERY useful. I'd like to know, if you could edit this so that 1, 2, 3, and 4 on the keypad and the other part make you face the direction w/o moving. Like you press 1 and ur instantly facing up, 2 and ur facing right, 3, down, and so on. It's good to have this in my game because your going to be running from zombies, and you cant use that extra tile to turn and face them, you could just turn and shoot :DTHANKS!!! Link to comment Share on other sites More sharing options...
aaaron Posted July 26, 2011 Share Posted July 26, 2011 Nice job. ; ]-Aaron Link to comment Share on other sites More sharing options...
Carim123 Posted July 27, 2011 Author Share Posted July 27, 2011 @Whackeddie99:> for the game I'm making, this is VERY useful. I'd like to know, if you could edit this so that 1, 2, 3, and 4 on the keypad and the other part make you face the direction w/o moving. Like you press 1 and ur instantly facing up, 2 and ur facing right, 3, down, and so on. It's good to have this in my game because your going to be running from zombies, and you cant use that extra tile to turn and face them, you could just turn and shoot :D> > THANKS!!!I won't do that for you, but I'll give you a hint.In the same KeyUp part, find the Key Code Constants for the keys you want, and simply add:If KeyCode = KEYCODEHERE Then Call SetPlayerDir(MyIndex, DIR_WHATEVER) Call SendPlayerDirEnd If Link to comment Share on other sites More sharing options...
Jaiden Posted July 27, 2011 Share Posted July 27, 2011 Oh this looks fun. Thanks! Link to comment Share on other sites More sharing options...
Kyrie Posted July 27, 2011 Share Posted July 27, 2011 **I made a mod, it's called Love.You can have it free. :3** Link to comment Share on other sites More sharing options...
SeeingBlue Posted July 31, 2011 Share Posted July 31, 2011 Thank you for this example. I've been wanting to use Ctrl + Directional arrow to manually change direction. I think I can figure it out with this. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted August 14, 2011 Share Posted August 14, 2011 @7:> I won't do that for you, but I'll give you a hint.> > In the same KeyUp part, find the Key Code Constants for the keys you want, and simply add:> > If KeyCode = KEYCODEHERE Then> Call SetPlayerDir(MyIndex, DIR_WHATEVER)> Call SendPlayerDir> End IfYAY!!! Thanks for not telling me how to do it and forcing me to teach myself! I figured it out lol, I'm making progress! Now it works fine, and I used Home, Delete, End, and Page Down as the spinning keys :D Link to comment Share on other sites More sharing options...
SeeingBlue Posted September 6, 2011 Share Posted September 6, 2011 This is how I did it. It does take away the ability to set walk speed with shift, but this was fine for me.In the client under modGameLogic find the sub ProcessMovement and change it to look like this.``` ' Check if player has the shift key down for running If ShiftDown Then Call SendPlayerDir Player(MyIndex).Moving = MOVING_RUNNING Exit Sub Else Player(MyIndex).Moving = MOVING_WALKING End If``` Link to comment Share on other sites More sharing options...
Carim123 Posted September 6, 2011 Author Share Posted September 6, 2011 This tutorial adds a function, and a call.You messed your own movement subs, yourself.EDIT: Unless if I'm misunderstanding here, how did you manage that? Link to comment Share on other sites More sharing options...
JohnPony Posted May 20, 2012 Share Posted May 20, 2012 Im very sorry for the necro post. But anyone using this may want to add a check if the player is moving. Cause this can cause a bug where the player gets stuck.Edit:Got the fix…Use this as your input code:``` ' Spinning Select Case keyCode Case vbKeyHome If Player(MyIndex).Moving = False Then Exit Sub Else Call Spin End If End Select``` Link to comment Share on other sites More sharing options...
quintensky Posted May 23, 2012 Share Posted May 23, 2012 i can't find frmmain_KeyUp Link to comment Share on other sites More sharing options...
JohnPony Posted May 23, 2012 Share Posted May 23, 2012 @quintensky:> i can't find frmmain_KeyUpTry searching for```vbKeyInsert``` Link to comment Share on other sites More sharing options...
DarkDino Posted January 25, 2013 Share Posted January 25, 2013 Works nice ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)! Link to comment Share on other sites More sharing options...
Conscientia Posted March 1, 2013 Share Posted March 1, 2013 This is sleeker!```Public Function Spin() Select Case GetPlayerDir(MyIndex) Case DIR_UP Call SetPlayerDir(MyIndex, DIR_RIGHT) Case DIR_DOWN Call SetPlayerDir(MyIndex, DIR_LEFT) Case DIR_LEFT Call SetPlayerDir(MyIndex, DIR_UP) Case DIR_RIGHT Call SetPlayerDir(MyIndex, DIR_DOWN) End SelectEnd Function``` Link to comment Share on other sites More sharing options...
JohnPony Posted March 4, 2013 Share Posted March 4, 2013 ```Dim d As String d = GetPlayerDir(MyIndex)```I'm trying to figure out why he used a string for that, haven't used eclipse for months, nor do I really want to look, but I'm pretty sure GetPlayerDir() didn't return a string value. Link to comment Share on other sites More sharing options...
Guest Posted March 4, 2013 Share Posted March 4, 2013 > ```> > Dim d As String> > d = GetPlayerDir(MyIndex)> > ```> > I'm trying to figure out why he used a string for that, haven't used eclipse for months, nor do I really want to look, but I'm pretty sure GetPlayerDir() didn't return a string value.Yeah, it doesn't. Link to comment Share on other sites More sharing options...
DarkDino Posted September 16, 2013 Share Posted September 16, 2013 How to fix Spinning speed in D: EFF? 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