chamster Posted June 26, 2011 Share Posted June 26, 2011 @RyokuHasu:> well using just this system and none of my mods for it, just click call pet…> > If your using Summoning with items make the pet on the same number as the summoning item.> > (and if your using my taming system, you should be aressted for hacking my computer lol JK)I have no pet yet, but i want to make a pet, but how? Link to comment Share on other sites More sharing options...
Lavos Posted June 26, 2011 Share Posted June 26, 2011 You follow what the tutorial tells you to do.Edit- Try fiddling with the npc editor. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Quote from: BugSICK on June 14, 2011, 02:43:26 PM light i have this problem. client and server runs good with pet installed. but when i logout and log-in again i get this error. did i miss something???i've tried multiple times and still this error appeared. did you test it?? at first it runs smooth every command are ok, but when i exit client(i mean really close the client not going back to the menu when the X"close" button click) and relogin then i get the error, i need to refresh/shutdown the server and runs it again to run the client back to normal.I get the same error, no fix for it? Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 Please refer to this post for the fix:http://www.touchofdeathforums.com/smf/index.php/topic,69521.msg785467.html#msg785467 Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 That kind of worked, it fixed the problem but now the pets move really jerky with no animations :SNvm its now working, not sure what that was aboutnope, it jumps >< Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 Ouch, that was me being stupid. >_< I've gone over it again and saw I was setting TempPetSlot to zero before removing the Pet from the server-side cache.Server-side:Change "Sub PetDisband" to this:```'Clear the npc from the mapSub PetDisband(ByVal index As Long, ByVal MapNum As Long) Dim i As Long Dim j As Long If TempPlayer(index).TempPetSlot < 1 Then Exit Sub 'Cache the Pets for players logging on [Remove Number from array] 'THIS IS KINDA SLOW (EVEN WITHOUT TESTING, LOL), MAY HAVE TO CONVERT TO LINKED LIST FOR SPEED For i = 1 To PetMapCache(MapNum).UpperBound If PetMapCache(MapNum).Pet(i) = TempPlayer(index).TempPetSlot Then If PetMapCache(MapNum).UpperBound > 1 Then For j = PetMapCache(MapNum).UpperBound To i Step -1 PetMapCache(MapNum).Pet(j - 1) = PetMapCache(MapNum).Pet(j) Next Else PetMapCache(MapNum).Pet(1) = 0 End If PetMapCache(MapNum).UpperBound = PetMapCache(MapNum).UpperBound - 1 Exit For End If Next Call ClearSingleMapNpc(TempPlayer(index).TempPetSlot, MapNum) Map(GetPlayerMap(index)).Npc(TempPlayer(index).TempPetSlot) = 0 TempPlayer(index).TempPetSlot = 0 're-warp the players on the map For i = 1 To Player_HighIndex If IsPlaying(i) Then If GetPlayerMap(i) = GetPlayerMap(index) Then Call PlayerWarp(i, GetPlayerMap(i), GetPlayerX(i), GetPlayerY(i)) SendPlayerData index End If End If NextEnd Sub```Client-side:Change "Sub HandleNPCCache" back to this:```Private Sub HandleNPCCache(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim Buffer As clsBuffer Dim PIndex As Long Dim MapNum As Long Dim npcNum As Long Dim i As Long Set Buffer = New clsBuffer Buffer.WriteBytes Data() MapNum = Buffer.ReadLong npcNum = Buffer.ReadLong Map.Npc(npcNum) = Buffer.ReadLong MapNpc(npcNum).num = Buffer.ReadLong SaveMap (MapNum) Set Buffer = NothingEnd Sub``` Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 It is confirmed to work, thanks for the fix lightning :P Now it is completely bug free =D Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Sorry, i spoke to soon, i noticed another bug, the pet goes very odd if it is healed, however that might be an error due to the changes ive made to healing… might be worth you testingis there a way to prevent it respawning too, because otherwise summoners are pretty imba Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 @Fragment:> Sorry, i spoke to soon, i noticed another bug, the pet goes very odd if it is healed, however that might be an error due to the changes ive made to healing… might be worth you testingI never coded anything for healing of pets in the first place, so it's nothing to do with me. ;] Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 yea i know but have you tried healing your pet? just cause a pet is still an npc, so if you use a heal spell on it, it will be healed then it goes into ghost mode Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 @Fragment:> yea i know but have you tried healing your pet? just cause a pet is still an npc, so if you use a heal spell on it, it will be healed then it goes into ghost modeI've never tried it. In my game, I use Pet Food instead of healing spells. You could do the same as what I did, which just stops the healing if they are a Pet. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Ok will do, how did u go about preventing them from respawning though?Is there some flag that i can check to see if the npc is a pet? Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 @Fragment:> Ok will do, how did u go about preventing them from respawning though?Once they die, "PetDisband" is called, which removes the NPC from the map. It also changes the Pet cache for new players logging on and sends an NPC update to the existing players logged on. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 surely this should stop them respawning? ElseIf MapNpc(MapNum).Npc(Victim).IsPet = YES Then 'Get the pet owners' index PetOwner = MapNpc(MapNum).Npc(Victim).PetData.Owner 'Set the NPC's target on the owner now MapNpc(MapNum).Npc(Attacker).targetType = 1 'player MapNpc(MapNum).Npc(Attacker).target = PetOwner 'Disband the pet PetDisband PetOwner, GetPlayerMap(PetOwner) End If Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 It calls PetDisband, yes. Those extra lines just re-target the NPC attacking the pet to its owner. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Yes but my point is that it doesnt work. the pet will respawn Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Aha, i see where you have made the mistake, you forgot to add that code to the player attack npc.If a player/yourself kills the pet, it will respawn Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 I do appreciate everything you done in this tutorial but i think [Completely Bug-Free!]was a bad title to give itThis is the fix for those interested, in server add this to PlayerAttackNpc Dim PetOwner As Longandabove this``` Else ' NPC not dead, just do the damage```add this``` If MapNpc(MapNum).Npc(mapNpcNum).IsPet = YES Then 'Get the pet owners' index PetOwner = MapNpc(MapNum).Npc(mapNpcNum).PetData.Owner 'Disband the pet PetDisband PetOwner, GetPlayerMap(PetOwner) End If``` Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 @Fragment:> I do appreciate everything you done in this tutorial but i think [Completely Bug-Free!]> was a bad title to give itIt was completely bug free, but as I forgot to add a few things (which I must make clear were already in my source code) a few "errors" were chucked out. In regards to the Player attacking an NPC, here is the fix:``` 'Checks if NPC was a pet If MapNpc(MapNum).Npc(mapNpcNum).IsPet = YES Then Call PetDisband(MapNpc(MapNum).Npc(mapNpcNum).PetData.Owner, MapNum) 'The pet was killed End If```Just add this in "Sub PlayerAttackNpc" underneath```MapNpc(MapNum).Npc(mapNpcNum).Vital(Vitals.HP) = 0```It's now bug-free. Be jolly and whatnot. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Ok np, im not attacking you its just i know you are a very reputable member, so when i seen the topic i didnt expect to need to add any fixes and when i did i just assumed you overlooked them. Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Would you mind sharing some light on how your pet food works? just because i couldnt for the life of me figure out why the hell they turn to ghosts (they are there and move around/can be controlled) if they get healed even once? Link to comment Share on other sites More sharing options...
Yxxe Posted June 30, 2011 Author Share Posted June 30, 2011 @Fragment:> Ok np, im not attacking you its just i know you are a very reputable member, so when i seen the topic i didnt expect to need to add any fixes and when i did i just assumed you overlooked them.When I implemented the new Pet Caching, I just ripped it from my own game's source code. I guess I was just being lazy and assumed it all worked from the outset. Like I explained previously, it was all in the source code in the first place, I just forgot to add it into the tutorial. ;]@Fragment:> Would you mind sharing some light on how your pet food works? just because i couldnt for the life of me figure out why the hell they turn to ghosts (they are there and move around/can be controlled) if they get healed even once?I think I've given you enough, you can figure it out. :] Link to comment Share on other sites More sharing options...
Fragment Posted June 30, 2011 Share Posted June 30, 2011 Ok then time to go play with this pet even more, i will post a fix when i find one Link to comment Share on other sites More sharing options...
Fragment Posted July 2, 2011 Share Posted July 2, 2011 Im sorry to say but even with all the patching and fixes on the forums, this is too buggy to use, anytime you edit the map it will store peoples pets and any time the server closes down, the pets remain stuck to the map. Link to comment Share on other sites More sharing options...
Yxxe Posted July 2, 2011 Author Share Posted July 2, 2011 @Fragment:> Im sorry to say but even with all the patching and fixes on the forums, this is too buggy to use, anytime you edit the map it will store peoples pets and any time the server closes down, the pets remain stuck to the map.Editing maps shouldn't occur in a live game, only on a development server. I did make it very clear early on that you shouldn't edit maps while a pet is out. By all means, go and fix it for yourself. Go and find Ryokus tutorial on pet erasing for server crashes.I'm beginning to feel how ungrateful some people are in this community. 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