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

[EO] Walking through players


Guest
 Share

Recommended Posts

  • Replies 63
  • Created
  • Last Reply

Top Posters In This Topic

@abcbadboy555:

> how come it doesn't work? Are you able to walk thru npc's with this, or only other online players?

As the thread title says, only walking through players. The map moral must also be set to "Safe".
Link to comment
Share on other sites

Or, to make things more balanced in PvP maps ignore Rune and move the line of code I added into the source above the check for NPCs.
Link to comment
Share on other sites

  • 1 month later...
i gots a error when i clicked, " make TornWorlds.exe" , heres the error, i dont know if it relates to this but please helps :)

all i did was follow the codes, i even put in right spots. but, i still got the error, i dont know how fix :(,
Link to comment
Share on other sites

@QWERTYUIoP:

> That's nothing to do with this code, you screwed something up around the Animation Admin Panel…did you accidentally delete the button, or something?

Stop trying to help when you obviously know jack shit about the errors which people are posting. Getting sick of the completely unrelated instructions you've been posting.

@airdude2:

> im not sure, i just loaded my client in the vb6 and added the code above, tested it with the play button, and this poped up :(

'GetPlayerAccess' isn't a function. You should be able to gather this much from the damn error message. -_-

You've apparently deleted it. Well done.
Link to comment
Share on other sites

Yes. Completely removing anything which gives you a problem is obviously the right way to program a game engine(!)

Restore one of your backups. If you don't know enough to understand the damn error message then you shouldn't attempt to fix it.
Link to comment
Share on other sites

For some reason, my player can walk through other players, but can also walk through NPCs. Any help on why this is happening? Here's my CheckDirection Function:
```
Function CheckDirection(ByVal Direction As Byte) As Boolean
Dim x As Long
Dim y As Long
Dim i As Long

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    CheckDirection = False

    ' check directional blocking
    If isDirBlocked(Map.Tile(GetPlayerX(MyIndex), GetPlayerY(MyIndex)).DirBlock, Direction + 1) Then
        CheckDirection = True
        Exit Function
    End If

    Select Case Direction
        Case DIR_UP
            x = GetPlayerX(MyIndex)
            y = GetPlayerY(MyIndex) - 1
        Case DIR_DOWN
            x = GetPlayerX(MyIndex)
            y = GetPlayerY(MyIndex) + 1
        Case DIR_LEFT
            x = GetPlayerX(MyIndex) - 1
            y = GetPlayerY(MyIndex)
        Case DIR_RIGHT
            x = GetPlayerX(MyIndex) + 1
            y = GetPlayerY(MyIndex)
    End Select

    ' Check to see if the map tile is blocked or not
    If Map.Tile(x, y).Type = TILE_TYPE_BLOCKED Then
        CheckDirection = True
        Exit Function
    End If

    ' Check to see if the map tile is tree or not
    If Map.Tile(x, y).Type = TILE_TYPE_RESOURCE Then
        CheckDirection = True
        Exit Function
    End If

    ' Check to see if the key door is open or not
    If Map.Tile(x, y).Type = TILE_TYPE_KEY Then

        ' This actually checks if its open or not
        If TempTile(x, y).DoorOpen = NO Then
            CheckDirection = True
            Exit Function
        End If
    End If

    If Map.Moral = MAP_MORAL_SAFE Then Exit Function
    ' Check to see if a player is already on that tile
        For i = 1 To Npc_HighIndex
        If MapNpc(i).num > 0 Then
            If MapNpc(i).x = x Then
                If MapNpc(i).y = y Then
                    CheckDirection = True
                    Exit Function
                End If
            End If
        End If
    Next
    For i = 1 To Player_HighIndex
        If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
            If GetPlayerX(i) = x Then
                If GetPlayerY(i) = y Then
                    CheckDirection = True
                    Exit Function
                End If
            End If
        End If
    Next i

    ' Error handler
    Exit Function
errorhandler:
    HandleError "checkDirection", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Function
End Function
```
Link to comment
Share on other sites

Make sure you have this in your code:

    First, in **Function CheckDirection** find this:

' Check to see if a npc is already on that tile
And move that whole chunk of code (up to 'Next) above:

' Check to see if a player is already on that tile
    For i = 1 To Player_HighIndex
        If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then
            If GetPlayerX(i) = x Then
                If GetPlayerY(i) = Y Then
                    CheckDirection = True
                    Exit Function
                End If
            End If
        End If
    Next i
Link to comment
Share on other sites

  • 3 months later...
  • 7 months later...
  • 1 month later...
  • 3 months later...
  • 2 weeks later...
> I applied this to Eclipse Origins - Event System and I can walk through events! I just wanna notify you all of this bug.

Yeah sorry I didn't think about a year and a half into the future when I wrote this :].
Link to comment
Share on other sites

  • 3 weeks later...
> I applied this to Eclipse Origins - Event System and I can walk through events! I just wanna notify you all of this bug.

Put it below 'For i = 1 To Map.CurrentEvents'

Maybe a dig? IDK, but I was doing this and saw the post so I figured I'd chime in even if it's obvious.
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...