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 06-24-2010, 06:45 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
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.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 06-24-2010, 07:02 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
I don't think there is anything like that possible with default.
Reply With Quote
  #3  
Old 06-24-2010, 07:21 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
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
__________________
Reply With Quote
  #4  
Old 06-24-2010, 07:39 PM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by sssssssssss View Post
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).
Reply With Quote
  #5  
Old 06-24-2010, 09:09 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by WhiteDragon View Post
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.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #6  
Old 06-24-2010, 09:24 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
not really lag... lol are you doing it for cliffs and cave enterence?
__________________
Reply With Quote
  #7  
Old 06-24-2010, 09:26 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
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.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #8  
Old 06-24-2010, 09:29 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
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
__________________
Reply With Quote
  #9  
Old 06-24-2010, 09:33 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Thanks.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #10  
Old 06-25-2010, 12:17 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
If it's just for looks, you can get the same effect using tile layers.
Reply With Quote
  #11  
Old 06-25-2010, 04:02 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by napo_p2p View Post
If it's just for looks, you can get the same effect using tile layers.
tell us more
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #12  
Old 06-25-2010, 04:04 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by Deas_Voice View Post
tell us more
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.
Reply With Quote
  #13  
Old 06-25-2010, 11:57 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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.
Reply With Quote
  #14  
Old 06-25-2010, 07:33 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
oo good idea @ Crow
__________________
Reply With Quote
  #15  
Old 06-25-2010, 08:07 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xAndrewx View Post
oo good idea @ Crow
Out-of-the-box thinking
Reply With Quote
  #16  
Old 06-25-2010, 11:56 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Could you give an example of using addtiledef2() to do that por favor?

And...

Quote:
Originally Posted by napo_p2p View Post
If it's just for looks, you can get the same effect using tile layers.
Yes, please explain.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #17  
Old 06-26-2010, 11:21 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
addtiledef2() works like addtiledef(), but instead you use small image chunks and also pass the coordinates (where you want to place the chunks) as arguments, in pixels. Example:
PHP Code:
addtiledef2("block.png""level_"512320); 
Will add block.png to the currently active tileset, overwriting the four tiles at 512, 320 (blocking tiles in the type 1 tileset). Paint will do the trick if you need to find the pixel coordinates for this stuff. Just leave your mouse over the desired topleft-most pixel of the tile and use the coordinates in Paint's status bar.
Reply With Quote
  #18  
Old 06-27-2010, 09:34 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by sssssssssss View Post
Yes, please explain.
WhiteDragon summed up what you would need to do with tile layers. Checkout gonstruct for a graal level editor that supports tile layers.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #19  
Old 06-28-2010, 05:03 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
What is the most efficient way, tile layers or addtiledef2? I dont want to create any more lag than there already is. If theyre both the same, I suppose they'd take about the same amount of time to find all the levels, rather just using gonstruct to edit all the levels.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #20  
Old 06-28-2010, 05:11 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
I've tried using Gonstruct personally and found it to be buggy on my machine, while the original was just fine. So I'd opt for addtiledef2 if you just want something simple, it's a nice way to add tiles for special cases/zones.

Efficiency really doesn't matter here since the differences won't be noticeable.
__________________
Quote:
Reply With Quote
  #21  
Old 06-29-2010, 02:09 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
addtiledef2 is the easiest way to do it, i've never understood how to get the layers working on graal, because every time i try, i end up viewing only one layer
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #22  
Old 06-30-2010, 08:34 PM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Just figured out layers = easy with gonstruct. Since we're redoing the entire over world and tileset, we're just going to use layers.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #23  
Old 07-01-2010, 01:16 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by sssssssssss View Post
Just figured out layers = easy with gonstruct. Since we're redoing the entire over world and tileset, we're just going to use layers.
lol?
i never got layers to work properly
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #24  
Old 07-01-2010, 01:32 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Quote:
Originally Posted by Deas_Voice View Post
lol?
i never got layers to work properly
We just put everything on layer 0. If you want something to block, put a block tile on layer 0, then on layer 1 overlay it with the tile you want to show.

Wont work in testing offline in regular graal editor either. I still cant get gonstruct to execute the level to test in itself. I just upload it and test unfortunately. -_O
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #25  
Old 07-01-2010, 03:34 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
I totally forgot about save[] o.O thanks! Also, yeah blocking with setshape2 is fun.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #26  
Old 07-01-2010, 09:22 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by sssssssssss View Post
We just put everything on layer 0. If you want something to block, put a block tile on layer 0, then on layer 1 overlay it with the tile you want to show.
meh, i gotta do something very wrong then cus thats what im doing. ohwell (dont want to hijack the thread).

Quote:
Originally Posted by sssssssssss View Post
Wont work in testing offline in regular graal editor either. I still cant get gonstruct to execute the level to test in itself. I just upload it and test unfortunately. -_O
yeah, i upload them too.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #27  
Old 07-01-2010, 09:24 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by adam View Post
I totally forgot about save[] o.O thanks! Also, yeah blocking with setshape2 is fun.
yeah me too, between does those sync between client- and serverside?
would save me alot when it comes to levelnpcs.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #28  
Old 07-01-2010, 09:41 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
can't you only store integer values using save[]? I've never used it, but I think that's because when I tried there was some kind of limitation
__________________
Reply With Quote
  #29  
Old 07-01-2010, 09:48 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
Quote:
Originally Posted by salesman View Post
can't you only store integer values using save[]? I've never used it, but I think that's because when I tried there was some kind of limitation
Just not arrays :[
__________________
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 05:27 PM.


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