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
0 registered members (), 18,561 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
Some Particle help ... pls #294563
10/19/09 21:28
10/19/09 21:28
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
So lately, I've wanted to create a "ghost"-like player that floats around when you die ( kinda like in WoW ).
I created a small level to test it in and a transparent object to which i applied it as an emitter to particles.

This is what it looks like:


BUT, when i move the character, it does this trail ...


Is there a way to remove this trail that it leaves behind? I would like the particles to move in respect with the object (transparent), so that they would remain the way they did in the first picture.

Thanks laugh

Re: Some Particle help ... pls [Re: Rohiaw] #294646
10/20/09 12:05
10/20/09 12:05
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
that is how particles behave, if you want them to follow your player, you'd probably have to do some complex vector coding... which i cant do grin OR you'll probably have to make each particle fade out and move quicker. so the old particles get removed quickly before the new particles are created...

Re: Some Particle help ... pls [Re: darkinferno] #294648
10/20/09 12:25
10/20/09 12:25
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
This is not complex but in fact simple, you only need to add the player position to the particles own movement in the particle function. Like this:

...
vec_set(p.x,p.skill_x);
vec_add(p.x,my.x);
...

and then you move the particle with its skill_x/y/z instead of its x/y/z vector.

Re: Some Particle help ... pls [Re: Petra] #294665
10/20/09 14:01
10/20/09 14:01
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
i'll try that code out and see how it works. wink

Re: Some Particle help ... pls [Re: Rohiaw] #294670
10/20/09 14:22
10/20/09 14:22
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
I tried the code ... but it didnt do much of anything.

This is the code that concerns the particles:
Code:
function orbEffectsDefinition(PARTICLE* orbs){
	orbs.bmap = effect_bmp;
	orbs.alpha = 50;
	orbs.vel_x = random( 3 ) - 1.500;
	orbs.vel_y = random( 3 ) - 1.500;
	orbs.vel_z = random( 3 ) - 1.500;
	orbs.size = 1;
	orbs.gravity = 1;
	orbs.flags |= (BRIGHT|MOVE|BEAM|OVERLAY);
	orbs.event = orbEffect_spec_fun;
}

function orbEffects(){
	vec_scale(normal,10);
	effect(orbEffectsDefinition, 120, player.x, vector(60,60,60));
}



Can you pls tell me where to add that code, Petra ?
If its not to much to ask ...
Thanks again laugh

Last edited by Rohiaw; 10/20/09 14:26.
Re: Some Particle help ... pls [Re: Rohiaw] #294677
10/20/09 15:09
10/20/09 15:09
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
When you use the MOVE flag then my code wont work. You must then add the players speed to the particle position.

function orbEffectsDefinition(PARTICLE* orbs){
vec_set(orbs.skill_x,player.x); <==
orbs.bmap = effect_bmp;
orbs.alpha = 50;
orbs.vel_x = random( 3 ) - 1.500;
orbs.vel_y = random( 3 ) - 1.500;
orbs.vel_z = random( 3 ) - 1.500;
orbs.size = 1;
orbs.gravity = 1;
orbs.flags |= (BRIGHT|MOVE|BEAM|OVERLAY);
orbs.event = orbEffect_spec_fun;
}

and in the orbEffect function:

vec_sub(orbs.x,orbs.skill_x);
vec_add(orbs.x,player.x);
vec_set(orbs.skill_x,player.x);


Re: Some Particle help ... pls [Re: Petra] #294678
10/20/09 15:23
10/20/09 15:23
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
Just one problem. The orbEffect function cannot access the "orbs" PARTICLE* variable - as it is a parameter.
What to do ?? smirk

Re: Some Particle help ... pls [Re: Rohiaw] #294679
10/20/09 15:28
10/20/09 15:28
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
by the way - you can parse your code like this:

[code ] ===================> Without the space after the "e"
code pasted here
[/code ] ===================> Without the space after the "e"

It will look like this:
Code:
code pasted here



Its much more efficient. wink

Re: Some Particle help ... pls [Re: Rohiaw] #294680
10/20/09 15:34
10/20/09 15:34
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
I meant not orbEffects but orbEffect_spec_fun.

I know the code tag but am too lazy to use it laugh

Re: Some Particle help ... pls [Re: Petra] #294682
10/20/09 15:35
10/20/09 15:35
Joined: Feb 2009
Posts: 52
Rohiaw Offline OP
Junior Member
Rohiaw  Offline OP
Junior Member

Joined: Feb 2009
Posts: 52
hehe XD - i'll try the code again 10x

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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