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
2 registered members (TipmyPip, 1 invisible), 18,758 guests, and 8 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
p.flags |= BEAM; #286183
08/23/09 19:18
08/23/09 19:18
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
How can I make a smoke tail for a rocket?
I tried this but you can't see the smoke:
Click to reveal..

Code:
function effect_rocket_tail_fast(PARTICLE* p) {
	p.vel_x = you.x - p.x;
	p.vel_y = you.y - p.y;
	p.vel_z = you.z - p.z;
	vec_set(p.x, you.x);
}

function effect_rocket_tail(PARTICLE* p) {
	p.flags |= BEAM;
	p.bmap = raketen_schweif_tga;
	p.alpha = 45 + random(25);
	p.size = 50;
	p.event = effect_rocket_tail_fast;
}

action rocket() {
	effect(effect_rocket_tail, 1, my.x, nullvector);
	
	while (1) {
	...
	move and do some other stuff
	...
	}
}





Thanks for reading, thinking, answering wink
Re: p.flags |= BEAM; [Re: Toryno] #286187
08/23/09 19:23
08/23/09 19:23
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
you must put the line:
effect(effect_rocket_tail, 1, my.x, nullvector);

in the while code.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: p.flags |= BEAM; [Re: alibaba] #286189
08/23/09 19:27
08/23/09 19:27
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Did it but no change.


Thanks for reading, thinking, answering wink
Re: p.flags |= BEAM; [Re: Toryno] #286288
08/24/09 12:57
08/24/09 12:57
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Has no one made something like this yet? frown


Thanks for reading, thinking, answering wink
Re: p.flags |= BEAM; [Re: Toryno] #286300
08/24/09 13:59
08/24/09 13:59
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Calculate the vel vector of the particle before calling the effect function and replace "nullvector" with the calculated vel vector.
Remove the event function from the particle, or replace it with a fade-out function.
That should give you the desired effect.

Re: p.flags |= BEAM; [Re: Xarthor] #286741
08/26/09 21:03
08/26/09 21:03
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Now I'm using the code at the buttom of the post. It's a smoke trail but see how it looks sick



Code:
function effect_rocket_tail_fast(PARTICLE* p) {
	p.flags &= ~MOVE;
}

function effect_rocket_tail(PARTICLE* p) {
	p.flags |= (BEAM | MOVE | TRANSLUCENT);
	p.bmap = raketen_schweif_tga;
	p.alpha = 35 + random(5);
	p.size = 50;
	p.event = effect_rocket_tail_fast;
}

action rocket() {
	ENTITY* victim = NULL;
	VECTOR vel_temp;
	var temp = 0;
	my.TEMPO = 30;
	ANGLE ang_temp;
	
		// aim
		victim = ptr_for_handle(my.TARGET);
		if (victim != NULL) {
			vec_set(ang_temp,opfer.x);
			vec_sub(ang_temp,my.x);
			vec_to_angle(ang_temp,ang_temp);
			vec_set(my.pan, vector(ang_temp.pan, ang_temp.tilt, 0));
		}

		// fly
		c_move(my, vector(my.TEMPO * time_step, 0, 0), nullvector, IGNORE_ME | IGNORE_PASSABLE | IGNORE_YOU);
		
		// smoke tail
		temp += time_step;
		vec_for_angle(vel_temp, my.pan);
		vec_normalize(vel_temp, -my.TEMPO);
		if (temp >= effect_level) {
			effect(effect_rocket_tail, 1, my.x, vel_temp);
			temp -= effect_level;
		}

}



Please, anyone tell me how to make this ugly holes away.

Last edited by Toryno; 08/27/09 15:32. Reason: I think the word is trail and not tail...

Thanks for reading, thinking, answering wink
Re: p.flags |= BEAM; [Re: Toryno] #287155
08/30/09 11:56
08/30/09 11:56
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Maybe just by lengthening the vel_temp for about 5 or 10 quants.
BTW, what is that my.TEMP0?

Re: p.flags |= BEAM; [Re: bart_the_13th] #287156
08/30/09 11:59
08/30/09 11:59
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
cut out the BEAM. its because of it i think.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: p.flags |= BEAM; [Re: alibaba] #287162
08/30/09 12:36
08/30/09 12:36
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Oh! my.TEMPO is my.SPEED in english. wink It's simply the movement speed of the rocket.


Thanks for reading, thinking, answering wink

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