Raised This Month: $ Target: $400
 0% 

prop_dynamic_override collisions?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-17-2010 , 13:04   prop_dynamic_override collisions?
Reply With Quote #1

Feel silly asking this because I have run into this problem before a long time ago and managed to fix it. However, I have already wasted 2 hours on it, so I hope someone has an idea.

I am spawning flags, but they are not accepting collisions. I am hooking them with Touch, but its not being called since collisions arent working. I have checked out some old threads on here and found...

http://forums.alliedmods.net/showthr...t=prop_dynamic

but still not having much luck. Also, the model is precached on the server as well.

Code:
CreateFlag(const String:model[], const String:targetName[], Float:pos[3])
{
    new flag = CreateEntityByName("prop_dynamic_override");

    if(IsValidEdict(flag))
    {
        //DispatchKeyValue(flag, "model", model);
        SetEntityModel(flag, model);
        DispatchKeyValue(flag, "DefaultAnim", "flag_idle1");
        DispatchKeyValue(flag, "targetname", targetName);
        DispatchKeyValue(flag, "StartDisabled", "false");
        DispatchKeyValue(flag, "Solid", "6");

        SetEntProp(flag, Prop_Data, "m_CollisionGroup", 5);
        SetEntProp(flag, Prop_Data, "m_usSolidFlags", 16);
        SetEntProp(flag, Prop_Data, "m_nSolidType", 6);

        DispatchSpawn(flag);

        AcceptEntityInput(flag, "Enable");
        AcceptEntityInput(flag, "TurnOn");
        AcceptEntityInput(flag, "DisableMotion");

        TeleportEntity(flag, pos, NULL_VECTOR, NULL_VECTOR);
    }

    return flag;
}
CrimsonGT is offline
meng
Veteran Member
Join Date: Oct 2005
Location: us
Old 01-17-2010 , 15:07   Re: prop_dynamic_override collisions?
Reply With Quote #2

hmm. the last i remember spawning a prop_dynamic, it would collide with players by default. try spawning it without setting a collision group. there is also an input "EnableCollision" i believe. you could try that too.
__________________
.
[ 1 Dumerils Boa | 1 Cali King ]...
.
I'm a lil' spirituous.
meng is offline
Send a message via Yahoo to meng
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 01-17-2010 , 16:39   Re: prop_dynamic_override collisions?
Reply With Quote #3

Does the model have a physics box? I made a similar plugin a while back and found out that only models with an actual physbox would collide with players; otherwise they would just run right through it and not fire the Touch output.
bl4nk is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 01-17-2010 , 18:19   Re: prop_dynamic_override collisions?
Reply With Quote #4

Thats a good point, it indeed does not have a physics box. I guess I will try making a map with it first and using bounding box to see if that works. Thanks
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 05:28.


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