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

[Any Event Version] Basic Instanced Maps


JohnPony
 Share

Recommended Posts

Send a request client-side that'll check if the map exists and return a query to the server, then if the user doesn't have it warp the player to the normal map first, and THEN instance them.(or alternatively, just send the map data and the instance command after that).. If they have it, great and just send them to the instance.
Link to comment
Share on other sites

im sure you just spoke Chinese, i would not know where to start with what you said,

Filename = map100.dat

Filename2 = map0.dat

and neither exist

i think i found the place of error,

in the playermove sub

```

If .Type = TILE_TYPE_INSTANCE Then

' Check if already on instanced map

If GetPlayerMap(Index) >= 100 Then

Moved = NO

Else

' New Instance

For i = 1 To MAX_MAPS ''' it was i = 100 to max_maps

If GetTotalMapPlayers(i) > 0 Then

CanWarp = False

Else

CanWarp = True

End If

If CanWarp Then

' Save Previous Coords

Player(Index).PrevMap = GetPlayerMap(Index)

Player(Index).PrevX = GetPlayerX(Index)

Player(Index).PrevY = GetPlayerY(Index)

' Instance New Map

Call InstanceMap(.Data1, i, Index)

' Warp Player(s)

If TempPlayer(Index).inParty Then

Call PartyWarp(Index, i, .Data2, .Data3, True)

Else

Call PlayerWarp(Index, i, .Data2, .Data3)

End If

Exit For

End If

Next i

End If

Moved = YES

End If

End With
```
but still pulls map numbers: Filename=map1.dat and Filename2= map0.dat although im on map 6

upon further testing, if you put this instead```
Call InstanceMap(.Data1, MapNum, Index)
```
it pulls the correct map number instead of the player index number, but still fails to copy, so i changed

```

' Save new copy

filename = App.path & "\data\maps\map" & mapCopyNum & ".dat"

Filename2 = App.path & "\data\maps\map" & mapCopyNum & ".dat"

```

for testing purposes, i have the map "6" but still same runtime error
Link to comment
Share on other sites

Well, what I just said had nothing to do with that issue.. I was just stating how the whole instance thing could be fixed so that it doesn't crash on maps you haven't been to yet. And your above problem.. Not a clue, never cared to look into this system.
Link to comment
Share on other sites

I fixed this bug…then my client froze and I hadn't saved, went to CTRL ALT DELETE and ended the process...ended the server by accident...lost everything. But I'm pretty sure the problem lies with the optInstance code, or something like that. It's got SOMETHING to do with the warp. If I remember for sure I'll post!
Link to comment
Share on other sites

I thought i included the code to create the cached map client side, when i have more time ill look and see if i left it out.

There are so many things i left out this tutorial and the instance system, i'm just going to rewrite them both and take it slow.

Until then i'm locking this.
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...