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 04-13-2011, 06:27 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
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?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 04-13-2011 at 08:53 PM..
Reply With Quote
  #2  
Old 04-14-2011, 06:31 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
So I'm guessing this is some kinda of gmap bug, works fine in individual levels and clientside on gmaps, just not serverside.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #3  
Old 04-14-2011, 07:25 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
what does your triggeraction/server look like?
__________________
Reply With Quote
  #4  
Old 04-14-2011, 07:49 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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.
__________________
Quote:
Reply With Quote
  #5  
Old 04-14-2011, 08:09 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by fowlplay4 View Post
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.
Reply With Quote
  #6  
Old 04-14-2011, 08:50 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Mark Sir Link View Post
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.
__________________
Quote:
Reply With Quote
  #7  
Old 04-14-2011, 09:18 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
still on a gmap, it wont allow you to do changes tiles, even without findLevel()

Quote:
Originally Posted by fowlplay4 View Post
@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.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!

Last edited by MrOmega; 04-15-2011 at 05:26 AM..
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 02:02 PM.


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