12-03-2007, 11:41 PM
Name: Brush By
By: Matt(Silver)
Dificulty: 1/5(with slight understanding of code)
Ever wondered what a 2D game would be like with nothing but assholes? You make a narrow path, and a group of them decide to block the way?
Or how about when you got a pker on your server who needs to run, but an NPC is blocking his way to safety?
Well, you can fix all that with my 'Brush By' Feature.
Simply, I just made it to where if you move against a Player or NPC for 2 seconds, you'll 'walk' by them. Of course, it might not be the best thing to implement in the open, but in places like Cities, Towns, Inns, pretty much any safe point you have, that'll be a nice feature to have.
*Everything is Client-Side*
All you have to do is add one variable. At the top of modGameLogic, declare this:
Now, you've got the variable, what do you do?
Look for these comments in the sub CanMove
and
Wherever you see that code, in that little 'block' of code, replace
With
You should be doing this four times(for each direction!)
That'll just make it to where, if 2 seconds go by(calculated in my head... I may be wrong...) you'll just walk by the NPC or Player, so long as you're on a safe map.
Now, if you can code, you should know how to do this remotly. Even better, you should make it to where this effect only works in towns and stuff. I'm not gonna show you guys how to do that because, well, I'm writing a Pokemon Game and it isn't necessary for my game.
That wasn't too hard, now was it? I hope you guys can make good use of this code. Assholes, beware!
By: Matt(Silver)
Dificulty: 1/5(with slight understanding of code)
Ever wondered what a 2D game would be like with nothing but assholes? You make a narrow path, and a group of them decide to block the way?
Or how about when you got a pker on your server who needs to run, but an NPC is blocking his way to safety?
Well, you can fix all that with my 'Brush By' Feature.
Simply, I just made it to where if you move against a Player or NPC for 2 seconds, you'll 'walk' by them. Of course, it might not be the best thing to implement in the open, but in places like Cities, Towns, Inns, pretty much any safe point you have, that'll be a nice feature to have.
*Everything is Client-Side*
All you have to do is add one variable. At the top of modGameLogic, declare this:
Code:
Private BrushBy As Byte
Now, you've got the variable, what do you do?
Look for these comments in the sub CanMove
Code:
' Check to see if a player is already on that tile
and
Code:
' Check to see if a npc is already on that tile
Wherever you see that code, in that little 'block' of code, replace
Code:
CanMove = False
With
Code:
If BrushBy < 20 Then
CanMove = False
BrushBy = BrushBy + 1
Else
If Map.Moral = MAP_MORAL_SAFE Then
CanMove = True
BrushBy = 0
Else
BrushBy = 0
CanMove = False
End If
End If
You should be doing this four times(for each direction!)
That'll just make it to where, if 2 seconds go by(calculated in my head... I may be wrong...) you'll just walk by the NPC or Player, so long as you're on a safe map.
Now, if you can code, you should know how to do this remotly. Even better, you should make it to where this effect only works in towns and stuff. I'm not gonna show you guys how to do that because, well, I'm writing a Pokemon Game and it isn't necessary for my game.
That wasn't too hard, now was it? I hope you guys can make good use of this code. Assholes, beware!