PDA

View Full Version : canbepushed(); doesnt work if theres a wall on each side??


scriptless
10-07-2014, 03:21 AM
Script help for '*push*':
TServerNPC.canbepushed()
TServerNPC.cannotbepushed()

Using this serverside and noticing that a "block.png" cannot be pushed thru a gap that is 2 tiles wide dispite the fact that it would fit.. Does anyone know if there is a solution for this?

function onCreated() {
canbepushed();
}

MysticalDragon
10-07-2014, 04:25 AM
There is a few good solutions. One being, you could always make those two cavern pillars images and use setshape2. Another one one be to script your own push and pull system, that graal one is kinda sucky.

Crow
10-07-2014, 04:57 AM
This bug has been around forever. There's a "pushpull" class in my Atlantis package (http://forums.graalonline.com/forums/showthread.php?t=134267580) you should check out.

Jakov_the_Jakovasaur
10-07-2014, 05:03 AM
is your block.png definitely 32 x 32 pixels?

the mainfile is 32 x 32, however i swear there has been at least one server with a 33 x 32 version of block.png that people have been downloading the entire time

Crow
10-07-2014, 05:17 AM
is your block.png definitely 32 x 32 pixels?

the mainfile is 32 x 32, however i swear there has been at least one server with a 33 x 32 version of block.png that people have been downloading the entire time

Oh, yea, good point. The block.png in the screenshot is definitely the 33*32 one. Both canbepushed() and canbepulled() are still somewhat bugged, though.

MysticalDragon
10-07-2014, 02:23 PM
This bug has been around forever. There's a "pushpull" class in my Atlantis package (http://forums.graalonline.com/forums/showthread.php?t=134267580) you should check out.
This is what Delteria uses, its pretty sweet.

scriptless
10-08-2014, 12:59 AM
This bug has been around forever. There's a "pushpull" class in my Atlantis package (http://forums.graalonline.com/forums/showthread.php?t=134267580) you should check out.

I saw the onActionPushed function but hadn't actually tested it out. Saw it again in your script and decided just for the heck of it to try it. Thats a pretty nifty class you got there. I see some stuff about hourglass and other stuff in there... what exactly was ment to be the limitations of this script if you don't mind me asking?

I guess I have enough to solve my problem. I just needed to be able to push this block 1 direction, until it hit the wall. and with that function alone I can pretty easily do that without any wall checks even.

Crow
10-08-2014, 03:44 AM
Only limitations were that the size of the object had to be 2x2 tiles. I was going to expand it to work with a dynamic object size, but never really got to it. The hourglass was for, well, the hourglass on Atlantis, which we used to reset puzzle objects and the player location in dungeons. Kinda like Lufia 2 does it.

scriptless
10-09-2014, 01:31 AM
Ahh makes sense. Well its definitely a nice script. Appreciate you sharing it. I am asumming to make it dynamic size you would open the image and get the width/height from it and round up it to the nearest 16 pixels?

Crow
10-09-2014, 04:55 AM
Ahh makes sense. Well its definitely a nice script. Appreciate you sharing it. I am asumming to make it dynamic size you would open the image and get the width/height from it and round up it to the nearest 16 pixels?

I'd probably just set the size in the object where I'm joining the class. But yes, this the code is tile based, it would have to be rounded.