Problem with Particule from Wiedo

Blitz3D Forums/Blitz3D Programming/Problem with Particule from Wiedo

Mathieu A(Posted 2003) [#1]
Hi I use the particule engine from Wiedo and I want to deleted an emitter which is pick. But I 've got an error.

The Type of the Emiter and the smoke particule are:

Type P_EMIT
Field ENTITY ; pointer holder to pivot
Field LIFE ; life span of emitter. -1 is forever
Field ACTIVE ; is emitter on / off ? true, false
Field ACTIVE_DELAY ; delay before going on

Field EMIT_TYPE$ Field PARTICLE_COUNT Field PARTICLE_LIFE Field VELX#, VELY#, VELZ# Field X#, Y#, Z#
Field ALPHA#,ALPHA_STEP#
Field SIZE#, SIZE_STEP#
Field COL%, COL_STEP#

End Type

Type P_SMOKE
Field ENTITY Field P_EMIT.P_EMIT Field ASSIGNED Field ACTIVE Field RECYCLE
Field VELX#, VELY#, VELZ#
Field O_VELX#, O_VELY#, O_VELZ#
Field COL#
Field COLSTEP#
Field SIZE# Field SIZESTEP#
Field ALPHA# Field ALPHASTEP#
Field SPAWNDELAY#
End Type

In fact my probleme is that the smoke are children to emiter so when I delete the emiter the smoke haven't parent so I 've got an error.

I try to delete all the particule of the emiter but I can't.
I'm in a big trouble. If someone know how to do it will be great.

THX


Sunteam Software(Posted 2003) [#2]
As far as I remember if you delete the emitter 3D object then all children should be deleted to, so then all you have to do is remove the entries in the type lists (i.e. not the 3D objects as they should be gone already).


DrakeX(Posted 2003) [#3]
you could do something like:

Function FreeEmitter(e.p_emit)
   For part.p_smoke=Each p_smoke
      If part\p_emit=e
         FreeEntity part\entity
         Delete part
      EndIf
   Next
   FreeEntity e\entity
   Delete e
End Function


see if that works.