tslusny Posted March 7, 2013 Author Share Posted March 7, 2013 When you finish this tutorial, you will get something like this: ![](http://www.freemmorpgmaker.com/files/imagehost/pics/672bac58115812f237bd9326dcafbe52.gif)First search for:```Public Tex_Char() As Long```Then add under it this:```Public Tex_Charanim() As Long```Then search for:```Public Count_Char As Long```And add under it:```Public Count_Charanim As Long```Then search for:```' Character TexturesCount_Char = 1Do While FileExist(App.path & Path_Char & Count_Char & ".png")ReDim Preserve Tex_Char(0 To Count_Char)Tex_Char(Count_Char) = Directx8.SetTexturePath(App.path & Path_Char & Count_Char & ".png")Count_Char = Count_Char + 1LoopCount_Char = Count_Char - 1```And add this under it:```' Character animation TexturesCount_Charanim = 1Do While FileExist(App.path & Path_Char & Count_Charanim & "_anim.png")ReDim Preserve Tex_Charanim(0 To Count_Charanim)Tex_Charanim(Count_Charanim) = Directx8.SetTexturePath(App.path & Path_Char & Count_Charanim & "_anim.png")Count_Charanim = Count_Charanim + 1LoopCount_Charanim = Count_Charanim - 1```Then search for this:```With rec.Top = spritetop * (gTexture(Tex_Char(Sprite)).height / 4).height = (gTexture(Tex_Char(Sprite)).height / 4).Left = Anim * (gTexture(Tex_Char(Sprite)).Width / 4).Width = (gTexture(Tex_Char(Sprite)).Width / 4)End With' Calculate the XX = GetPlayerX(Index) * PIC_X + Player(Index).xOffset - ((gTexture(Tex_Char(Sprite)).Width / 4 - 32) / 2)' Is the player's height more than 32..?If (gTexture(Tex_Char(Sprite)).height) > 32 Then' Create a 32 pixel offset for larger spritesY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - ((gTexture(Tex_Char(Sprite)).height / 4) - 32) - 4Else' Proceed as normalY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - 4End IfDirectx8.RenderTexture Tex_Char(Sprite), ConvertMapX(X + 12), ConvertMapY(Y + 5), rec.Left, rec.Top, rec.Width - 8, rec.height, rec.Width, rec.height, D3DColorARGB(100, 0, 0, 0), 45Directx8.RenderTexture Tex_Char(Sprite), ConvertMapX(X), ConvertMapY(Y), rec.Left, rec.Top, rec.Width, rec.height, rec.Width, rec.height' check for paperdollingFor I = 1 To UBound(PaperdollOrder)If GetPlayerEquipment(Index, PaperdollOrder(I)) > 0 ThenIf Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll > 0 ThenCall DrawPaperdoll(X, Y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, spritetop)End IfEnd IfNext```And replace it with this:```If Player(Index).Attacking = YES ThenIf Sprite < 1 Or Sprite > Count_Charanim Then Exit SubWith rec.Top = spritetop * (gTexture(Tex_Charanim(Sprite)).height / 4).height = (gTexture(Tex_Charanim(Sprite)).height / 4).Left = Anim * (gTexture(Tex_Charanim(Sprite)).Width / 3).Width = (gTexture(Tex_Charanim(Sprite)).Width / 3)End With' Calculate the XX = GetPlayerX(Index) * PIC_X + Player(Index).xOffset - ((gTexture(Tex_Charanim(Sprite)).Width / 3 - 32) / 2)Y = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - ((gTexture(Tex_Charanim(Sprite)).height / 4) / 2)Directx8.RenderTexture Tex_Charanim(Sprite), ConvertMapX(X), ConvertMapY(Y), rec.Left, rec.Top, rec.Width, rec.height, rec.Width, rec.heightElseWith rec.Top = spritetop * (gTexture(Tex_Char(Sprite)).height / 4).height = (gTexture(Tex_Char(Sprite)).height / 4).Left = Anim * (gTexture(Tex_Char(Sprite)).Width / 4).Width = (gTexture(Tex_Char(Sprite)).Width / 4)End With' Calculate the XX = GetPlayerX(Index) * PIC_X + Player(Index).xOffset - ((gTexture(Tex_Char(Sprite)).Width / 4 - 32) / 2)' Is the player's height more than 32..?If (gTexture(Tex_Char(Sprite)).height) > 32 Then' Create a 32 pixel offset for larger spritesY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - ((gTexture(Tex_Char(Sprite)).height / 4) - 32) - 4Else' Proceed as normalY = GetPlayerY(Index) * PIC_Y + Player(Index).yOffset - 4End IfDirectx8.RenderTexture Tex_Char(Sprite), ConvertMapX(X + 12), ConvertMapY(Y + 5), rec.Left, rec.Top, rec.Width - 8, rec.height, rec.Width, rec.height, D3DColorARGB(100, 0, 0, 0), 45Directx8.RenderTexture Tex_Char(Sprite), ConvertMapX(X), ConvertMapY(Y), rec.Left, rec.Top, rec.Width, rec.height, rec.Width, rec.height' check for paperdollingFor I = 1 To UBound(PaperdollOrder)If GetPlayerEquipment(Index, PaperdollOrder(I)) > 0 ThenIf Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll > 0 ThenCall DrawPaperdoll(X, Y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, spritetop)End IfEnd IfNextEnd If```And now add files from attachment to your **data files/graphics/characters** folder. And voila, you are done.**Credits**: Lumiere, for example graphics Link to comment Share on other sites More sharing options...
abhi2011 Posted March 7, 2013 Share Posted March 7, 2013 Nice, but any links to finding characters with animations? Link to comment Share on other sites More sharing options...
boyesjs03 Posted March 7, 2013 Share Posted March 7, 2013 Sweet, and Abhi youll probably have to makr them yourself Link to comment Share on other sites More sharing options...
Zexion Posted March 17, 2013 Share Posted March 17, 2013 One question, are these global? Link to comment Share on other sites More sharing options...
Dr.House Posted March 17, 2013 Share Posted March 17, 2013 Useless if you're stuck with just 1 Animation Sheet per character, try somehow implement it on paperdolls. Link to comment Share on other sites More sharing options...
Vortigem Posted March 17, 2013 Share Posted March 17, 2013 By using separate sprite files, is it more efficient on the client or less? It would be more convenient for spriting if it was all on one sheet. Link to comment Share on other sites More sharing options...
Dr.House Posted March 17, 2013 Share Posted March 17, 2013 If it were all on 1 Sheet, then it would mess with walking frames (That's just in case if the attacking frames needs more space on sheet, wich in most cases they need)I would suggest, a check box and a list, just like with Paperdolls. 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