How to warp entities ("temporally no collisions")

Blitz3D Forums/Blitz3D Programming/How to warp entities ("temporally no collisions")

gameproducer(Posted 2007) [#1]
I tried searching my own code archives and the board, but couldn't find out where is the code for moving entities so that they wouldn't collide. (temporal situation when re-loading a level - and I want to get those 20 guys in the right places... but when I use "positionentity", they collide with houses etc.)

Was there some simple way to handle this (without unsetting & setting collisions?). In a network game I might need to warp just one player from some far away place to the right position... how can I disable collisions for the duration of this warp?


big10p(Posted 2007) [#2]
Either hide the entities before moving them and then re-showing them, or use ResetEntity after moving them.


Danny(Posted 2007) [#3]
ResetEntity?

Should you place you character in an occupied space (ie. another character) then after a resetEntity shouldn't it "not collide" until the two seperate?
Can't say for sure, I use ODE for collision...
To prevent colliding with 'houses', I think that should just be prevented in the first place?!

Hope this helps,
D.


Stevie G(Posted 2007) [#4]
@ Danny - I don't think you understand. I'm pretty sure the coords of the positionentity will not be anywhere near the houses. Using positionentity is the same as moving the entity from the origin 0,0,0 to it's new location so will invoke collisions if there's anything in it's path and collisions are set up. Reset entity simply resets the collision state. It's the only way round it other than hideing, moving then showing.


Mortiis(Posted 2007) [#5]
I used hideentitiy positionentity showentity as big10p said, in a platform game of mine when teleporting through portal gates.


Danny(Posted 2007) [#6]
Yes, I'm pretty sure I don't fully understand :) (Note: I'm rusty on blitz collision - haven't used them for many years)
But I thought PositionEntity would also cancel out collision checking (for that frame for that entity) - and you would need to use MoveEntity in order to preserve collision when tranforming entities? Is that not correct??

But I'm intersted to know/understand why:
PositionEntity + ResetEntity > Won't work in your case; whilst
HideEntity + PositionEntity + ShowEntity > DOES work for you..

Cheers,
D.


big10p(Posted 2007) [#7]
Nah, when you PositionEntity, the collision system considers the entity has moved along the path from it's old position, to it's new position. It doesn't treat it as though the entity just magically teleported/warped there. :)

But I'm intersted to know/understand why:
PositionEntity + ResetEntity > Won't work in your case; whilst
HideEntity + PositionEntity + ShowEntity > DOES work for you..
I don't think anyone said ResetEntity didn't work, did they?


gameproducer(Posted 2007) [#8]
ResetEntity - that's the one I was after.

I noticed I still have a bug (must be something else... :)) since the characters are still somewhere where they shouldn't be ;) Anyway - thanks big10p and others.


jfk EO-11110(Posted 2007) [#9]
One more word about it: Positionentity will position it at the new location, no matter what. But with the next UpdateWorld call the system will check for collisions between the old and the new position, and move the entity to the location of the collision.

Now, when you use HideEntity then Blitz "forgets" the old location, not sure if this is a feature or a bug, but we need to be aware of it, also when we hide things for the sake of actually hiding them, collision won't work and location history is erased.

In theory you should also be able to:
positionentity
hideentity
showentity
Updateworld

ResetEntity at the other hand does the same, but unlike HideEntity it's really the dedicated function for the task.


gameproducer(Posted 2007) [#10]
Yep, thanks!


Neochrome(Posted 2007) [#11]
entityreset?


gameproducer(Posted 2007) [#12]
Lol :)