Raised This Month: $ Target: $400
 0% 

Attach particles in DODS?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-07-2010 , 17:58   Attach particles in DODS?
Reply With Quote #1

Does anyone have or know of any dods plugins that attach particles to players? I basically copied/pasted my function from tf2 for dods, and it most definitely does not attach it to the player. The particles play from some random map location it seems.

Why wouldnt this work for dods? Anyone have any experience with particles in DODS?


Code:
new iparticle = CreateEntityByName("info_particle_system");
    
    
    if (IsValidEdict(iparticle)){
        decl Float:pos[3];

        GetEntPropVector(entity, Prop_Send, "m_vecOrigin", pos);
        
        // Add position offsets
        pos[0] += xOffs;
        pos[1] += yOffs;
        pos[2] += zOffs;
        
       TeleportEntity(iparticle, pos, NULL_VECTOR, NULL_VECTOR);
        DispatchKeyValue(iparticle, "effect_name", type);

        if (attach != NO_ATTACH)
    {
            SetVariantString("!activator");
            AcceptEntityInput(iparticle, "SetParent", entity, iparticle, 0);
        
            if (attach == ATTACH_HEAD)
      {
                SetVariantString("head");
                AcceptEntityInput(iparticle, "SetParentAttachmentMaintainOffset", iparticle, iparticle, 0);
            }
        }
        
        DispatchKeyValue(iparticle, "targetname", "particle");

        DispatchSpawn(iparticle);
        ActivateEntity(iparticle);
        AcceptEntityInput(iparticle, "Start");

Last edited by retsam; 02-08-2010 at 20:09.
retsam is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-07-2010 , 19:06   Re: Attach particles in DODS?
Reply With Quote #2

Posting your code would be a good start.

Is the "info_particle_system" an entity in DODS? Are you trying to attach it to an attachment point that doesn't exist? Theres tons of things that could be wrong so speculating isn't very useful.
CrimsonGT is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-07-2010 , 19:38   Re: Attach particles in DODS?
Reply With Quote #3

Ya, I was just trying to find another dods plugin so I could just look for myself but anyways....posted in OP.

The above code works flawlessly in tf2. It outputs the particle in dods, but its not attaching it anywhere remotely close to the client.
retsam is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-08-2010 , 13:34   Re: Attach particles in DODS?
Reply With Quote #4

No ideas? No dods admins around have any particle plugins? heh.
retsam is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 02-08-2010 , 15:15   Re: Attach particles in DODS?
Reply With Quote #5

If you look for my Evil Rocket plugin, it uses particles for the smoke effect for DoDS.

It should work just the same, except they have different names. I have a list somewhere...


Also when attaching, unless you specifically want it to the head, I'd just teleport the particle into position and SetParent it.

When I get home tonight, I'll post some code.
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-08-2010 , 19:58   Re: Attach particles in DODS?
Reply With Quote #6

Hum alright. Thx for that idea. I actually use that in my RTD plugin, and I would have thought that is fairly identical code to what im trying. Ill do some comparisons though.
retsam is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 02-08-2010 , 20:19   Re: Attach particles in DODS?
Reply With Quote #7

This works for me:

Code:
AttachParticle(ent, String:particleType[])
{
    new particle = CreateEntityByName("info_particle_system");
    
    new String:tName[128];
    if (IsValidEdict(particle))
    {
        new Float:pos[3];
        GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos);
        pos[2] += 10;
        TeleportEntity(particle, pos, NULL_VECTOR, NULL_VECTOR);
        
        Format(tName, sizeof(tName), "target%i", ent);
        DispatchKeyValue(ent, "targetname", tName);
        
        DispatchKeyValue(particle, "targetname", "dodparticle");
        DispatchKeyValue(particle, "effect_name", particleType);
        DispatchSpawn(particle);
        SetVariantString(tName);
        AcceptEntityInput(particle, "SetParent", particle, particle, 0);
        ActivateEntity(particle);
        AcceptEntityInput(particle, "start");
        
        CreateTimer(1.0, DeleteParticle, particle);
    }
}
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-08-2010 , 20:58   Re: Attach particles in DODS?
Reply With Quote #8

I just tried your code from the evil rocket. The rockettrail smoke attaches to player fine, but the two particles im trying "mini_fireworks" and "mini_firework_flare" wont attach for anything.

I have now tried 3 different attach particle functions and neither will attach those two particles in dods.

EDIT: Yeah. Im not sure what is wrong here. I just confirmed it. Those two particles cannot be attached to the player. wtf? why? The other particles like rockettrail work fine..... My particle functions are fine, its just those specific particles......

Last edited by retsam; 02-08-2010 at 21:13.
retsam 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 14:01.


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