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

Custom NPC Speed


Growlith1223
 Share

Recommended Posts

This was a request by zzBrandon so yea lol

Ok so go into ModTypes and goto NpcRec and add

```

Speed As Byte

```
Also do that in the client as well

Then on frmEditor_NPC, add a scrollbar and a label..

lblSpeed

scrlSpeed

Once done add this to scrlSpeed_Change

```

lblSpeed.Caption = "Speed: " & scrlSpeed.Value

Npc(EditorIndex).Speed = scrlSpeed.Value

```
After that go into NPCEditorInit or whatever the sub is called to initialize everything and add

```

.scrlSpeed.Value = Npc(EditorIndex).Speed

.lblSpeed.Caption = "Speed: " & Npc(EditorIndex).Speed

```

Then go into ModGameLogic, find ProcessNPCMovement and add this at the top

```

Dim WalkSpeed As Byte

```
After that, where it says If MapNpc(MapNpcNum).Moving = MOVING_WALKING Then, Add this below that line

```

Select Case Npc(MapNpc(MapNpcNum).num).Speed

Case Is >= 0

WalkSpeed = Npc(MapNpc(MapNpcNum).num).Speed

Case Is <= 0

WalkSpeed = WALK_SPEED

End Select

```

THEN

Replace the WALK_SPEED with WalkSpeed…only replace in ProcessNPCMovement

It should work then, if there's anything missing, lemme know! ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png)
Link to comment
Share on other sites

I did this a while back, but decided not to post it as the npc's looked hilarious when they were chasing a player and their speed was increased. Regardless, good job! ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

  • 2 weeks later...
> then you didn't follow the tutorial correctly ._.

I figured I didn't, I will try again.

Quick question : When you say Replace the```
WALK_SPEED
```with```
WalkSpeed
```…only replace in ProcessNPCMovement

Am i replacing every single "WALK_SPEED" in that sub or whatnot

also

when you say

After that go into NPCEditorInit or whatever the sub is called to initialize everything and add

```
.scrlSpeed.Value = Npc(EditorIndex).Speed

.lblSpeed.Caption = "Speed: " & Npc(EditorIndex).Speed
```

where exactly in that sub do i put this info?
Link to comment
Share on other sites

I got it to turn on and it worked fine (althougnh i didnt hit send to know if it fully works yet on my version of eclipse) but when i tried setting the walkspeed up really high it crashed with an overflow error, what is the max walkspeed i should set this too so i can tell the scrollbar a max? I know its probably a noobish question and I'm thinking maybe like 255 or something but i wanted to ask first. thanks for reading and putting out this epic and simple system. =]

```
(highlighted area in error is `NPC(EditorIndex).Speed = scrlSpeed.Value`
```
Link to comment
Share on other sites

  • 2 weeks later...

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