zidsal Posted February 20, 2009 Author Share Posted February 20, 2009 THIS REMAINS UNTESTED: I had to rush the code as I've got to go soon I will test it when I get back. Most of this is just from memory.DONT DO THIS TUTORIAL YET IT WILL NOT WORK (because I'm an idioit who rushes things)ALL CLIENT SIDEstep 1 go to frmnpc editor add in a new option button call it BigNpc96.Add the following code ```If BigNpc96.Value = Checked Then picSprite.Width = 960 'not sure on dimentions picSprite.Height = 960 'not sure on dimentions picSprite.Top = 1900 'not sure on dimentions picSprite.Left = 3360 'not sure on dimentions picSprites.Picture = LoadPicture(App.Path & "\GFX\96Sprites.bmp")end if```Step 2 codinggo to modDirectxfind```Public DD_SpriteSurf As DirectDrawSurface7Public DDSD_Sprite As DDSURFACEDESC2```Add```Public DD_96SpriteSurf As DirectDrawSurface7Public DDSD_96Sprite As DDSURFACEDESC2```find``` ' Init sprite ddsd type and load the bitmap DDSD_Sprite.lFlags = DDSD_CAPS DDSD_Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY Set DD_SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\Sprites.bmp", DDSD_Sprite) SetMaskColorFromPixel DD_SpriteSurf, 0, 0```Add``` ' Init sprite ddsd type and load the bitmap DDSD_96Sprite.lFlags = DDSD_CAPS DDSD_96Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY Set DD_96SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\96Sprites.bmp", 96DDSD_Sprite) SetMaskColorFromPixel DD_96SpriteSurf, 0, 0```findSub DestroyDirectX()Add```Set DD_96SpriteSurf = Nothing```Go to bltnpcBodyand add in``` If Npc(MapNpc(MapNpcNum).num).Big = 2 Then rec.Top = Npc(MapNpc(MapNpcNum).num).Sprite * 96 + 32 rec.Bottom = rec.Top + PIC_Y rec.Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X rec.Right = rec.Left + PIC_X X = MapNpc(MapNpcNum).X * PIC_X + sx + MapNpc(MapNpcNum).xOffset y = MapNpc(MapNpcNum).y * PIC_Y + sx + MapNpc(MapNpcNum).yOffset' Check if its out of bounds because of the offset If y < 0 Then rec.Top = rec.Top + (y * -1) y = 0 End If ' Call DD_BackBuffer.Blt(rec_pos, DD_96SpriteSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(X - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_96SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End If```Go to BltNpcTopadd in```If Npc(MapNpc(MapNpcNum).num).Big = 2 Then rec.Top = Npc(MapNpc(MapNpcNum).num).Sprite * 96 rec.Bottom = rec.Top + PIC_Y rec.Left = (MapNpc(MapNpcNum).Dir * 3 + Anim) * PIC_X rec.Right = rec.Left + PIC_X X = MapNpc(MapNpcNum).X * PIC_X + sx + MapNpc(MapNpcNum).xOffset y = MapNpc(MapNpcNum).y * PIC_Y + sx + MapNpc(MapNpcNum).yOffset - 64 ' Check if its out of bounds because of the offset If y < 0 Then rec.Top = rec.Top + (y * -1) y = 0 End If ' Call DD_BackBuffer.Blt(rec_pos, DD_96SpriteSurf, rec, DDBLT_WAIT Or DDBLT_KEYSRC) Call DD_BackBuffer.BltFast(X - (NewPlayerX * PIC_X) - NewXOffset, y - (NewPlayerY * PIC_Y) - NewYOffset, DD_96SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)```EDITBah dont do this tutorial yet it won't work I'll finish it off when I get home Link to comment Share on other sites More sharing options...
Drag0n Posted February 22, 2009 Share Posted February 22, 2009 Actually this might work, but you would have to make your own sprites. You can't use premade, I don't think there are many. Link to comment Share on other sites More sharing options...
Devogen Posted February 22, 2009 Share Posted February 22, 2009 Why do people post stuff thats not even tested? baffles me. Link to comment Share on other sites More sharing options...
Drag0n Posted February 22, 2009 Share Posted February 22, 2009 Lol, right. Still they could get comments from other members, and maybe get a fix. Link to comment Share on other sites More sharing options...
Devogen Posted February 22, 2009 Share Posted February 22, 2009 Well he did say at the bottom that i didnt see:"Bah dont do this tutorial yet it won't work I'll finish it off when I get home"However, I sort of still dont understand posting something unless you have got it working. Perhaps posting it, and say "I cant get this working" :huh: Link to comment Share on other sites More sharing options...
zidsal Posted February 22, 2009 Author Share Posted February 22, 2009 The reason is I was in a rush and was doing this tutorial off the top of my head and just looking at the soruce to rip stuff out. When I posted it I thought it would work then forgot I missed some key stuff out :P. I forgot about this topic will fix the code up now. Link to comment Share on other sites More sharing options...
Devogen Posted February 22, 2009 Share Posted February 22, 2009 Wow thats such a backwards way to do a tutorial, good luck. Link to comment Share on other sites More sharing options...
xeross Posted February 22, 2009 Share Posted February 22, 2009 Better then a topic for a tutorial with as content coming soon.Hope you get it working Link to comment Share on other sites More sharing options...
Devogen Posted February 23, 2009 Share Posted February 23, 2009 That sig is way too big Zidsal. Link to comment Share on other sites More sharing options...
vrage Posted March 6, 2009 Share Posted March 6, 2009 WellThis code is already present in Baron's EE2.0(or 2.4 - I dont remember)I got it working by adding just one line of code.(Ofcourse, if you're using EE2.7 + you might need to add the 96x96 code aswell.)But why not just wait for EE3.0? Link to comment Share on other sites More sharing options...
Drag0n Posted March 8, 2009 Share Posted March 8, 2009 @{WTF}:> I got it working by adding one line of code.Could you pretty please tell us what that line of code is and where it goes? Link to comment Share on other sites More sharing options...
Kainan54 Posted March 24, 2009 Share Posted March 24, 2009 how would u do a sprite sheet for this?? Looks great and i wanna use it and btw u can premade stuff by using a program that allows you to strech images but it will probaly look bad so yea.. Link to comment Share on other sites More sharing options...
kokorecxd Posted July 17, 2009 Share Posted July 17, 2009 i found errorchange this: ```Set DD_96SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\96Sprites.bmp", 96DDSD_Sprite)```with:``` Set DD_96SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\96Sprites.bmp", DDSD_96Sprite)``` Link to comment Share on other sites More sharing options...
Skillzalot Posted July 27, 2009 Share Posted July 27, 2009 Is this working it would be a nice addition to my game 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