AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How they make attached particles? (https://forums.alliedmods.net/showthread.php?t=281901)

iGANGNAM 04-23-2016 18:33

How they make attached particles?
 
Hello. I was wondering how they make attached particles to the player? https://developer.valvesoftware.com/...S_GO_Particles

https://www.youtube.com/watch?v=NzSOtWtZ7Ew

ESK0 04-23-2016 20:53

Re: How they make attached particles?
 
It's a secret which cannot be revealed.. Or use search button to find some particles :)

thecount 04-24-2016 01:02

Re: How they make attached particles?
 
Create the particle entity, set the keyvalues, spawn it, and set the player as the parent.

Phil25 04-24-2016 03:13

Re: How they make attached particles?
 
I could only assume that these particles are custom so I doubt you'd find them in the particle list. If you want to get a full particle list, start a game with "-tools" parameter in its launch options. I think that it's a bit for complicated for CS:GO, because additionally to that parameter you'll also have to type "toolload pet" in the console. I've never done it for CS:GO so I don't know the full process.

I'm pretty sure you'd need to export all particle .pcf's from the .vpk files.

iGANGNAM 04-24-2016 03:48

Re: How they make attached particles?
 
Quote:

Originally Posted by Phil25 (Post 2413701)
I could only assume that these particles are custom so I doubt you'd find them in the particle list. If you want to get a full particle list, start a game with "-tools" parameter in its launch options. I think that it's a bit for complicated for CS:GO, because additionally to that parameter you'll also have to type "toolload pet" in the console. I've never done it for CS:GO so I don't know the full process.

I'm pretty sure you'd need to export all particle .pcf's from the .vpk files.

I have few custom .pcf files, but don't even imagine how to use them. I had tried to launch game like you said but after I open .pcf file it doesn't even react

Quote:

Originally Posted by thecount (Post 2413673)
Create the particle entity, set the keyvalues, spawn it, and set the player as the parent.

which entity name is it?

Phil25 04-24-2016 05:36

Re: How they make attached particles?
 
Quote:

Originally Posted by iGANGNAM (Post 2413711)
which entity name is it?

info_particle_system

iGANGNAM 05-01-2016 03:44

Re: How they make attached particles?
 
Found a snippet in https://devsapps.com:8929/sourcemod/...der_effects.sp
Code:

stock int AttachParticle(int client, char[] particleType)
{
        int particle = CreateEntityByName("info_particle_system");
       
        if(IsValidEntity(particle))
        {
                SetEntPropEnt(particle, Prop_Data, "m_hOwnerEntity", client);
                DispatchKeyValue(particle, "effect_name", particleType);
                SetVariantString("!activator");
                AcceptEntityInput(particle, "SetParent", client, particle, 0);
                SetVariantString("forward");
                AcceptEntityInput(particle, "SetParentAttachment", particle , particle, 0);
                DispatchSpawn(particle);
               
                AcceptEntityInput(particle, "start");
                ActivateEntity(particle);
               
                float pos[3];
                GetEntPropVector(particle, Prop_Send, "m_vecOrigin", pos);
               
                pos[2] += 12.0;
                float vec_start[3];
                AddInFrontOf(pos, NULL_VECTOR, 12.0, vec_start);
                TeleportEntity(particle, vec_start, NULL_VECTOR, NULL_VECTOR);
               
                return EntIndexToEntRef(particle);
        }
        return -1;
}

/***********************************************************/
/******************** IS VALID ENTITY **********************/
/***********************************************************/
stock bool IsValidEntRef(int entity)
{
        if( entity && EntRefToEntIndex(entity) != INVALID_ENT_REFERENCE )
                return true;
        return false;
}

/***********************************************************/
/********************* REMOVE ENTITY ***********************/
/***********************************************************/
void RemoveEntity(int ref)
{

        int entity = EntRefToEntIndex(ref);
        if (entity != -1)
        {
                AcceptEntityInput(entity, "Kill");
                ref = INVALID_ENT_REFERENCE;
        }
               
}

/***********************************************************/
/*************** PRECACHE PARTICLE EFFECT ******************/
/***********************************************************/
stock void PrecacheParticleEffect(const char[] sEffectName)
{
        static int table = INVALID_STRING_TABLE;
       
        if (table == INVALID_STRING_TABLE)
        {
                table = FindStringTable("ParticleEffectNames");
        }
       
        bool save = LockStringTables(false);
        AddToStringTable(table, sEffectName);
        LockStringTables(save);
}

stock void AddInFrontOf(float vecOrigin[3], float vecAngle[3], float units, float output[3])
{
        float vecAngVectors[3];
        vecAngVectors = vecAngle; //Don't change input
        GetAngleVectors(vecAngVectors, vecAngVectors, NULL_VECTOR, NULL_VECTOR);
 
        for (int i; i < 3; i++)
        {
                output[i] = vecOrigin[i] + (vecAngVectors[i] * units);
        }
}



All times are GMT -4. The time now is 21:55.

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