Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   servrside tilelayers issue (https://forums.graalonline.com/forums/showthread.php?t=134262805)

MrOmega 04-13-2011 06:27 PM

servrside tilelayers issue
 
So, I'm adjusting tiles serverside and if the layer I choose is 0, it works fine, but if it's >0 it doesn't seem to do anything. Is they're something I'm doing wrong? This works fine clientside, except it doesn't update the tiles for all players.

params are
{ action, layer, arrayTiles, x, y, w, h}

PHP Code:

function onActionServerside()
{

  if ( 
params0] == "PlaceTiles")
  {

    for ( 
temp.0temp.params6]; temp.++;)
    {
    
      for ( 
temp.0temp.params5]; temp.++;)
      {
      
        
findLevelplayer.level).tilelayersparams1]].tiles[( params3] + temp.b) % 64, ( params4] + temp.a) % 64] = params2][ temp.c]; 
        
temp.++;
    
      }
    }
    
    
findLevelplayer.level).tilelayersparams1]].updateBoard2params3], params4], params5], params6]);
 
  }


e. Also, does anyone know why polygons wont draw in an external window?

MrOmega 04-14-2011 06:31 PM

So I'm guessing this is some kinda of gmap bug, works fine in individual levels and clientside on gmaps, just not serverside.

xAndrewx 04-14-2011 07:25 PM

what does your triggeraction/server look like?

fowlplay4 04-14-2011 07:49 PM

You can use player.level instead of findlevel().

player.level is the level object they're in.
player.level.name is the string name. I.e: level.nw

I also remember a recent post by ffcmike saying findlevel was not working for specific/individual levels on GMAPs anymore.

Mark Sir Link 04-14-2011 08:09 PM

Quote:

Originally Posted by fowlplay4 (Post 1643314)
You can use player.level instead of findlevel().

player.level is the level object they're in.
player.level.name is the string name. I.e: level.nw

I also remember a recent post by ffcmike saying findlevel was not working for specific/individual levels on GMAPs anymore.

It's not, I was having issues with this the other night.

If the level is in a GMAP and you try to findlevel it, will get an empty string returned.

fowlplay4 04-14-2011 08:50 PM

Quote:

Originally Posted by Mark Sir Link (Post 1643320)
It's not, I was having issues with this the other night.

If the level is in a GMAP and you try to findlevel it, will get an empty string returned.

A GMAP is still a TServerLevel object, so I think you just misread what I said. I was just pointing out that he doesn't need to use findlevel at all.

Code:

PHP Code:

function onCreated() {
  
with (findplayer("fowlplay4")) {
    echo(
"Level Type: " player.level.objecttype());
    echo(
"Level Name: " player.level.name);
    echo(
"GMAP Level: " player.level.getmappartfile(player.xplayer.y));
    echo(
"GMAP Level Type: " findlevel(player.level.getmappartfile(player.xplayer.y)).objecttype());
  }


Quote:

Originally Posted by Output
Level Type: TServerLevel
Level Name: zodiacworld.gmap
GMAP Level: zodiacworld_ak14.nw
GMAP Level Type: 0 (Indicates that findlevel doesn't work on specific GMAP levels)

Level Type: TServerLevel
Level Name: onlinestartlocal.nw
GMAP Level: onlinestartlocal.nw
GMAP Level Type: TServerLevel

@Omega: Check if it's working in the top-left corner of your GMAP, and if it is try removing the '% 64' because according to the output above you're finding the GMAP level as a whole not the specific level.

MrOmega 04-14-2011 09:18 PM

still on a gmap, it wont allow you to do changes tiles, even without findLevel()

Quote:

Originally Posted by fowlplay4 (Post 1643327)
@Omega: Check if it's working in the top-left corner of your GMAP, and if it is try removing the '% 64' because according to the output above you're finding the GMAP level as a whole not the specific level.

I always test in the top left of a gmap, just a habit, also this is on layers above zero, layer zero I can change just fine

@Andrew
PHP Code:

triggerServer"gui"name"PlaceTiles"Tile_Editor_Layer.textthis.tileDatafindImg200).xfindImg200).y, (( this.pW this.pX) / 16), (( this.pH this.pY) / 16)); 

e. upon further investigation, tried echo the tiles on layer[ 1] before I changed them and it is NULL, when it should be 1248
Checking the type on player.level.tilelayers is 3, and tilelayers[ 0] is 2, but on player.level.tileslayers[ 1] is -1, on a single level both layers 0 and 1 type is 2

So yes, this is a Gmap bug. On A gmap a server cant read tiles above layer zero.


All times are GMT +2. The time now is 08:36 AM.

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