Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Advanced Custom Tileset (https://forums.graalonline.com/forums/showthread.php?t=134261452)

MattKan 12-30-2010 07:43 AM

Advanced Custom Tileset
 
Is there anyway you can rescript the tileset system so that their tiles work different? For example, changing which tiles are blocking, etc. Also, it would be nice to possibly script your own tiles- what I mean is someone could use a script to make those tiles drawoverplayer or something like that.

cbk1994 12-30-2010 07:47 AM

It's possible but would almost certainly require a custom movement system. You could do it with setshape2 and NPCs but I wouldn't recommend it.

edit to expand:
Using custom movement, the best way I can think of to do it is to make a list of tiles of each type and use a custom tile type function.

PHP Code:

//#CLIENTSIDE
enum TILE {
  
FLOOR,
  
WALL,
  
CHAIR,
  
BED
}

function 
getTileType(dx, dy) {
  
temp.tile = player.level.tiles[dx, dy];
  
  switch (
tile) {
    case 
100:
    case 
101:
    case 
102:
    case 
103: // etc
      
return TYPE.CHAIR
    
break; // not really needed because of the return but I think it improves readability
    
    
case 200:
    case 
201:
      return 
TYPE.BED;
    break;
    
    case 
300:
    case 
301:
    case 
400:
    case 
401:
      return 
TYPE.WALL;
    break;
    
    
// any which haven't been defined above
    
default:
      return 
TYPE.FLOOR;
    break;
  }
} 

You could alternatively use if-statements or arrays instead of a switch. Dusty also did something with color mapping.

DustyPorViva 12-30-2010 07:55 AM

I've experimented with creating custom definitions. However, without a serverside way of colorpicking from images you have to do it clientside, so it ends up being inefficient(having to scan each login) and insecure(since it's clientside hackers could change the values to walk on walls).

If you're interested: http://forums.graalonline.com/forums...hp?t=134257595

iFuzzy 12-30-2010 08:22 PM

Just to give an addition to Mattkan's question:

Well actually, it's because we wanted to get rid of all the silly lava tiles that we wouldn't need to Level Design with. What me and Mattkan did was change the tileset by replace the lava bubble or something with a custom tile. So now if I go in that custom tile (which is supposed to be a rug), we just start swimming in it.

RegretZ 12-30-2010 08:23 PM

Use images, place whatever type of tile it should be (blocking, water, etc) underneath.
:P

Deas_Voice 12-30-2010 09:46 PM

Quote:

Originally Posted by iFuzzy (Post 1618937)
Just to give an addition to Mattkan's question:

Well actually, it's because we wanted to get rid of all the silly lava tiles that we wouldn't need to Level Design with. What me and Mattkan did was change the tileset by replace the lava bubble or something with a custom tile. So now if I go in that custom tile (which is supposed to be a rug), we just start swimming in it.

Quote:

Originally Posted by cbk1994 (Post 1618870)
It's possible but would almost certainly require a custom movement system. You could do it with setshape2 and NPCs but I

asd

fowlplay4 12-30-2010 09:52 PM

Quote:

Originally Posted by iFuzzy (Post 1618937)
Just to give an addition to Mattkan's question:

Well actually, it's because we wanted to get rid of all the silly lava tiles that we wouldn't need to Level Design with. What me and Mattkan did was change the tileset by replace the lava bubble or something with a custom tile. So now if I go in that custom tile (which is supposed to be a rug), we just start swimming in it.

That's hardly a reason to implement a new "tileset" system. Just use addtiledef2 to replace unused tiles in certain levels where you need them.

There's a small (but dated) tutorial here: http://forums.graalonline.com/forums...threadid=47038

cbk1994 12-30-2010 10:18 PM

Quote:

Originally Posted by RegretZ (Post 1618939)
Use images, place whatever type of tile it should be (blocking, water, etc) underneath.
:P

Using lots of NPCs in this way is usually very bad idea. Not only is there a set limit of NPCs per level, but it will also slow down the client (and serverside scripts looping through NPCs), especially on GMAPs.

RegretZ 12-30-2010 10:20 PM

Quote:

Originally Posted by cbk1994 (Post 1618965)
Using lots of NPCs in this way is usually very bad idea. Not only is there a set limit of NPCs per level, but it will also slow down the client (and serverside scripts looping through NPCs), especially on GMAPs.

Yeah, but it's the lazy man's way out. :asleep:

xAndrewx 12-30-2010 10:31 PM

What tiles are you wanting more of? Any in particular? (Seats, beds etc)
Gonstruct is quite a nifty tool - try this
http://forums.graalonline.com/forums...hp?t=134258190

Cool thread:
http://forums.graalonline.com/forums...ight=Gonstruct

Image:
http://forums.graalonline.com/forums...7&d=1253304963


All times are GMT +2. The time now is 05:55 AM.

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