Ghosts after hide entity?

Blitz3D Forums/Blitz3D Beginners Area/Ghosts after hide entity?

gerald(Posted 2013) [#1]
When using a proximity code to have the player take damage I find that even after the entity is hit and hidden its ghost can trigger more damage.

Missles destroyed at 300 elevation will still set off a positiony#< 25 loop at the end of the sequence also after they are entity hidden.

This is on one pass through a big loop. I have to translateentity,0,5000,0 to get the destroyed entity to stop setting off the damage at positiony#<25.

The command reference implies that an "hideentity" command means an eneity cannot be involved in collisions.

What is the deal with these ghosts setting off collisions?
Gerald


Kryzon(Posted 2013) [#2]
A hidden entity is not renderable, nor will it be processed with blitz collisions.

It can still be moved, rotated, scaled among being subject to several other changes.
If you're using the position of an entity as the condition for something to happen ("proximity code"), hiding it will not invalidate that condition.

You need something like a flag variable: a variable that stores either True or False. Once the entity triggers the condition, change the flag variable so the entity gets discarded from further tests.
Each missile entity should have its own flag variable, so you need to use Types for this.


RemiD(Posted 2013) [#3]

A hidden entity is not renderable, nor will it be processed with blitz collisions.


That's what the doc explains, but see this example (i have already posted it before but without any answers)



This example shows that to desactivate a collider in order to be able to reposition it, only one method works reliably, it is to delete the collider which has been collided and to create another collider.
With the others ways (EntityType 0, or ResetEntity, or HideEntity then ShowEntity) the collider is still active, you can see the differences between the X,Y coordinates of the BulletOrigine and the X,Y coordinates of the BulletCollider.
Or maybe i am not using the commands in the right way. If so please explain.

Thanks,


Stevie G(Posted 2013) [#4]
The 'collisions' command should be used outside your main loop and you should not be using clearcollisions each loop.

If you hide and reset the entity after it has collided with something then no further collisions will be recorded.

Stevie


Kryzon(Posted 2013) [#5]
There's some undocumented behavior with Hide\ShowEntity and collisions.

I gave the low-down here:




gerald(Posted 2013) [#6]
Thanks,

I never thought of a locking variable true/false. I spent 4 hours trying stuff like entityviewable and entity in view to find out how to get rid of the ghosts. I will try switching from translate entity crash 0,5000,0 to a variable that changes after the entity is hit/hidden.

Gerald


RemiD(Posted 2013) [#7]

The 'collisions' command should be used outside your main loop and you should not be using clearcollisions each loop.


Stevie G>>I have tried to remove them from the loop and it does not change anything. But thanks anyway.

Kryzon>>Thanks for the example. I see what you are doing, the collider must be either shown or hidden before updateworld.

My example was more about how to reposition a collider after a collision has occured (collisions without response)


gerald(Posted 2013) [#8]
hide entity = true
view entity = true

OMG, I see dead entities!

Gerald