Modding:Simple Particles: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 22: Line 22:
This will spawn some white cube particles, which simply fall to the ground. They are spawned right in front of the player.
This will spawn some white cube particles, which simply fall to the ground. They are spawned right in front of the player.


[[File:BasicParticles.png]]
[[File:BasicParticles.png|300px]]


== Properties Overview ==
== Properties Overview ==
Line 30: Line 30:
=== Position ===
=== Position ===


Basically there are two properties. One of the is the <code>minPos</code> property, which will determine the exact position where it will spawn. All particles will spawn there if <code>addPos</code> is not defined.
Basically there are two properties. One of them is the <code>minPos</code> property, which will determine the exact position where particles will spawn. <code>addPos</code> is relative to this position, once a particle will spawn it will be randomized and added to the particle's position. If <code>addPos</code> is not defined all particles will spawn at the exact some position.
 
Same position:
 
[[File:Particle (equal position).png|300px]]
 
If we now set <code>addPos</code> ...
 
<syntaxhighlight lang="c#">
    myParticles.addPos = new Vec3d(0.5, 0.5, 0.5);
</syntaxhighlight>
 
... particles will spawn in an 0.5³ area:
 
[[File:Particle (differnt position).png|300px]]


=== Velocity ===
=== Velocity ===
It follows the same way as position. You can configure a minimum velocity (<code>minPos</code>) and an additional velocity (<code>addPos</code>).
<syntaxhighlight lang="c#">
    myParticles.minVelocity = new Vec3f(0, 3, 0);
</syntaxhighlight>
In this case all particles have the same velocity (particles fly in the air but will eventually fall down again):
[[File:Particles (equal velocity).gif|300px]]


=== Life length ===
=== Life length ===
Confirmedusers, editor, Administrators
886

edits