Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brush By
#1
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:

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!
Reply
#2
You can easily edit this to make a nice little walk by effect which will take you to the other side of the player/npc. Rather than just been able to stand on the person (from quickly reading the code I think that's what happens)
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
I think it would be cool if as you say push against someone/something for 2 seconds but if theres nothing behind them it pushes them/the npc 1 square in that direction... then i guess you could add an npc attribute, 'pushable (yes/no)'.

Even better, right click the player/npc and it brings up a cute lil menu thing...

Push North
Push East
Push west
Push south

or whatever, and if you cant push them in that direction its greyed out...

getting carried away with my ideas, oh noes =P
Reply
#4
Eh, my code was only the bases for what could be what you guys suggested.

Robin, you're right. You can stand on them. xD

Anyways, I helped the newbies, and the advanced peeps can do what they want with it. =O
Reply
#5
Good idea Matt. I've seen the result of blocking on Pokemon, so this idea is a great addition.
Reply
#6
It really is Smile nice tute Big Grin
Reply
#7
Fox Wrote:I think it would be cool if as you say push against someone/something for 2 seconds but if theres nothing behind them it pushes them/the npc 1 square in that direction... then i guess you could add an npc attribute, 'pushable (yes/no)'.

Even better, right click the player/npc and it brings up a cute lil menu thing...

Push North
Push East
Push west
Push south

or whatever, and if you cant push them in that direction its greyed out...

getting carried away with my ideas, oh noes =P

Or just make an npc move if they have someone pushing against them. like in ff and pokemon
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#8
Edited to make it work only on certain map morals.
Reply
#9
Great job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)