find if an entity passed through a certain point

Blitz3D Forums/Blitz3D Programming/find if an entity passed through a certain point

Damien Sturdy(Posted 2005) [#1]
Hey peeps




This is in 3d before you start doing 2d stuff :)

basically, i need to know if zombie will move through the target point on its next move. im not wanting to use collision cubes or anything. The problem im getting is that in a script engine im working on, when the zombie gets to the target location, it doesnt trigger the next bit of code because sometimes the zombie passes through the target and is not detected.
This is not a problem with the zombie game, but the script engine, which id like to be used on a larger scale (other games and such). By the way, the entire zombie game is written by script :)

In the instance of it not being possible (maybe because i have the zombie "smooth turning" towards its target) then am i going to be able to do it via collisions? (ack)


DJWoodgate(Posted 2005) [#2]
Perhaps just use distance to the target, based on movement speed. If within the distance start turning toward next target. I expect you could make it speed up and slow down for turns as well which might be an idea in corridors like that.


Damien Sturdy(Posted 2005) [#3]
ahh, thats a nice lil idea there.. dont know what i should call that command.


Thats how im doing it now and it should work, it it doesnt.. and for the life of me i dont know why ^.^ il go attack my code.

[edit]

Okay, so theres something i didnt write about.

The reason that idea doesnt work is that i have damping (cant remember the real word.) the player is moved the same as it was moved on its last movement, but by sligtly less (*.9) so what it does is translateentity object,oldmx*damp,oldmy*damp,oldmz*damp, and then Moveentity object,mx,my,mz.

So i suppose all i need to know is how to take the damping into consideration?


DJWoodgate(Posted 2005) [#4]
I guess so, it sounds like they are going to be slippery little buggers. I was just thinking they would be moving in the direction they were facing, but I suppose a bit of a stagger is only to be expected.


Damien Sturdy(Posted 2005) [#5]
well, the distance thing works fine on zombies... but not, say, for ice blocks or cars... :)


..or....Zombies on Ice ^.^