AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Decal Tempent Not Drawing Properly (https://forums.alliedmods.net/showthread.php?t=89127)

CrimsonGT 04-02-2009 15:51

Decal Tempent Not Drawing Properly
 
Alright so I took some of this code for drawing the decals from Berni's Map Decals plugin. As far as I can tell everything is fine. The problem is when the Decal's are drawn, they are not actually on the wall, they are just kind of floating in front of it. So when I look at them from the side they look odd. If anyone has any thoughts I would appreciate it.

Code:

public Action:CTFBaseRocket_Explode(edict)
{
    if(StrEqual(RocketWeaponName[edict], "tf_weapon_syringegun_medic", false))
    {
        //Find the point where it collides with the wall
        new Float:flPos[3];
        GetRocketCollisionPoint(edict, flPos);

        //Draw the Plasma Sprite
        TE_SetupGlowSprite(flPos, DecalIndex, 1.0, 1.0, 200);
        TE_SendToAll();

        //Remove the Rocket
        RemoveEdict(edict);

        //Block the Original Function
        return Plugin_Handled;
    }

    return Plugin_Continue;
}

stock GetRocketCollisionPoint(edict, Float:pos[3])
{
    decl Float:vOrigin[3], Float:vAngles[3];

    GetEntPropVector(edict, Prop_Data, "m_vecAbsOrigin", vOrigin);
    GetEntPropVector(edict, Prop_Data, "m_angAbsRotation", vAngles);

    new Handle:trace = TR_TraceRayFilterEx(vOrigin, vAngles, MASK_SOLID_BRUSHONLY, RayType_Infinite, TraceEntityFilterPlayer);

    if(TR_DidHit(trace))
    {
        TR_GetEndPosition(pos, trace);
       
        new entity = TR_GetEntityIndex(trace);
       
        CloseHandle(trace);
        return entity;
    }
   
    CloseHandle(trace);
    return -1;
}

public bool:TraceEntityFilterPlayer(entity, contentsMask)
{
    return entity > MAXPLAYERS;
}


CrimsonGT 04-09-2009 11:00

Re: Decal Tempent Not Drawing Properly
 
Since no one seems to have a clue I figured I would make a quick video showing the problem and maybe someone has an idea as to what I can do to fix it. I am starting to think it might by the precaching itself. I am using PrecacheModel() as thats what all of the decal plugins I could find use.

When I use PrecacheDecal() it ALWAYS creates a scout arm holding a scattergun. Im under the impression PrecacheDecal just doesnt work well in TF2. I have also tried PrecacheGeneric which makes the decal just not work at all so.... Heres the video.

http://www.youtube.com/watch?v=Xed_ojickzM

*Edit*

Also, I made a completely new plugin just to make sure I didnt screw up something small somewhere in my other one.

PHP Code:

#define DECAL_PATH "materials/decals/concrete/SHOT1_paint.vmt"

new DecalIndex;

public 
OnMapStart()
{
    
DecalIndex PrecacheModel(DECAL_PATHtrue);
}

public 
Action:OnWeaponFired(clientweaponString:weaponname[])
{
    new 
Float:pos[3];
    
GetCollisionPoint(clientpos);

    if(
IsDecalPrecached(DECAL_PATH))
        
PrintToChatAll("Its Precached");

    
TE_SetupGlowSprite(pos,DecalIndex,10.0,0.2,200);
    
TE_SendToAll();
}

stock GetCollisionPoint(clientFloat:pos[3])
{
    
decl Float:vOrigin[3], Float:vAngles[3];

    
GetClientEyePosition(clientvOrigin);
    
GetClientEyeAngles(clientvAngles);

    new 
Handle:trace TR_TraceRayFilterEx(vOriginvAnglesMASK_SOLIDRayType_InfiniteTraceEntityFilterPlayer);

    if(
TR_DidHit(trace))
    {
        
TR_GetEndPosition(postrace);
        
CloseHandle(trace);

        return;
    }
    
    
CloseHandle(trace);
}

public 
bool:TraceEntityFilterPlayer(entitycontentsMask)
{
     return 
entity MaxClients;



andi67 11-12-2009 15:21

Re: Decal Tempent Not Drawing Properly
 
Ever fixed that???


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

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