I've succesfully emitted particles on most GameEntities
With this line of code I can create ParticleSystem on missiles, and so to make fire arrows.
I am aware fire arrows can be achieved by editing xml, but I want control over these particles so that I can make even the enemies who got hit burn, and deal damages to them.
The strange thing is, any GameEntity that belong to a living agent won't emit particles.
weaponEntity is the GameEntity of current whielded sword, and it doesn't work, the fire won't show when it's wielded.
But once I drop the sword on the ground it burns, and particles show up.
In the end I found a way to succesfully attach ParticleSystem to a living agent, which is by the following code:
No. This API returns no reference of the ParticleSystem created, so I have no control over it, I can't turn it off, the fire stays on the agent's hand even if I switch weapon or empty handed.
I've been toying with particles and got some funny looking effects, I hope someone can continue the search and find a way to attach ParticleSystem to an agent with the reference of the ParticleSystem.
My goal is to make a working fire arrows and fire swords mod that can lit the hit target on fire and deal burning damages.
The damage part is easy, checked.
The fire arrows is done, checked.
The fire sword is done as well but with some issues, half checked.
I CAN lit enemy on fire, also checked.
So the problem remains to be, once the ParticleSystem is generated on an agent, I can never remove it.
I've tried the following code:
It's something similar to Agent.Main.AgentVisuals.CreateParticleSystemAttachedToBone(), but it returns the reference.
Still it doesn't work. Nothing other than AgentVisuals.CreateParticleSystemAttachedToBone() works on a living agent.
ParticleSystem particle = ParticleSystem.CreateParticleSystemAttachedToEntity("psys_game_burning_agent", missile.Entity, ref localFrame);
With this line of code I can create ParticleSystem on missiles, and so to make fire arrows.
I am aware fire arrows can be achieved by editing xml, but I want control over these particles so that I can make even the enemies who got hit burn, and deal damages to them.
The strange thing is, any GameEntity that belong to a living agent won't emit particles.
ParticleSystem particle = ParticleSystem.CreateParticleSystemAttachedToEntity("psys_game_burning_agent", weaponEntity, ref localFrame);
weaponEntity is the GameEntity of current whielded sword, and it doesn't work, the fire won't show when it's wielded.
But once I drop the sword on the ground it burns, and particles show up.
In the end I found a way to succesfully attach ParticleSystem to a living agent, which is by the following code:
IT WORKS! The fires show on the sword I am wielding, it looks great, now I have a fire sword, everything is cool, right?Agent.Main.AgentVisuals.CreateParticleSystemAttachedToBone("psys_game_burning_agent",
Game.Current.HumanMonster.MainHandItemBoneIndex, ref localFrame);
No. This API returns no reference of the ParticleSystem created, so I have no control over it, I can't turn it off, the fire stays on the agent's hand even if I switch weapon or empty handed.
I've been toying with particles and got some funny looking effects, I hope someone can continue the search and find a way to attach ParticleSystem to an agent with the reference of the ParticleSystem.
My goal is to make a working fire arrows and fire swords mod that can lit the hit target on fire and deal burning damages.
The damage part is easy, checked.
The fire arrows is done, checked.
The fire sword is done as well but with some issues, half checked.
I CAN lit enemy on fire, also checked.
So the problem remains to be, once the ParticleSystem is generated on an agent, I can never remove it.
I've tried the following code:
ParticleSystem particle = ParticleSystem.CreateParticleSystemAttachedToBone("psys_game_burning_agent",
Agent.Main.AgentVisuals.GetSkeleton(), Game.Current.HumanMonster.MainHandItemBoneIndex, ref localFrame);
It's something similar to Agent.Main.AgentVisuals.CreateParticleSystemAttachedToBone(), but it returns the reference.
Still it doesn't work. Nothing other than AgentVisuals.CreateParticleSystemAttachedToBone() works on a living agent.
Last edited: