Raised This Month: $ Target: $400
 0% 

Decal Tempent Not Drawing Properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 04-02-2009 , 15:51   Decal Tempent Not Drawing Properly
Reply With Quote #1

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;
}
__________________

Last edited by CrimsonGT; 04-02-2009 at 18:17.
CrimsonGT is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 04-09-2009 , 11:00   Re: Decal Tempent Not Drawing Properly
Reply With Quote #2

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;

__________________
CrimsonGT is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 11-12-2009 , 15:21   Re: Decal Tempent Not Drawing Properly
Reply With Quote #3

Ever fixed that???
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
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 -4. The time now is 10:01.


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