Table of content

Previous: 1.a What are particles?

b. Particle creation

Now we move to the next step: how do we create particles? Ordinary entities can be created in 3 different ways in 3DGS: using WED, using the entity definition or calling the ent_create function. Particles can only be created using the effect function. As we now show, effect() and ent_create() are however similar in spirit and use. Here are the definitions from the manual:

effect(function, number, vector pos, vector vel);		(1.1)

creates a number number of particles with function function attached to each of them, and it places them at the position specified by the vector pos and with velocity vector vel.

Similarly,

ent_create(string filename, vector Position, function);		(1.2)

creates a single entity, represented by the object file specified by the string filename, places it at position position and attaches action function to it. Very similar indeed.

You might be thinking the following: "My maths are a little rusty. What is a vector again, and what do they have to do with concrete things such as position, speed and force?"

Video game design is a very multidisciplinary activity, with people doing all sorts of wonderful and exciting things such as modeling, animating, graphic design, textures creation, level design, music and sound creation, to mention only a few. Spending most of my 3DGS time playing around with mathematical equations to see what interesting thing they do to particles and entities, I'm sometimes forgetting that most people who use 3DGS are not doing maths everyday. Let's go then quickly over the basics.

Next: 1.c Essentials of vector algebra