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

@adr990:

> Heya,
>
> edit nvm, figured it out:
>
> -=-
>
> Also, are there any requirments for the NPC which will be the Pet?
> Does it need atleast 1hp etc. and every stat 1 etc?
>
> Thanks in advance,
> Adr990

Just the things you would usually set with NPCs you want players to attack. ;]
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

@BugSICK:

> thanks the code light, i was confused which code i will start in.  :mad:, can you add a pet loot? a looter pet.

No problem. ;]

@Lightning:

> When this tutorial is over, you should have created a solid Pet System base to work on further, which also includes a few key features for any pet system.

Which means you have to do the rest yourself.
Link to comment
Share on other sites

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.
![](http://www.freemmorpgmaker.com/files/imagehost/pics/920962fd19c483a943a59cfa0a2384b5.png)
![](http://www.freemmorpgmaker.com/files/imagehost/pics/c36238a897c3150dab6c8e103edc3fc9.png)
did i miss something???
Link to comment
Share on other sites

I think you must have missed something. Could you do something for me? If you put a breakpoint on "MapNum = Buffer.ReadLong" in Sub HandleNPCCache and take note of the value please? The only thing I can think of is that the MapNum is zero or tile data hasn't been read in yet.

EDIT: When reading in the MapNum, make sure it reads the data first before taking the value. Let the "current execution" as it were go to the next line and then hover your mouse over "MapNum". ;]
Link to comment
Share on other sites

did understant what you mean. but heres the code in sub handlenpccache

```
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 = Nothing

End Sub
```
also im concerned about what i put in number. 1 is the NPC number. did i put it right???
```
'create the pet for the map
    Map(PlayerMap).Npc(PetSlot) = 1
    MapNpc(PlayerMap).Npc(PetSlot).Num = 1
    'set its Pet Data
    MapNpc(PlayerMap).Npc(PetSlot).IsPet = YES
    MapNpc(PlayerMap).Npc(PetSlot).PetData.Name = GetPlayerName(index) & "'s " & Npc(1).Name
    MapNpc(PlayerMap).Npc(PetSlot).PetData.Owner = index

    'If Pet doesn't exist with player, link it to the player
    If Player(index).Pet.SpriteNum <> 1 Then
        Player(index).Pet.SpriteNum = 1
        Player(index).Pet.Name = GetPlayerName(index) & "'s " & Npc(1).Name
    End If
```
Link to comment
Share on other sites

Yes, how you have added the 1's is fine.

Do you know how to set a breakpoint? Click the grey strip in the IDE next to where it says "SaveMap(MapNum)", then run the client. Once it gets to this part, hover over "MapNum" and tell me what the value is.
Link to comment
Share on other sites

@BugSICK:

> my friend i dont know  :sad:, any screenshots??? huhuhuh. ok i will figure it out. give me a min.
>
> edit: its MapNum = 1

Hrm… strange. You must have either missed something out or put something in the wrong order. I would suggest going through the tutorial again to see whether you have missed anything out. :]
Link to comment
Share on other sites

@BugSICK:

> 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.
> ![](http://www.freemmorpgmaker.com/files/imagehost/pics/920962fd19c483a943a59cfa0a2384b5.png)
> ![](http://www.freemmorpgmaker.com/files/imagehost/pics/c36238a897c3150dab6c8e103edc3fc9.png)
> 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.
Link to comment
Share on other sites

@Ravenshade:

> kind of a minor issue…but... I can't find where to edit the GUI menu labels >_> (still looking)

I beleive you add them yourself then dbl-click on them to edit their code.

(100% asuming you mean "Call pet" , "follow", ect labels)

now if you mean the menu lable where it opens the pet window, same thing too.
Link to comment
Share on other sites

When I start up the game and click in any label, appear an error box '-'
and after "ok" points to "call" code '-'

help-me please

this is the image of error

![](http://www.freemmorpgmaker.com/files/imagehost/pics/1c6298d9a75a3b3a2f00d73d12d3f0eb.png)
Link to comment
Share on other sites

I have a quick question… Now that i have the code in how do i make a pet in-game?
please help... srry if you guys already answer it but please answer it again...( i read alot of the post here, so tire and my eyes hirt so i stop reading) thanks in advance!
Link to comment
Share on other sites

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)
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...