Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-27-2013, 10:08 PM
baseman101 baseman101 is offline
Scripter
baseman101's Avatar
Join Date: Nov 2012
Location: Purcellville, VA
Posts: 76
baseman101 will become famous soon enough
Detecting A Level's Tile Def

Hello, I was wondering if there was a function to detect a tileset in a level. This would be much easier with a script I have made. Is there a way to do this? I don't think so, because setting the tileset is done clientside and I would like to somehow detect the level's tileset serverside. It would be useful to have a function like this.

For example

PHP Code:
this.def findTileDef("level.nw"); 
Reply With Quote
  #2  
Old 06-27-2013, 10:11 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
You're better off having one system which handles all setting of tiledefs on the server, and simply track which tiledef you set in a variable when the system changes tiledefs.

EDIT: There is no such function afaik. at this moment.
__________________
Reply With Quote
  #3  
Old 06-27-2013, 10:12 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
If you're looking for what I think you're looking for (the tileset type) I believe this will help you:
HTML Code:
TServerLevel.tiletype(float, float) - returns integer
Either way, you should tale Chompy's advice on managing tile definitions.
Reply With Quote
  #4  
Old 06-27-2013, 10:13 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Emera View Post
If you're looking for what I think you're looking for (the tileset type) I believe this will help you:
HTML Code:
TServerLevel.tiletype(float, float) - returns integer
I believe that function simply returns the type of the tile at the given x and y in a level, for example if the tile is blocking, non-blocking etc
__________________
Reply With Quote
  #5  
Old 06-27-2013, 10:13 PM
baseman101 baseman101 is offline
Scripter
baseman101's Avatar
Join Date: Nov 2012
Location: Purcellville, VA
Posts: 76
baseman101 will become famous soon enough
Quote:
Originally Posted by Emera View Post
If you're looking for what I think you're looking for (the tileset type) I believe this will help you:
HTML Code:
TServerLevel.tiletype(float, float) - returns integer
Either way, you should tale Chompy's advice on managing tile definitions.
I meant the tileset, but I can easily figure it out from there.

Edit: nevermind
Reply With Quote
  #6  
Old 06-27-2013, 10:15 PM
baseman101 baseman101 is offline
Scripter
baseman101's Avatar
Join Date: Nov 2012
Location: Purcellville, VA
Posts: 76
baseman101 will become famous soon enough
It would be useful to have a function that detects which tileset is used in each level, but I can't really do anything about it now.
Reply With Quote
  #7  
Old 06-27-2013, 10:16 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by baseman101 View Post
It would be useful to have a function that detects which tileset is used in each level, but I can't really do anything about it now.
The problem is the use of addtiledef2() which means you can basically use several different tilesets in one level.
__________________
Reply With Quote
  #8  
Old 06-27-2013, 10:17 PM
Emera Emera is offline
Delterian Hybrid
Emera's Avatar
Join Date: Mar 2011
Location: Newcastle Upon-Tyne
Posts: 1,704
Emera is a jewel in the roughEmera is a jewel in the rough
Quote:
Originally Posted by Chompy View Post
I believe that function simply returns the type of the tile at the given x and y in a level, for example if the tile is blocking, non-blocking etc
Oh, so it does. My bad.
Reply With Quote
  #9  
Old 06-27-2013, 10:18 PM
baseman101 baseman101 is offline
Scripter
baseman101's Avatar
Join Date: Nov 2012
Location: Purcellville, VA
Posts: 76
baseman101 will become famous soon enough
Quote:
Originally Posted by Chompy View Post
The problem is the use of addtiledef2() which means you can basically use several different tilesets in one level.
Perhaps a function like this that would display an array instead? I have a spy script that uses tiles to detect where a player's level is and would like to change the tile definitions of the spy level to match the player's level.
Reply With Quote
  #10  
Old 06-27-2013, 10:51 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
You can do this by storing the tile defs in a client variable, not sure how its managed on izone.
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #11  
Old 06-27-2013, 11:35 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
gettileset() will return the tileset image currently loaded for the player. I thought there were also ways to get addtiledef2 but I can't find anything.

You may be able to load the tiledefs from the tiledefs/tiledefs<servername>.txt file.
Reply With Quote
  #12  
Old 07-15-2013, 01:33 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
Not sure if this is the right thread to ask this, but I have this:

PHP Code:
level.tilelayers[0].alpha 0.4
for a motion blur, but it doesn't seem to work on my gmap.

I have it running in a looping timeout, is that possibly why?
Reply With Quote
  #13  
Old 07-15-2013, 01:37 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by i8bit View Post
Not sure if this is the right thread to ask this, but I have this:

PHP Code:
level.tilelayers[0].alpha 0.4
for a motion blur, but it doesn't seem to work on my gmap.

I have it running in a looping timeout, is that possibly why?
Nope. It's because it needs to be gmap.tilelayers[0].alpha instead.

Also, you don't need it on a timeout unless you have some other script on that map that would try to change it. Changing it once is enough. The effect will stay active until you restore the alpha back to 1 or change maps.
Reply With Quote
  #14  
Old 07-15-2013, 06:39 PM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Quote:
Originally Posted by Draenin View Post
Changing it once is enough. The effect will stay active until you restore the alpha back to 1 or change maps.
Definitely. If you need it to be updating, you can always put it under onPlayerEnters() and detect whether or not the tile layers are the wanted alpha, and if not change them that way.
Reply With Quote
  #15  
Old 07-15-2013, 11:35 PM
i8bit i8bit is offline
Registered User
Join Date: Jul 2013
Posts: 146
i8bit is an unknown quantity at this point
I have:

PHP Code:
gmap.tilelayers[0].alpha 0.4
But it still doesn't work :/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:30 PM.


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