Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (SBGuy, AndrewAMD), 1,410 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Why is my particle beam not rotating when it's emitter rotates? #235072
11/05/08 20:13
11/05/08 20:13
Joined: May 2008
Posts: 150
Switzerland
Hitsch Offline OP
Member
Hitsch  Offline OP
Member

Joined: May 2008
Posts: 150
Switzerland
I have an entity that contains a bone and I'm emitting particles from its location, mainly downwards.

1. Now when I rotate my entity and (I think) the bone with it, the particles keep going down. I would like the particle direction to stick to the entity's vector.
Could it be the nullvector when running the effect? I couldn't get it to change so far.

2. Now my second problem is that I have an engine part that is also rotated by a bone, but it should always point down. Can I give a bone an absolute direction vector?

Thx for your help

... for 1:
Code:
function thrusterEffect_spec_fun(PARTICLE* p)
{
if(p.size > 0) { p.size -= 0.262 *time_step; }else{p.lifespan = 0; }
   my.alpha -= 20 *time_step;
   if(p.alpha < 0) { p.alpha = 0; p.lifespan = 0; }
}

function thrusterEffect_variables(PARTICLE* p)
{
	

    p.blue = 128 ;
    p.green = 128 ;
    p.red = 128 ;
    p.vel_x = random( 1 ) - 1 ;
    p.vel_y = random( 1 ) - 1 ;
    p.vel_z = random( -10*Geschw );
    p.size = 5 ;
    p.alpha = 50 ;
    p.gravity = 0 ;
    set(p, BRIGHT|TRANSLUCENT|MOVE);
    p.event = thrusterEffect_spec_fun;
}


function thrusterEffect()
{
  while(1)
  {
     particleCount = 40;
     
   vec_for_bone(PartFront,my,"PartPosFront");						//setzt den Partikelursprung auf den bestimmten Bone
	vec_for_bone(PartBackL,my,"PartPosBL");							//setzt den Partikelursprung auf den bestimmten Bone
	vec_for_bone(PartBackR,my,"PartPosBR");							//setzt den Partikelursprung auf den bestimmten Bone
     
     effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartFront,nullvector);
         effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartBackL,nullvector);
				effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartBackR,nullvector);

     wait(1);
  }
}


action simplePart_action()
{
  thrusterEffect();

}


Last edited by Hitsch; 11/05/08 20:13.
Re: Why is my particle beam not rotating when it's emitter rotates? [Re: Hitsch] #235086
11/05/08 21:39
11/05/08 21:39
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
1. The particles will of course go down, as you are setting their speed in the particle function. You can try a "vec_rotate(p->vel_x,your.pan);" right after the instruction p.vel_z = random(-1*Gesch);

2. No, you can't. At least as far as i know. But you can correct the angle with ent_bonerotate.


Always learn from history, to be sure you make the same mistakes again...
Re: Why is my particle beam not rotating when it's emitter rotates? [Re: Uhrwerk] #235096
11/05/08 22:23
11/05/08 22:23
Joined: May 2008
Posts: 150
Switzerland
Hitsch Offline OP
Member
Hitsch  Offline OP
Member

Joined: May 2008
Posts: 150
Switzerland
Thx Uhrwerk!

That's exactly what I was looking for. I just couldn't find the commands.
I'm still trying on my second problem, but I think it will work eventually by just constantly rotating the bone in the opposite direction. Which is what you recommended if I'm right.

Cheers


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

Gamestudio download | chip programmers | 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