Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Tiles blocking (https://forums.graalonline.com/forums/showthread.php?t=134259602)

sssssssssss 06-24-2010 06:45 PM

Tiles blocking
 
I have an array of tiles x,y and want them to block and not block in code. Is there something as simple as array.block()? Ive tried .block, .blocklocal, and .blockagain, but none worked.

WhiteDragon 06-24-2010 07:02 PM

I don't think there is anything like that possible with default.

xAndrewx 06-24-2010 07:21 PM

Nope... :{

Just move the tile to a blocking tile inside the pics1.png and re-name your image (not re-name to pics1.png...) sorry

WhiteDragon 06-24-2010 07:39 PM

Quote:

Originally Posted by sssssssssss (Post 1583832)
I have an array of tiles x,y and want them to block and not block in code. Is there something as simple as array.block()? Ive tried .block, .blocklocal, and .blockagain, but none worked.

However, if you want to block an specific area and not specific tiles, you can putnpc2 and do a setshape2 on it, which allows you to specify any shape you want to block (doesn't need to be just a rectangle).

sssssssssss 06-24-2010 09:09 PM

Quote:

Originally Posted by WhiteDragon (Post 1583835)
However, if you want to block an specific area and not specific tiles, you can putnpc2 and do a setshape2 on it, which allows you to specify any shape you want to block (doesn't need to be just a rectangle).

That might work better, although I would imagine if its for cliffing, it would lag if its a lot of areas all over the gmap? If it wont then thats my best bet.

xAndrewx 06-24-2010 09:24 PM

not really lag... lol are you doing it for cliffs and cave enterence?

sssssssssss 06-24-2010 09:26 PM

ran out of room on the tileset, so some cliffing that is by the water doesnt block, and it shouldnt per the tileset, but we can't move it, and we need it to block.

xAndrewx 06-24-2010 09:29 PM

hmmm
just do in a script

HTML Code:

function onCreated() {
  this.b_area = {2, 2}; //32x32 px
  this.join("block_area");
}

in the class
HTML Code:

function onCreated() {
  this.setShape(1,16 * this.b_area[0], 16 * this.b_area[1]);

  save[1] = this.b_area[0];
  save[2] = this.b_area[1];
}
//#CLIENTSIDE
function onCreated() {
  this.setShape(1, 16 * save[1], 16 * save[2]);
}

Shouldn't cause any lagg

sssssssssss 06-24-2010 09:33 PM

Thanks. ^^

napo_p2p 06-25-2010 12:17 AM

If it's just for looks, you can get the same effect using tile layers.

Deas_Voice 06-25-2010 04:02 AM

Quote:

Originally Posted by napo_p2p (Post 1583900)
If it's just for looks, you can get the same effect using tile layers.

tell us more :D

WhiteDragon 06-25-2010 04:04 AM

Quote:

Originally Posted by Deas_Voice (Post 1583965)
tell us more :D

I think it'd just be a matter of laying down some block tiles, then on top of that laying whatever tiles you'd want to show.

I think tile layers are also manipulable by script as well if that approach is desired.

Crow 06-25-2010 11:57 AM

You can also counter this problem differently. If you have a wide range of tiles (you said you ran out of blocking tiles, so I guess you do) you could just lay the needed tiles over some already existing blocking tiles using addtiledef2(). For example, if you have some special mountain tiles, but there are no mountains near those watery cliffs, just use addtiledef2() in the levels where those watery cliffs are.

xAndrewx 06-25-2010 07:33 PM

oo good idea @ Crow

Crow 06-25-2010 08:07 PM

Quote:

Originally Posted by xAndrewx (Post 1584051)
oo good idea @ Crow

Out-of-the-box thinking :p


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

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