![]() |
Dead Bodies - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Dead Bodies (/showthread.php?tid=462) |
Dead Bodies - Dragoons Master - 11-12-2006 I think nobody never posted a tut like this. This is my way to do it. I made it a long ago and I decided to post it here to share it w/ you guys. Author: Dragoons Master Difficulty: 2/5 (Copy/Paste Tut/Understand) That's what you should do, first Client side. modGlobals: Header: Under "Public MapNpc(1 To MAX_MAP_NPCS) As MapNpcRec" add this: Code: Public MapNpcDBody(1 To MAX_MAPS, 1 To MAX_MAP_NPCS) As DeadBodyRec Code: Type DeadBodyRec Under "Sub BltNpc" stuff add this new sub: Code: Sub BltNpcDBody(ByVal MapNpcNum As Long) modHandleData: Sub HandleData: Add this, you know where... Code: ' :::::::::::::::::::::::::: modGameLogic: Sub GameLoop: Add this under "' Blit out tiles layers ground/anim1/anim2" stuff: Code: ' Blit out the npcs dead body Server side modServerTCP: Add this subs to the module: Code: Sub SendNDeadBodyToMap(ByVal MapNum As Long, ByVal MapNpcNum As Long) modGameLogic: Sub AttackNpc: Under "Call SendDataToMap(MapNum, "NPCDEAD" & SEP_CHAR & MapNpcNum & SEP_CHAR & END_CHAR)" add: Code: MapNpcDBody(MapNum, MapNpcNum).Blit = True Under "' Check if there is an npc on the map and say hello if so" stuff add: Code: Call SendDBodiesMap(Index) Sub JoinGame: Under "' Send the flag so they know they can start doing stuff" stuff add: Code: Call SendDBodiesLogin(Index) modGlobals: Header: Under "Public MapNpc(1 To MAX_MAPS, 1 To MAX_MAP_NPCS) As MapNpcRec" add this: Code: Public MapNpcDBody(1 To MAX_MAPS, 1 To MAX_MAP_NPCS) As DeadBodyRec Code: Type DeadBodyRec modGeneral: Sub GameAI: Find "' // This is used for checking if an NPC is dead or not //" and you will see that it is totaly quoted. Keep it like that, don't edit it, only add this piece of code under that stuff: Code: For x = 1 To MAX_MAP_NPCS I think that's all, maybe I forgot something. Someone plx test and see if it works ^^ EDIT: here is an example of a blood img, like a body. ![]() PLX DON'T USE THIS ONE IT IS A CUSTOM ONE, MADE BY MY PIXEL ARTIST! EDIT2: Just fixed the wrong missing subs. They shouldn't be there xD - Forte - 11-12-2006 lol woah this is awesome! lol nice dude, im adding this right now to my game, ill tell you if i get any errors ![]() hey btw does the animation stay there? or once its done moving does it dissapear? - William - 11-12-2006 Congrats on the tutorial. - Rian - 11-12-2006 It's missing a couple subs. PlayerDBody SendPDeadBodyToMap SendNDeadBodyToMap I could be wrong. I didn't try hardly any debugging. - Dragoons Master - 11-12-2006 Sonire Wrote:It's missing a couple subs.Sry guys, I realy did a few things wrong. I have players dead body too, but this is not a tut for players and yes for npc, so I removed the player part. Shouldn't be hard to change that =P Sry about that but now it is fully working. - TheRealDamien - 11-12-2006 Now this is a tutorial to die for... Get it? lol. - Reece - 11-12-2006 Bad joke ![]() Nice tute man very nice ![]() - Dragoons Master - 11-12-2006 Tnx all you guys ^^ It's a nice stuff to add to your game, or the idea it selfs. Btw, this is the tut I'm posting for the contest ok? I'm not sure if the contest still up but if it does, this is my tutorial for it ^^ Re: Dead Bodies - franqetesh - 31-01-2008 SORRY FOR THE NECROPOST :S...But, how I do to set the body's image? Re: Dead Bodies - Dragoons Master - 31-01-2008 Client side, at Sub BltNpcDBody, change the 142 the sprite number... Code: rec.Top = 142 * PIC_Y 'I use 142 as a sprite in the spritesurf, use any number you want. Re: Dead Bodies - Mozza - 28-04-2008 Missing Sub Code: SendNDeadBodyTo |