Raised This Month: $12 Target: $400
 3% 

SetParentAttachment causing issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-20-2010 , 11:01   SetParentAttachment causing issues
Reply With Quote #1

I am parenting a prop_dynamic_override to a player which works fine, but when I use SetParentAttachment, it causes some weird issues in CSS such as crouching and jumping make the player shaky. Has anyone else experienced this and found a solution?

Those issues are not present when SetParentAttachment is not used.
CrimsonGT is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 01-20-2010 , 11:51   Re: SetParentAttachment causing issues
Reply With Quote #2

It sounds like the models are colliding with each other. I know prop hunt has a similar issue when crouching or in a corner, you could try changing the collisions
__________________
toazron1 is offline
Send a message via AIM to toazron1
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-20-2010 , 11:59   Re: SetParentAttachment causing issues
Reply With Quote #3

I was having a problem initially with the player not being able to move. Once I disabled collisions through AcceptEntityInput(ent, "DisableCollision"); it worked fine and they could move, so I wouldn't think it would be a collision problem. At the same time I guess it could really be anything. Hoping someone else has had this problem before as im too sleepy to start turning off props one by one.
CrimsonGT is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 01-20-2010 , 12:11   Re: SetParentAttachment causing issues
Reply With Quote #4

toazron1 is right the models are colliding with each other, i had the same problems years ago when i was coding a ctf mod in es, i changed the collision group of the flag when it was parented and put it back to default when it was dropped or at base.
blodia is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 01-20-2010 , 15:33   Re: SetParentAttachment causing issues
Reply With Quote #5

Hook the CBaseEntity::ShouldCollide function and deal with it there (assuming you're not going for just a plugin-only thing).
bl4nk is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-20-2010 , 15:45   Re: SetParentAttachment causing issues
Reply With Quote #6

Quote:
Originally Posted by bl4nk View Post
Hook the CBaseEntity::ShouldCollide function and deal with it there (assuming you're not going for just a plugin-only thing).
Well I WAS...

Im using SDKHooks to make my life easier, but I guess I could hack it up and throw in a hook.
CrimsonGT is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-20-2010 , 18:18   Re: SetParentAttachment causing issues
Reply With Quote #7

Thanks for the help, I decided to print out all of the netprops as it had to be one of them. It was the m_nSolidType causing the issues. So for anyone experiencing this issue...

AcceptEntityInput(ent, "DisableCollision");

in conjunction with...

SetEntProp(ent, Prop_Send, "m_nSolidType", 0);

is what is required to prevent that shaky crap.
CrimsonGT is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-21-2010 , 09:30   Re: SetParentAttachment causing issues
Reply With Quote #8

Quote:
Originally Posted by bl4nk View Post
Hook the CBaseEntity::ShouldCollide function and deal with it there (assuming you're not going for just a plugin-only thing).
Seems I cant make it not solid AND react to Touch() hook since it is using a bounding box. Although if anyone knows of a way to do so please let me know. I know it works for models with a collision mesh, but this one doesn't so bounding box is my only option.

Gonna probably just give in after class and add ShouldCollide to SDKHooks.
CrimsonGT is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 01-21-2010 , 11:39   Re: SetParentAttachment causing issues
Reply With Quote #9

if you don't mind me asking are you trying to code a ctf mod? i remember in a another thread you mentioning flag models. if so you can use env_beam as a tripwire (found out by mattie of es) instead of trying to use ontouch. also for my own ctf mod i used a physics prop instead of dynamic so when a player died the flag would fall to the ground.
blodia is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-21-2010 , 12:40   Re: SetParentAttachment causing issues
Reply With Quote #10

Yeah I am, its a job I am doing for someone. I wish I could use a physics prop, but it won't work since this model has no collision mesh. (Its the same one from the ES version) The tripwire isn't a bad idea, but I think it would be easier to just make a ShouldCollide hook, after all maybe someone else will need it in the future.

This is the last time I ever do a game mode mod in sourcepawn, I absolutely hate trying to manage one without OOP, gets me flustered and annoyed lol.
CrimsonGT is offline
Reply


Thread Tools
Display Modes

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 -4. The time now is 18:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode