Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Lightning's Pet System [Completely Bug-Free!]


Yxxe
 Share

Recommended Posts

Everything is done now. I would go through the tutorial again and find get all the fixes. Nothing else needs doing with this now, I ripped most of it out of my game in which this system fully works. I've made a server-side cache for pets to stop de-syncing for new clients.  I also fixed the Map NPC overwrite, as well as other things. If it doesn't work for you, you've **not** followed the tutorial correctly. (Except in the case where I may have forgotten to add something to the tutorial). The array number moving for pet cache could strain the server, so I suggest writing something faster such as a linked list for it (if you know what one is).

@Ryoku: You can stop "fixing" things now. ;)

Regards,

Lightning
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

sorry it was soooo tempting to fix it up even better than before XD

@RyokuHasu:

> I didnt take creadit from you I was taking credit for my fixes, i was saying cite credit for both. Im sorry if you think i was taking all the credit, i just wanted credit for some fixes. =P 
>
> and alot of these fixes did not work before, you didnt rewarp the players to the map in most of the cases, wich is what most of these are, just rewarping the map.
>
> the pet cleaner part is to help those who were complaining about the pets not getting removed thier game was spammed with "trash pets"
>
> also if it make you feel any better i removed the cite credit lines.
Link to comment
Share on other sites

Ok I sloved the IsPet and PetData problem, but now I've got this:

>! ![](http://img708.imageshack.us/img708/8872/petmapcacheerror.png)

I removed all NPC's and Map's.
(though sometime I need to learn how to use and code a converter..)

Edit: My 100th post, yay. eheh
Link to comment
Share on other sites

@Lightning:

> Have you updated the MapNpc UDT correctly? You must have skipped it as I haven't seen that error since I released this tutorial. :P

Well I added:
IsPet As Byte
and
PetData As PetRec to Map

To 'MapNpcRec'
And it went on. .. to the next error.. :P

I've got this new problem, I edited my post just after you replied. eheh
(About PetMapCache… now I'm lost, heh)
Link to comment
Share on other sites

Oh, excuse me. eheh

I meant that I did update my previous post with my new problem:

> Ok I sloved the IsPet and PetData problem, but now I've got this:
>
> >! ![](http://img708.imageshack.us/img708/8872/petmapcacheerror.png)
>
> I removed all NPC's and Map's.
> (though sometime I need to learn how to use and code a converter..)
>
> Edit: My 100th post, yay. eheh

Eh, yea.. this problems really makes me lost, I can't even think of something at the moment.

So, the Server compiling is telling me I didn't add the Sub of PetMapCache, or there is something wrong with PetMapCache at my side, but I can't fingure it out..

Edit:
```
Public Type PetCache
    Pet(1 To MAX_MAP_NPCS) As Long
    UpperBound As Long
End Type

Public PetMapCache(1 To MAX_MAPS) As PetCache

```
I think I've placed that code wrong.

I just placed it right after:
```
'View Current Pets on Map
    If PetMapCache(Player(Index).Map).UpperBound > 0 Then
        For j = 1 To PetMapCache(Player(Index).Map).UpperBound
            Call NPCCache_Create(Index, Player(Index).Map, PetMapCache(Player(Index).Map).Pet(j))
        Next
    End If
```Because I thought it should be safe to do so.

Maybe I got it wrong there, eh?
Link to comment
Share on other sites

lol, put the PetMapCache global call and the PetMapCache type in modGlobals, not in a procedure. xD

I also just skimmed through the code and got rid of a few things which would cause an error. (Not for me, for you) ;)
Link to comment
Share on other sites

Ah, so there it was supposed to go. Oh my.. I should read more carefully.

Thanks for your time and help Lightning. :)

> I also just skimmed through the code and got rid of a few things which would cause an error. (Not for me, for you) ;)

Ah, I indeed noticed it was touched not to long ago.
So, I'll go and re add everything on both Server and Client again?
* Or actually, remove some code.. haha
Link to comment
Share on other sites

@adr990:

> Ah, so there it was supposed to go. Oh my.. I should read more carefully.
>
> Thanks for your time and help Lightning. :)
> Ah, I indeed noticed it was touched not to long ago.
> So, I'll go and re add everything on both Server and Client again?
> * Or actually, remove some code.. haha

There should be 3 things that crop up:

-DestroyAllParticles(Index)
-2 lots of MapNpc[…..]PetData.Level

and yes, you can either comment them out or just delete them. ;]
Link to comment
Share on other sites

Uh Zopto, read what Lightning just posted:
"put the PetMapCache global call and the PetMapCache type in modGlobals, not in a procedure. xD"
I placed it wrong too.. *shudders*  .. [/ashamed]

So this:
```
Public Type PetCache
    Pet(1 To MAX_MAP_NPCS) As Long
    UpperBound As Long
End Type

Public PetMapCache(1 To MAX_MAPS) As PetCache

```
Should go in "modGlobals"

Edit:
Sorry for double post.
Link to comment
Share on other sites

@adr990: That's just me being a fool and forgetting to add the variable definitions. I'm assuming its in "Sub JoinGame" ;]

Place this at the top of "Sub JoinGame"

```
Dim i As Long, j As Long
```
That should be it now. If not, it will just be a missing variable definition like I just stated. Pasting that in the sub that is causing the error with PetMapCache should fix it.
Link to comment
Share on other sites

Oh I just fingured, and replaced the j's by i's instead of changing the Dim, I didn't see the Dim yet.
I'll fix it up the right way this time, eh.

And yes, this should fix it. :)

-=-
Yep, ofcourse it did. haha

Great man, thanks for helping me through those little mistakes of fail.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...