Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Position Particle Emissions problem

Author
Message
blacks94
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 23rd Sep 2010 17:07
Hi everyone,

I\\\'m sure this is really simple to solve, but I can\\\'t figure out what\\\'s wrong.
So, I have a game level with four enemies which will shoot particles, and I\\\'d like these particles to move towards the camera making a trail.
Using dbPositionParticles (ID, dbParticlesPositionX (ID), dbParticlesPositionY (ID), dbParticlesPositionZ (ID) - 1) in the main loop [Of course ID is a number in my code] I managed to move particles towards the camera, but still I can\\\'t get a trail.

Documentation offers a valid alternative, which is to say dbPositionParticleEmissions. But when I use it, passing the arguments (ID, dbParticlesPositionX (ID), dbParticlesPositionY (ID), dbParticlesPositionZ (ID) - 1) nothing happens.

No particles are displayed or moved, I can\\\'t understand why.
Any help would be really appreciated.

Thanks,
Luca
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 24th Sep 2010 20:25
Try storing the particle position in a variable and incrementing or decrementing it, instead of using the ParticlePosition function which seems to return the original value if only the emission is moved. With this code I could get a quite nice trail:

blacks94
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 25th Sep 2010 00:15
Your code is absolutely perfect, and makes a great trail - exactly the one I wanted.

Problem is, that in my program some nasty bug makes particles actually disappear when dbPositionParticleEmissions is called, even when I'm using a variable instead of dbParticlesPositionZ ().

I'm still trying to find that bug, if I can't I'll try posting my code and see if someone finds something unusual.
Thank you very much for your help!
blacks94
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 25th Sep 2010 18:09
New clues... I found the missing trail, it hadn't disappeared.
It had simply been placed out of sight.

If anyone knows why the instruction dbPositionParticleEmissions (19, 623, 526, posZ) where posZ is 440 decreasing to 340 makes a particle trail at 1389, 1051, 830 (x, y, z) then we can solve this problem.

Waiting for your replies... thank you all.
blacks94
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 25th Sep 2010 18:21
OK, I'm almost there!

Parameters I pass to dbPositionParticleEmissions are doubled.
Just one question: WHY?
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 26th Sep 2010 14:00 Edited at: 26th Sep 2010 14:01
It seems the coordinates that you pass to dbPositionParticleEmissions are interpreted relative to the origin of the particle system that you set in dbPositionParticles. Try setting the system origin (dbPositionParticles) to (0,0,0) and then the emission coordinates should be OK.
blacks94
14
Years of Service
User Offline
Joined: 23rd Sep 2010
Location:
Posted: 26th Sep 2010 16:02
Perfect!!

It works great now. Thank you so much for your help, you're excellent at using DarkGDK!

Login to post a reply

Server time is: 2024-11-19 18:32:08
Your offset time is: 2024-11-19 18:32:08