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

Player Character Noclip on each other


EdSabbath
 Share

Recommended Posts

I am in desperate need of help. I'm tired of players running into each other and not being able to move. Makes it impossible to make narrow maps!

I know that if they run through each other, PKing is near impossible, but that's OK because there is no PKing in my game.

So how do I shut off collisions between player characters?
Link to comment
Share on other sites

In the server source there's a sub that checks whether a player can move or not.. Change it so it doesn't check if there's a player around anymore. :)

EDIT : Hmm, apparently the CanMove sub is on the client side.. That's asking for speed hacking? Anyways, this should do the trick:
```
Function CanMove() As Boolean
    Dim I As Long
    Dim X As Long
    Dim Y As Long

    CanMove = True

    If Player(MyIndex).Moving <> 0 Then
        CanMove = False
        Exit Function
    End If

    ' Make sure they haven't just casted a spell
    If Player(MyIndex).CastedSpell = YES Then
        If GetTickCount > Player(MyIndex).AttackTimer + 1000 Then
            Player(MyIndex).CastedSpell = NO
        Else
            CanMove = False
            Exit Function
        End If
    End If

    X = GetPlayerX(MyIndex)
    Y = GetPlayerY(MyIndex)

    If DirUp Then
        Call SetPlayerDir(MyIndex, DIR_UP)
        Y = Y - 1
    ElseIf DirDown Then
        Call SetPlayerDir(MyIndex, DIR_DOWN)
        Y = Y + 1
    ElseIf DirLeft Then
        Call SetPlayerDir(MyIndex, DIR_LEFT)
        X = X - 1
    Else
        Call SetPlayerDir(MyIndex, DIR_RIGHT)
        X = X + 1
    End If

    If Y < 0 Then
        If Map(GetPlayerMap(MyIndex)).Up > 0 Then
            Call SendPlayerRequestNewMap(DIR_UP)
            GettingMap = True
        End If
        CanMove = False
        Exit Function
    ElseIf Y > MAX_MAPY Then
        If Map(GetPlayerMap(MyIndex)).Down > 0 Then
            Call SendPlayerRequestNewMap(DIR_DOWN)
            GettingMap = True
        End If
        CanMove = False
        Exit Function
    ElseIf X < 0 Then
        If Map(GetPlayerMap(MyIndex)).Left > 0 Then
            Call SendPlayerRequestNewMap(DIR_LEFT)
            GettingMap = True
        End If
        CanMove = False
        Exit Function
    ElseIf X > MAX_MAPX Then
        If Map(GetPlayerMap(MyIndex)).Right > 0 Then
            Call SendPlayerRequestNewMap(DIR_RIGHT)
            GettingMap = True
        End If
        CanMove = False
        Exit Function
    End If

    If Not GetPlayerDir(MyIndex) = LAST_DIR Then
        LAST_DIR = GetPlayerDir(MyIndex)
        Call SendPlayerDir
    End If

    If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_BLOCKED Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_SIGN Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_ROOFBLOCK Then
        CanMove = False
        Exit Function
    End If

    If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_CBLOCK Then
        If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data1 = Player(MyIndex).Class Then
            Exit Function
        End If
        If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data2 = Player(MyIndex).Class Then
            Exit Function
        End If
        If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data3 = Player(MyIndex).Class Then
            Exit Function
        End If
        CanMove = False
    End If

    If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_GUILDBLOCK And Map(GetPlayerMap(MyIndex)).Tile(X, Y).String1 <> GetPlayerGuild(MyIndex) Then
        CanMove = False
    End If

    If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_KEY Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_DOOR Then
        If TempTile(X, Y).DoorOpen = NO Then
            CanMove = False
            Exit Function
        End If
    End If

    For I = 1 To MAX_MAP_NPCS
        If MapNpc(I).Num > 0 Then
            If MapNpc(I).X = X Then
                If MapNpc(I).Y = Y Then
                    CanMove = False
                    Exit Function
                End If
            End If
        End If
    Next I
End Function
```
It's on the client side, just replace the whole function with that.. Do note that this is from the Eclipse Stable source. :) Note however that in rare occasions the player sprites WILL mess eachother up.. for example paperdoll being rendered mixed up, or the head/body from two players where it should render just one.
Link to comment
Share on other sites

@EdSabbath:

> Damn that was fast : O
>
> What do you reccomend compiling with once the source is edited?

You NEED Visual Basic 6 Proffessional or Enterprise, anything else doesn't work. :)

OR if you don't use any other source mods.. here's the compiled version attached :)
Link to comment
Share on other sites

@YamYam:

> @EdSabbath:
>
> > Damn that was fast : O
> >
> > What do you reccomend compiling with once the source is edited?
>
> You NEED Visual Basic 6 Proffessional or Enterprise, anything else doesn't work. :)
>
> OR if you don't use any other source mods.. here's the compiled version attached :)

Oh my god. Marry me, you amazing person you. ; )
Link to comment
Share on other sites

@YamYam:

> Rather not, I doubt my boyfriend agrees ;)

I was joking, of course. But sincerely, thank you for the compile. I don't have VB6, I'm a C/C++ guy. :3

I really doubt it would do much if I passed this source through Borland, hahaha.
Link to comment
Share on other sites

  • 4 weeks later...
@Yami:

> In the server source there's a sub that checks whether a player can move or not.. Change it so it doesn't check if there's a player around anymore. :)
>
> EDIT : Hmm, apparently the CanMove sub is on the client side.. That's asking for speed hacking? Anyways, this should do the trick:
> ```
> Function CanMove() As Boolean
>     Dim I As Long
>     Dim X As Long
>     Dim Y As Long
>
>     CanMove = True
>
>     If Player(MyIndex).Moving <> 0 Then
>         CanMove = False
>         Exit Function
>     End If
>
>     ' Make sure they haven't just casted a spell
>     If Player(MyIndex).CastedSpell = YES Then
>         If GetTickCount > Player(MyIndex).AttackTimer + 1000 Then
>             Player(MyIndex).CastedSpell = NO
>         Else
>             CanMove = False
>             Exit Function
>         End If
>     End If
>
>     X = GetPlayerX(MyIndex)
>     Y = GetPlayerY(MyIndex)
>
>     If DirUp Then
>         Call SetPlayerDir(MyIndex, DIR_UP)
>         Y = Y - 1
>     ElseIf DirDown Then
>         Call SetPlayerDir(MyIndex, DIR_DOWN)
>         Y = Y + 1
>     ElseIf DirLeft Then
>         Call SetPlayerDir(MyIndex, DIR_LEFT)
>         X = X - 1
>     Else
>         Call SetPlayerDir(MyIndex, DIR_RIGHT)
>         X = X + 1
>     End If
>
>     If Y < 0 Then
>         If Map(GetPlayerMap(MyIndex)).Up > 0 Then
>             Call SendPlayerRequestNewMap(DIR_UP)
>             GettingMap = True
>         End If
>         CanMove = False
>         Exit Function
>     ElseIf Y > MAX_MAPY Then
>         If Map(GetPlayerMap(MyIndex)).Down > 0 Then
>             Call SendPlayerRequestNewMap(DIR_DOWN)
>             GettingMap = True
>         End If
>         CanMove = False
>         Exit Function
>     ElseIf X < 0 Then
>         If Map(GetPlayerMap(MyIndex)).Left > 0 Then
>             Call SendPlayerRequestNewMap(DIR_LEFT)
>             GettingMap = True
>         End If
>         CanMove = False
>         Exit Function
>     ElseIf X > MAX_MAPX Then
>         If Map(GetPlayerMap(MyIndex)).Right > 0 Then
>             Call SendPlayerRequestNewMap(DIR_RIGHT)
>             GettingMap = True
>         End If
>         CanMove = False
>         Exit Function
>     End If
>
>     If Not GetPlayerDir(MyIndex) = LAST_DIR Then
>         LAST_DIR = GetPlayerDir(MyIndex)
>         Call SendPlayerDir
>     End If
>
>     If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_BLOCKED Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_SIGN Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_ROOFBLOCK Then
>         CanMove = False
>         Exit Function
>     End If
>
>     If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_CBLOCK Then
>         If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data1 = Player(MyIndex).Class Then
>             Exit Function
>         End If
>         If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data2 = Player(MyIndex).Class Then
>             Exit Function
>         End If
>         If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Data3 = Player(MyIndex).Class Then
>             Exit Function
>         End If
>         CanMove = False
>     End If
>
>     If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_GUILDBLOCK And Map(GetPlayerMap(MyIndex)).Tile(X, Y).String1 <> GetPlayerGuild(MyIndex) Then
>         CanMove = False
>     End If
>
>     If Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_KEY Or Map(GetPlayerMap(MyIndex)).Tile(X, Y).Type = TILE_TYPE_DOOR Then
>         If TempTile(X, Y).DoorOpen = NO Then
>             CanMove = False
>             Exit Function
>         End If
>     End If
>
>     For I = 1 To MAX_MAP_NPCS
>         If MapNpc(I).Num > 0 Then
>             If MapNpc(I).X = X Then
>                 If MapNpc(I).Y = Y Then
>                     CanMove = False
>                     Exit Function
>                 End If
>             End If
>         End If
>     Next I
> End Function
> ```
> It's on the client side, just replace the whole function with that.. Do note that this is from the Eclipse Stable source. :) Note however that in rare occasions the player sprites WILL mess eachother up.. for example paperdoll being rendered mixed up, or the head/body from two players where it should render just one.

HUUUUUH!!!  :lipsrsealed: not dam working for me ;C :sad:
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...