EntityParent Is Driving Me Mad !

Blitz3D Forums/Blitz3D Programming/EntityParent Is Driving Me Mad !

semar(Posted 2004) [#1]
I can't understand, for the sake of my life, why I get different results if I parent a particle emitter to an entity, and if I don't.

I mean, I tune the emitter to produce fire, for instance, and everything works as expected when tested 'alone': the flames are big enough, and fly not so fast in the sky while fading.

Then, I decide to parent the emitter to an entity, and everything goes messy: the sprites look smaller, they are now super fast and the flames seems much more like smoke rather than fire.

Sob ! I didn't expect such a frustrating tweaking phase.. Is there any flag to use, to prevent such behaviour ? I've used entityparent with Global flag turned on and off, to retain orientation and position, and tryed all the like: no chance !

I guess that all depends on how the main entity has been previously scaled. Seems to me, that the scale amount in some way affects any entity which is later parented to it. But if so, how can I avoid this ? Even a pivot is affected in the same way.

In the need of some good advice and explanation about it, I'm still struggling into the 'hell of parenting' with no really joy...

:(

Sergio.


Rob(Posted 2004) [#2]
Children scale with the parent. Use scalemesh on the parent instead of scaleentity.


Paul "Taiphoz"(Posted 2004) [#3]
I'v had this happen a few times as well, I think its a bug, although with me it was an animation, When I parent the animated mesh to a base, it no longer animated.

Not really Sure why.


semar(Posted 2004) [#4]
Use scalemesh on the parent instead of scaleentity.
Wow, that was fast !!!

:)

I didn't think about that. I'll try it asap.

@Yavin,
incidentally, I get sometime the same behaviour. The flames disappear when are parented. Still I can't understand the reason.

Thank you BloodLocust,
Sergio.


Rob(Posted 2004) [#5]
A workaround is to use a pivot, attach both entities to the pivot. One can then be scaled with ScaleEntity.


jfk EO-11110(Posted 2004) [#6]
Do I get this right, you are using the optional Parent parameter when you create the entity? Because if you do that, the entity will use the parents attributes (scale, position etc.). But if you first create the entity without any parent, and then after all settings parent it to the parent, using "ParentEntity child, parent", this shouldn't happen. Just make sure not to edit scale or anything of the parent after that unless you want the children to be scaled etc. too.

(BTW semar, if you are still using that particle engine, I have to confess, it pretty tricky sometimes because there are two parameters for speed, one is th growing speed that will be used to fade multiple growing sprites, and the other one named livespan is the number of such growing cycles (see min size and max size). So live span is actually dependent of the the growing speed. Today I'd rather suggest to divide the livespan through the growing speed inside the function to make it more useable because this way the livespan will be more accurate.)


semar(Posted 2004) [#7]
@jfk,

you guess right, I'm using your particle engine, which I find very good. Indeed it has to be tweaked, sometime it's tricky, anyway I get some nice effect by chance, after a frantic try and error session - but overall getting fun too !

And yes, I have supposed that there's some relation between livespan and growing speed, that's why I can discover neat effects or pull my hair off - really !

;-)

But if you first create the entity without any parent, and then after all settings parent it to the parent, using "ParentEntity child, parent", this shouldn't happen
I'm sorry but I have to disagree, this is exactly what I did before, and got a frustrating session. Yesterday night I've used ScaleMesh instead of ScaleEntity, and all the troubles were magically gone. I have to confess that I didn't try the new function you gave me, so I did not test, yet, if the behaviour I got before would be the same by using your new function.

Sergio.


jfk EO-11110(Posted 2004) [#8]
>> this is exactly what I did before <<

Well, this is weird.