At the end of this tutorial your players will be able to walk through each other but ONLY on Safe maps.
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
What this has done has allowed us to not let players walk through NPCs (you’ll see why later).
Next, add this:
If Map.Moral = MAP_MORAL_SAFE Then Exit Function
' Check to see if a player is already on that tile
Now that line of code tells the game to ignore the check that checks whether another player is already on the tile IF the map is a safe map. Now you can see why we put the NPC on the same tile check above that line, so it doesn’t also exit out.
And thats it, goodluck!