Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.