Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Dico), 16,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Particle movement #293470
10/11/09 18:23
10/11/09 18:23
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
Does anyone know how to make particles move together with an object. What I've noticed is that just adding a particle creates a particle on a certain spot (e.g. vecParticle.x , my.x) and then it remains on this spot until its lifespan = 0. What to do to make it move with the object????


a generator of dull questions smile
Re: Particle movement [Re: BastovBros] #293472
10/11/09 18:30
10/11/09 18:30
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
There's an attribute for particle velocity or something like that. Try playing with that.
And maybe this could help you:
Code:
function p_fountain(PARTICLE* p)
{
   VECTOR vTemp;
   vec_randomize(vTemp,2);
   vec_add(p.vel_x,vTemp);
   vec_set(p.blue,vector(random(255),random(255),255));
   set(p, MOVE | BRIGHT | TRANSLUCENT);
   p.alpha = 100;
   p.size = 2;
   p.gravity = 0.2;
   p.skill_a = 3; // fade factor
   p.event = p_alphafade;
}





Ubi bene, ibi Patria.
Re: Particle movement [Re: croman] #293481
10/11/09 19:27
10/11/09 19:27
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
Got an error : "vec_randomize - undiclared identifier" So it does not work. Here is my code, which attributes can I miss?
Quote:
function fade_dust(PARTICLE *p)
{
p.alpha -= 10 * time_step;
p.size += 3 * time_step;
if (p.alpha < 0) { p.lifespan = 0;}
}

function dust(PARTICLE *p)
{
//vec_randomize(vecDust, 5);
p->vel_x = 1 - random(1);
p->vel_y = 1 - random(1);
p->vel_z = 0 + random(2);
p.alpha = 50 + random(5);
p.bmap = sprite_fog;
p.size = 7;
//p.lifespan = 50;
p.flags |= ( MOVE);
p.event = fade_dust;
}

function particle_start(){
while(1){
vec_set (vecDust.x, vector (20,0,-1));
vec_rotate (vecDust.x, my.pan);
vec_add (vecDust.x, my.x);
effect (dust, 1, vecDust, nullvector);
wait(-0.50);}
}

action fly()
{
particle_start();
...



a generator of dull questions smile
Re: Particle movement [Re: BastovBros] #293494
10/11/09 21:51
10/11/09 21:51
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
p->vel_x = 1 - random(1);
p->vel_y = 1 - random(1);
p->vel_z = 0 + random(2);


This part is for moving(adding velocity) your particles. If you dont undertand this code well you should read the litec workshop and manual.



Ubi bene, ibi Patria.
Re: Particle movement [Re: croman] #293497
10/11/09 21:58
10/11/09 21:58
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Happy Birthday Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
I would suggest to save the relative position to the model in the skills of the particle and then add the models position to get the world position. You can also do rotation, if needed. To accomplish this for multiple models, you can store the pointer to the model the particle belongs to in another skill.

How that helped
Scorpion

Re: Particle movement [Re: croman] #293499
10/11/09 22:18
10/11/09 22:18
Joined: Jul 2008
Posts: 128
Ukraine
BastovBros Offline OP
Member
BastovBros  Offline OP
Member

Joined: Jul 2008
Posts: 128
Ukraine
2 croman : Well, If you look at any particle of a moving object , you'll see that they remain in their spots after they are created, instead of moving along with the object. And it's very noticable if you stand and then go, since particles are of the proper size if you stand, but seem bigger if you move, because they get closer to the camera (they remain on their initial spots). And "playing" with velocity (p->vel_x,p->vel_y, etc) does not seem to help much.

Last edited by BastovBros; 10/11/09 22:19.

a generator of dull questions smile
Re: Particle movement [Re: BastovBros] #293517
10/12/09 05:46
10/12/09 05:46
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline
Member
seecah  Offline
Member

Joined: Apr 2009
Posts: 248
Philippines
If you really want to let your particle move in accordance with your model you can use vec_for_vertex function and use the resulting vector in your effect function..

Or for you to have a clue on making particle trails you can try to look at AUM78 as reference under Unanswered Questions..

Hope this helps



Can't is not an option™
Re: Particle movement [Re: BastovBros] #293545
10/12/09 10:30
10/12/09 10:30
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
Yea I know that...anyway, you could perhaps create particles with very short life span and make them create faster and in bigger amount. This might give you an effect of particles following your object. Just an idea, I never tried making the particles follow some object on that way you want.



Ubi bene, ibi Patria.
Re: Particle movement [Re: croman] #293547
10/12/09 11:14
10/12/09 11:14
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Can you post the code that you already have for your particles?
One that positions the particles the way you want. (assuming the model stays still)

Then I'll see if I can make them move with the entity from 'action fly()'.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Particle movement [Re: EvilSOB] #293554
10/12/09 12:50
10/12/09 12:50
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Hi,
I saw some code in the aum, I can't remimber what one it was.

http://www.gstools.de/index.php?option=com_content&task=view&id=12&Itemid=55


renny


I have A7 Commercial .............. Now I just need to learn how to use it

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1