Hey everyone, I have two questions, stemming from the same problem.
I am trying to rotate an entity, namely, info_particle_system.
I have attempted to do this three different ways.
1.
Code:
TeleportEntity(particle, position, angles, NULL_VECTOR);
2.
Code:
SetEntProp(particle, Prop_Send, "m_angRotation", angles);
*I found m_angRotation by using sm_dump_datamaps, where "m_angAbsRotation" and "m_vecAngVelocity" are also located, however they both cause a run-time error.
3.
Code:
DispatchKeyValue(particle, "Pitch Yaw Roll (Y Z X)", string_angles);
None of these three methods worked. However, TeleportEntity, and SetEntProp worked on other entities (such as doors) during testing.
According to
http://developer.valvesoftware.com/w...article_system, the keyvalue for angular rotation is "Pitch Yaw Roll (Y Z X)". I have a hunch that this may be a typo. I also tried using angles as the keyvalue.
So my question stands, does anyone know how to rotate an info_particle_system, or find correct keyvalues?
This is a watered down version of the code I am using:
Code:
write_particle(ent, String:particle_name[], bool:incapped = false)
{
decl particle;
decl String:target_name[64];
particle = CreateEntityByName("info_particle_system");
if (IsValidEdict(particle))
{
decl Float:position[3], Float:angles[3];
angles[0] = GetRandomFloat(0.0, 360.0);
angles[1] = GetRandomFloat(0.0, 360.0);
angles[2] = GetRandomFloat(0.0, 360.0);
GetEntPropVector(ent, Prop_Send, "m_vecOrigin", position);
TeleportEntity(particle, position, angles, NULL_VECTOR);
Format(target_name, sizeof(target_name), "Entity%d", ent);
DispatchKeyValue(ent, "targetname", target_name);
GetEntPropString(ent, Prop_Data, "m_iName", target_name, sizeof(target_name));
DispatchKeyValue(particle, "targetname", "L4D2Particle");
DispatchKeyValue(particle, "parentname", target_name);
DispatchKeyValue(particle, "effect_name", particle_name);
DispatchSpawn(particle);
SetVariantString(target_name);
AcceptEntityInput(particle, "SetParent", particle, particle);
SetEntPropVector(particle, Prop_Send, "m_angRotation", angles);
ActivateEntity(particle);
AcceptEntityInput(particle, "start");
CreateTimer(GetRandomFloat(1.0, 2.0), delete_particle, particle);
}
}
__________________