I would like to repreduce the effect when a medic heal a player. When the medic use is medigun, between the weapon and the player, there is a red/blue (depend of the team) "link", particles going from the weapon output to the player body. Is there anyway to recreate this ? I actually never tried to attach particle between two players, I don't even know if it's possible.
It is, look at stuff like repair node.
It is, look at stuff like repair node.
Thanks, I will give a shot and see what I can do with that.
EDIT:
wait, this won't work ! I need something to link particles to two player, not a entity <->player
players are an entity.
stock SetParent(iParent, iChild, const String:szAttachment[] = "", Float:vOffsets[3] = {0.0,0.0,0.0})
{
SetVariantString("!activator");
AcceptEntityInput(iChild, "SetParent", iParent, iChild);
if (szAttachment[0] != '\0') // Use at least a 0.01 second delay between SetParent and SetParentAttachment inputs.
{
SetVariantString(szAttachment); // "head"
if (!AreVectorsEqual(vOffsets, Float:{0.0,0.0,0.0})) // NULL_VECTOR
{
decl Float:vPos[3];
GetEntPropVector(iParent, Prop_Send, "m_vecOrigin", vPos);
AddVectors(vPos, vOffsets, vPos);
TeleportEntity(iChild, vPos, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(iChild, "SetParentAttachmentMaintainOffset", iParent, iChild);
}
else
{
AcceptEntityInput(iChild, "SetParentAttachment", iParent, iChild);
}
}
}
// "medicgun_beam_blue"
stock AttachParticle2(iEnt, String:szParticleType[], iCtrl)
{
new iParti = CreateEntityByName("info_particle_system");
new iPart2 = CreateEntityByName("info_particle_system");
if (IsValidEntity(iParti) && IsValidEntity(iPart2))
{
//--------------------------------------
decl String:szCtrlParti[MAX_TARGETNAME];
Format(szCtrlParti, sizeof(szCtrlParti), "tf2ctrlpart%i", iCtrl);
DispatchKeyValue(iPart2, "targetname", szCtrlParti);
SetParent(iCtrl, iPart2, "flag"); // Set one end to follow the "control" point
//--------------------------------------
DispatchKeyValue(iParti, "effect_name", szParticleType);
DispatchKeyValue(iParti, "cpoint1", szCtrlParti);
DispatchSpawn(iParti);
SetParent(iEnt, iParti, "flag"); // Set the main end to emit from the entity
ActivateEntity(iParti);
AcceptEntityInput(iParti, "Start");
return iParti; // iPart2 can be found via "m_hControlPointEnts" probably
//--------------------------------------
}
return -1;
}
I've never tested this before, but I rewrote it from either that or another similar stock in a thread I googled for.
YOU ROCK ! Thanks so much !
:bacon!: SOMETHING FOR YOU (https://www.google.ch/search?q=bacon&tbm=isch) :bacon!:
I wonder how many particles have multiple attachment points anyway. Doesn't merasmus's fire spell have many? Or is it just multiple particle entities?
No idea, totally new to this particles thing...
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.