![]() |
Trouble setting the shape of gralats.
I altered the gralat class a while back. But I noticed that it's "touch box" extends a few tiles to the left compared to the right. I've tried fixing this with setshape, but it doesn't seem to alter anything. It is still using a gani, and i used the old gralats.gani text file as a template if that matters.
It's kind of annoying really, especially if you drop a gralat to the right of you because then you have to actually "dodge" it's shape or else you'll end up picking it back up. Any idea what might be causing this? |
Did you try using setshape2( W, H, ARRAY);
|
Quote:
|
can you show the part of the script with setshape?
|
Is it using showcharacter();?
This will force a 32 x 32 pixel shape with the x and y of the shape being offset by 0.5 and 1 tiles. |
Try,
setshape(1,16,32); 1 - is the shape and I believe their is still only a rectangle you can use so it's 1. 16 - is the width, 1 tile wide 32 - is the height so 2 tiles high. Should work for the shape of a gralat. |
Ganis + shapes can cause some trouble and confusion. If you don't care about bling, convert this to images instead of ganis. You'll then be happy.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
showcharacter() and all of that other stuff didn't fix it. The only solution that appears to have worked is Crow's suggestion to show it as an image. For some reason, I guess the ganis refuse to have their shapes altered. Although there doesn't seem to be any good reason on why they should act that way.
|
Quote:
|
Make sure you position the sprite correctly in the gani. If it's not on the 0,0 spot, then you'll have the problem you're describing.
|
Quote:
PHP Code:
Quote:
edit: nevermind! |
Also:
function onCreated(){ setshape(1,2,32); this.canplay = 1; play("item.wav"); setTimer(15); } You're setting the shape to 2 pixels. Typo? :P |
Quote:
edit: OH right. That was the clientside portion. I remember catching that in my script but neglected to edit my post. That's a different problem I was having where I was picking up the rupee and it was destroying, but no sound was being played about half the time. The canplay stuff was left over when I had it hide and sleep on the serverside after being touched before destroying itself in attempts to give it plenty of time to play the sound in case it was lag. That prevented the sound from playing again when you ran over the spot with the invisible rupee. Didn't fix it though, so I took the serverside portion of the script out. I left the clientside stuff there since I have a jump script that I'm experimenting with. It would play the sound if you jumped over it but didn't actually grab the rupee. On second thought though, I can just put that Z detection there too. Of course, this is all still unrelated to the hitbox problem. |
| All times are GMT +2. The time now is 08:09 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.