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

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
is it possible to control the npc. like call petmove or something. cause i want him to move to where i tell him but i couldnt find a part that controls his movement in the script. i'd like him to move 1 tile infront of him or the left or right depending on how i ask him to move.

how would i achieve this.
Link to comment
Share on other sites

@Greendude120:

> is it possible to control the npc. like call petmove or something. cause i want him to move to where i tell him but i couldnt find a part that controls his movement in the script. i'd like him to move 1 tile infront of him or the left or right depending on how i ask him to move.
>
> how would i achieve this.

You could make it so when you click on a tile position, it calls a procedure which set's the NPC targetting to that tile. You would have to slightly modify the pre-existing source code for that though, it can't be done with the current source code I have provided.
Link to comment
Share on other sites

@Greendude120:

> i wanted that but i cant find the On Click sub anymore. its been changed from ES to EO ofc but i cant find the new name or the new sub that controls clicking tiles. i guess ill post on Q&A i got few others quesitons.
>
> ty for the reply man:)

Ok, best of luck with it. ;]
Link to comment
Share on other sites

@Salted:

> Hey, When i try to compile the server, I get "Ambiguous name detected" with
> "Sub PetFollowOwner(ByVal Index As Long)" Any ideas?
> Thanks in advance.

You've obviously pasted the same procedure twice. Get rid of one of them. ;]
Link to comment
Share on other sites

is it possible to make it so the pets move faster than what they move now? Because i want pets to be able to catch the enemy player, and the players speed will be fast, so can i make it if if the target is far away it runs after him? Also is it possible to make it so that the npcs move more smoothly, and not pause after each step?
Link to comment
Share on other sites

@gdog12356:

> is it possible to make it so the pets move faster than what they move now? Because i want pets to be able to catch the enemy player, and the players speed will be fast, so can i make it if if the target is far away it runs after him? Also is it possible to make it so that the npcs move more smoothly, and not pause after each step?

Increase the amount of times per second the NPC logic is updated.
Link to comment
Share on other sites

@gdog12356:

> pets dont dissapear when i log off >_>

Then you've done something wrong. Go through the tutorial again.
@gdog12356:

> would that that be in server or client?
> edit: where in the server would i haev to edit?

modServerLoop.
Link to comment
Share on other sites

@gdog12356:

> ok, so i found out where i have to edit```
> UpdateMapLogic
> ```but i do not see any timers for npc movement, nor do i see any timers to update the map >_>.

UpdateMapLogic does update NPC movement >_>

```
If Tick > tmr500 Then
            For i = 1 To MAX_PLAYERS
                If frmServer.Socket(i).State > sckConnected Then
                    Call CloseSocket(i)
                End If
            Next
            UpdateMapLogic
            tmr500 = GetTickCount + 500
        End If
```
Change the "GetTickCount + 500" "GetTickCount + x", where "x" is the number of milliseconds. It will update every x milliseconds. You may want to keep socket checking out of that though, so I would break the socket checking and map logic timers into 2 separate ones.
Link to comment
Share on other sites

@Lightning:

> UpdateMapLogic does update NPC movement >_>
>
> ```
> If Tick > tmr500 Then
>             For i = 1 To MAX_PLAYERS
>                 If frmServer.Socket(i).State > sckConnected Then
>                     Call CloseSocket(i)
>                 End If
>             Next
>             UpdateMapLogic
>             tmr500 = GetTickCount + 500
>         End If
> ```
> Change the "GetTickCount + 500" "GetTickCount + x", where "x" is the number of milliseconds. It will update every x milliseconds. You may want to keep socket checking out of that though, so I would break the socket checking and map logic timers into 2 separate ones.

thanks.

also i think i found a bug, but it might just be how i added it, i can attack my own pet. Also sometimes when i am walking to the right or left, and i stop the npc stops 2 tiles behind me, and the tile behind me is blocked. Also sometimes the pets dont show the moving animation. Like it just shows them changing positions, but not really moveing.
Link to comment
Share on other sites

@gdog12356:

> thanks.
>
> also i think i found a bug, but it might just be how i added it, i can attack my own pet. Also sometimes when i am walking to the right or left, and i stop the npc stops 2 tiles behind me, and the tile behind me is blocked. Also sometimes the pets dont show the moving animation. Like it just shows them changing positions, but not really moveing.

1\. Attacking your own pet isn't a bug, I just didn't put it in in the first place. I remember saying earlier in the thread that I left it out as I considered it as a design choice. I'm sure you will be able to write a sufficient If statement to stop that.

2\. That's just the path finding already in the engine, that's nothing to do with me.

3\. That means that the map hasn't been cached properly. For the last time, make sure you follow the tutorial correctly.
Link to comment
Share on other sites

  • 4 weeks later...
@RyokuHasu:

> sorry for bumping but I added a new Mod to this, basic PVPet checks
>
> http://www.touchofdeathforums.com/smf/index.php/topic,72517.msg778251.html
>
> Enjoy

I know, I trust this works correctly. ;) I'll add it to the mods list.
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...