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 02-14-2011, 02:52 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
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?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 02-14-2011, 04:01 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Did you try using setshape2( W, H, ARRAY);
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #3  
Old 02-14-2011, 04:38 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by MrOmega View Post
Did you try using setshape2( W, H, ARRAY);
No luck. tried a 2x2 area, a 1x1 area, and a 4x4 area. All 3 had the exact same shape.
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #4  
Old 02-14-2011, 06:12 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
can you show the part of the script with setshape?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #5  
Old 02-14-2011, 02:30 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
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.
Reply With Quote
  #6  
Old 02-14-2011, 05:15 PM
Toxen Toxen is offline
A Toxic Fellow
Join Date: Jan 2008
Location: Georgia
Posts: 36
Toxen is on a distinguished road
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.
__________________
UN NAT.
Reply With Quote
  #7  
Old 02-14-2011, 05:33 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
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.
Reply With Quote
  #8  
Old 02-14-2011, 05:45 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Crow View Post
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.
Can they? O.o
Reply With Quote
  #9  
Old 02-14-2011, 05:57 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 DustyPorViva View Post
Can they? O.o
Yup, I'd say they can. Same thing happened to me, basically. Using different shapes will change the actual shape, but in a strange way that still seems inaccurate. I have no idea why.
Reply With Quote
  #10  
Old 02-14-2011, 06:17 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Crow View Post
Yup, I'd say they can. Same thing happened to me, basically. Using different shapes will change the actual shape, but in a strange way that still seems inaccurate. I have no idea why.
Dunno what you're talking about... I've never had a problem using showcharacter + setshape. It sets the shape of the NPC using the blocking specifications of a player(x+.5,y+1). That's where the blocking starts, instead of the normal 0,0. This allows you to easily create blocking NPC's that also draw a portion of the player(like a tree) simply by aligning it correctly in the gani. This is the same method that 2k2 uses on most of their trees and houses.
Reply With Quote
  #11  
Old 02-15-2011, 01:24 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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
Reply With Quote
  #12  
Old 02-15-2011, 01:29 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by DustyPorViva View Post
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
No typo there. Sorta. I was just testing it right now to make sure the shape is actually being set. It's normally 16. Looks like I forgot to revert it in the post. You see, a lot of the time when I post something like this on the forums, I'm in the middle of messing with various portions of the code. I usually have to clean it all up before I post them. Coulda sworn I fixed that part in the post though. Guess not lol

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.
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 02-15-2011 at 01:42 AM..
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 03:34 AM.


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