View Single Post
  #9  
Old 06-26-2013, 05:00 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by baseman101 View Post
Hey, final problem. When I try to copy the tiles from a level on the Gmap, it doesn't work. However, when I do a normal level, it does work.
PHP Code:
tiles[temp.x,temp.y] = findlevel("test_d04.nw").tiles[temp.x,temp.y]; 
Doesn't work, connected to the gmap
PHP Code:
tiles[temp.x,temp.y] = findlevel("test.nw").tiles[temp.x,temp.y]; 
Works, not connected to the gmap
I don't think you'll be able to get this to work. findLevel is returning the level object, and on serverside a GMAP is treated like one big level.

The best solution would be to simply calculate the offset of the player's current level on the GMAP, and figure out the tiles relative to that offset. Something like

PHP Code:
temp.pl findPlayer2(this.plAcc);

// offset of the current level on the GMAP in tiles
temp.offsetx int(temp.pl.64) * 64;
temp.offsety int(temp.pl.64) * 64;

// get the level's tiles using the offset
for (temp.0temp.64temp.++) {
  for (
temp.0temp.64temp.++) {
    
temp.tile temp.pl.level.tiles[temp.temp.offsetxtemp.temp.offsety];
  }

Quote:
Originally Posted by callimuc View Post
regarding level name: using player.level.name should also return the level name instead of the gmaps name
On serverside, if the GMAP is setup correctly, it will return the GMAP name, since the NPC-server sees the GMAP as one big TServerLevel.
__________________
Reply With Quote