Target system

Blitz3D Forums/Blitz3D Programming/Target system

RiverRatt(Posted 2005) [#1]
In the fps game I am working on; it uses Tokamak. (Are you still with me?) I want to make the player lock on to a target when the control button is is hit. I have that part doen using a blitz linepick. It then gives the world location, distance and the entity, and using this info creates a pivot, that is a child to the selected target. I have all this part done.
Now the hard part I can't figure out to do is, I would like the player to rotate around that pivot, so that the player model and the camera (child of the player model) points to that pivot and stayes locked in distance, so that is the radius of travel. It must point ant the target but move using tokarb_impulse, while still changing its pitch yaw to the terrain. Anyone have some Ideas on how to do this?

My second question is about the return value you get for the PickedEntity ( ) function. It returns a number rather than the name I have assigned. I asume this is the memory address? Anyhow how do I go about using that to change it back into my yariable name.

Here is the relivent code.




jfk EO-11110(Posted 2005) [#2]
pickedentity returns a handle. It's a number, of course. Like all entities. Not a memory adress. Eg:

Enemy=loadmesh("thingie.3ds")
...
p=PickedEntity(..

If p=enemy then print "outch!"