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

Coding help


Orake the GM
 Share

Recommended Posts

well you have it checking the maps highest possible x coordinate Map(mapNum).MaxX

and then here you have it using the next x tile Map(mapNum).Tile(x + 1, y).Type

it's not going to even exist if you are standing on the maps max x coordinate (i.e map is 15 tiles wide, you are standing on tile 15, it will check tile 16….)

same goes for the Y values

I would of gave exact locations in the script if you would of copied the actual code into code and /code [ ]'s but you uploaded screenshots and I am not going to retype that entire code block from an image ;)
Link to comment
Share on other sites

ok in that case
Bug 1
' Directional blocking
If isDirBlocked(Map(mapNum).Tile(player(index).Char(TempPlayer(index).CurChar).Pet.x, player(index).Char(TempPlayer(index).CurChar).Pet.y).DirBlock, DIR_DOWN + 1) Then
CanPetMove = False
Exit Function
End If
Else
CanPetMove = False
End If

Bug 2

Case DIR_RIGHT

' Check to make sure not outside of boundries
If x <= Map(mapNum).MaxX And x > 0 Then
If y <= Map(mapNum).MaxY And y > 0 Then
n = Map(mapNum).Tile(x + 1, y).Type

' Check to make sure that the tile is walkable
If n <> TILE_TYPE_WALKABLE And n <> TILE_TYPE_ITEM And n <> TILE_TYPE_NPCSPAWN And n <> TILE_TYPE_NPCAVOID Then
CanPetMove = False
Exit Function
End If

If anyone can fix it thankyou!
and Sherwin ur still alive :O what happened to you lol
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...