Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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: 581
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 581
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: 581
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 581
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: 581
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 581
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 | 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