Electrokinesis Posted August 22, 2008 Author Share Posted August 22, 2008 I saw MrMiguu's and found it kinda choppy looking. (maybe I'm just REALLY picky)Anyway, after talking to Robin about his code for his engine, he willingly gave it to me.Soon finding that it was horrible in Eclipse but looked nice on his game, I proceeded to edit his code for about 10-20 minutes until I came out with this tutorial.(Also, on the off chance that anyone is using ED3… I have [after about an hour] edited it to work for that engine as well.)________________________________________________Credit:Robin (original code)Electrokinesis (Eclipse 2.7[MIGHT work on others… untested] and ED3 edit)________________________________________________Alright. It's quite a few areas to update.Source required, of course.(NOTE: If you find any problems or my instructions not clear enough then tell me and I'll try to get pictures to this process. Or better examples…)First, under 'BltPlayer' in modGameLogic find where it says 'check for animation and change everything between that and the next set of green text to this:```' Check for animation Anim = 1 If Player(Index).Attacking = 0 Then Select Case GetPlayerDir(Index) Case DIR_UP If (Player(Index).yOffset > 8) Then Anim = Player(Index).Step Case DIR_DOWN If (Player(Index).yOffset < -8) Then Anim = Player(Index).Step Case DIR_LEFT If (Player(Index).xOffset > 8) Then Anim = Player(Index).Step Case DIR_RIGHT If (Player(Index).xOffset < -8) Then Anim = Player(Index).Step End Select Else If Player(Index).AttackTimer + 1000 > GetTickCount Then Anim = 2 End If End If```Use the same code and same process under 'BltPlayerTop'.______________________Next find 'Sub processmovement' and replace the entire code (in between the lines) with this:```Sub ProcessMovement(ByVal Index As Long) ' Check if player is walking, and if so process moving them over If Player(Index).Moving = MOVING_WALKING Then Select Case GetPlayerDir(Index) Case DIR_UP Player(Index).YOffset = Player(Index).YOffset - WALK_SPEED Case DIR_DOWN Player(Index).YOffset = Player(Index).YOffset + WALK_SPEED Case DIR_LEFT Player(Index).XOffset = Player(Index).XOffset - WALK_SPEED Case DIR_RIGHT Player(Index).XOffset = Player(Index).XOffset + WALK_SPEED End Select ' Check if completed walking over to the next tile If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then Player(Index).Moving = 0 If Player(Index).Step = 0 Then Player(Index).Step = 2 Else Player(Index).Step = 0 End If End If Else If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then Player(Index).Moving = 0 If Player(Index).Step = 0 Then Player(Index).Step = 2 Else Player(Index).Step = 0 End If End If End If End If ' Check if player is running, and if so process moving them over If Player(Index).Moving = MOVING_RUNNING Then Select Case GetPlayerDir(Index) Case DIR_UP Player(Index).YOffset = Player(Index).YOffset - RUN_SPEED Case DIR_DOWN Player(Index).YOffset = Player(Index).YOffset + RUN_SPEED Case DIR_LEFT Player(Index).XOffset = Player(Index).XOffset - RUN_SPEED Case DIR_RIGHT Player(Index).XOffset = Player(Index).XOffset + RUN_SPEED End Select ' Check if completed walking over to the next tile If Player(Index).Dir = DIR_RIGHT Or Player(Index).Dir = DIR_DOWN Then If (Player(Index).XOffset >= 0) And (Player(Index).YOffset >= 0) Then Player(Index).Moving = 0 If Player(Index).Step = 0 Then Player(Index).Step = 2 Else Player(Index).Step = 0 End If End If Else If (Player(Index).XOffset <= 0) And (Player(Index).YOffset <= 0) Then Player(Index).Moving = 0 If Player(Index).Step = 0 Then Player(Index).Step = 2 Else Player(Index).Step = 0 End If End If End If End If Select Case GetPlayerDir(Index) Case DIR_UP If Player(Index).YOffset <= 0 Then Player(Index).YOffset = 0 End If Case DIR_DOWN If Player(Index).YOffset >= 0 Then Player(Index).YOffset = 0 End If Case DIR_LEFT If Player(Index).XOffset <= 0 Then Player(Index).XOffset = 0 End If Case DIR_RIGHT If Player(Index).XOffset >= 0 Then Player(Index).XOffset = 0 End If End SelectEnd Sub```_________________Finally, in modType find 'PlayerRec' and add this after "Party As PartyRec":```Step As Byte``` Link to comment Share on other sites More sharing options...
L0lz Posted August 23, 2008 Share Posted August 23, 2008 Does this just add a fourth frame? Or does it replace the attack animation? Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 23, 2008 Author Share Posted August 23, 2008 Current frame movement is: 1,2,…After code it's: 1,2,3,2,...Basically, they move as intended.I'll have a movie example sometime later today. (24th) Link to comment Share on other sites More sharing options...
xeross Posted August 23, 2008 Share Posted August 23, 2008 @Electrokinesis:> Current frame movement is: 1,2,…> After code it's: 1,2,3,2,...> > Basically, they move as intended.> I'll have a movie example sometime later today. (24th)So that means that we don't have a seperate attack frame, hmm well didn't use it anyways.And does this work with paperdoll ? Link to comment Share on other sites More sharing options...
L0lz Posted August 23, 2008 Share Posted August 23, 2008 Yeah I was wondering that too lol. Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 23, 2008 Author Share Posted August 23, 2008 The attack frame is the same as before and yes, it works with paperdoll.Just keep the sprites in the same order as usual.I've tested it normal, paperdoll, and custom.It's flawless.EDIT: preview (recorder lagged a tiny bit)Just sprite #2 from the original.![](http://img185.imageshack.us/img185/6470/movementbb0.gif) Link to comment Share on other sites More sharing options...
Drummerpete Posted August 23, 2008 Share Posted August 23, 2008 That looks really cool. Link to comment Share on other sites More sharing options...
Bobbus Posted August 23, 2008 Share Posted August 23, 2008 Cool stuff, dude. :) Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 23, 2008 Author Share Posted August 23, 2008 Funny.I don't get many replies in a row until I post a gif. =PThanks guys. :) Link to comment Share on other sites More sharing options...
xeross Posted August 23, 2008 Share Posted August 23, 2008 Wow ima use it, would it be possible to add another frame for the attack Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 23, 2008 Author Share Posted August 23, 2008 I suppose.I'll look into it.I'm dead tired right now, but I'll see what I can do.(don't expect it soon, but I've surprised myself before)EDIT: Wait…What EXACTLY do you mean by adding another frame for the attack? Link to comment Share on other sites More sharing options...
xeross Posted August 23, 2008 Share Posted August 23, 2008 Left Leg | Stand | Right Leg | Attack Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 23, 2008 Author Share Posted August 23, 2008 Ah.Gotcha.If you'd want to remake all your spritesheets like that, then sure, I'll work on it.If you already have one… I'd like you to PM it to me so I can properly test it as I work. Link to comment Share on other sites More sharing options...
xeross Posted August 23, 2008 Share Posted August 23, 2008 i can easily change the eclipse sprite sheet in like 5 minutes for that Link to comment Share on other sites More sharing options...
L0lz Posted August 24, 2008 Share Posted August 24, 2008 This is really awesome, I tried it out, and it's flawless like you said. Thanks to Robin and You, my people don't have to look crippled, yay! Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 24, 2008 Author Share Posted August 24, 2008 No problem. =DGlad you like it.I'm sure Robin'll be glad too.Or… just throw in a sarcastic and/or witty comment....Whichever. Link to comment Share on other sites More sharing options...
xeross Posted August 24, 2008 Share Posted August 24, 2008 How can i edit it so that it has a seperate attack frame ?my sprites.bmp is nowRIGHT | STAND | LEFT | ATTACK Link to comment Share on other sites More sharing options...
Electrokinesis Posted August 24, 2008 Author Share Posted August 24, 2008 Can you PM me one of the sprites (in all positions) so I can work on this?I never got around to coding that version because I wouldn't have been able to test it. Link to comment Share on other sites More sharing options...
PlatefieldLord Posted September 2, 2008 Share Posted September 2, 2008 This is awesome, and it works all the way back to TE. Link to comment Share on other sites More sharing options...
damian666 Posted September 3, 2008 Share Posted September 3, 2008 very nice piece of code man, it works like a charm, and is easy to do :dthanx alot.damian666 Link to comment Share on other sites More sharing options...
PlatefieldLord Posted September 6, 2008 Share Posted September 6, 2008 There is only one problem, and that is for the newest version of Eclipse. It has an option to use SP for running, which messes up the game when removed, other than that, it is completely and totally flawless! I was waiting for the day when someone would fix this problem. Link to comment Share on other sites More sharing options...
Electrokinesis Posted September 19, 2008 Author Share Posted September 19, 2008 Haha, thanks a lot guys!Also, I never really liked the SP for running thing.If I can get around to it, I'll see if I can fix it for SP users. Link to comment Share on other sites More sharing options...
Fred Posted September 23, 2008 Share Posted September 23, 2008 I used it to EE1.0 Barons vcersion and it works great. Very good idea and well done. Thanks for that code i will use it in Aphelion Online. :) Link to comment Share on other sites More sharing options...
demon xxx x Posted September 23, 2008 Share Posted September 23, 2008 Hm.. GREAT code, perfect. But, I prefer 32 frame XD >.> Link to comment Share on other sites More sharing options...
xeross Posted September 24, 2008 Share Posted September 24, 2008 32 frame 0.O 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