AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   prop_dynamic_override collisions? (https://forums.alliedmods.net/showthread.php?t=115869)

CrimsonGT 01-17-2010 13:04

prop_dynamic_override collisions?
 
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;
}


meng 01-17-2010 15:07

Re: prop_dynamic_override collisions?
 
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.

bl4nk 01-17-2010 16:39

Re: prop_dynamic_override collisions?
 
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.

CrimsonGT 01-17-2010 18:19

Re: prop_dynamic_override collisions?
 
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


All times are GMT -4. The time now is 05:28.

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