Object.'type' ?

Blitz3D Forums/Blitz3D Programming/Object.'type' ?

Tin-cat(Posted 2006) [#1]
while searching thru example code i found one that has something interesting in it.

Mesh = CollisionEntity (b\entity,i)
c.ball = Object.ball EntityName( mesh )

when i saw this i thought it was pointing c to the type attached to the mesh of the collided entity.
however i cant get this object command to give me anything but null!

Is that possible? i would love to be able to do something like that!
eg

Mesh = CollisionEntity (b\entity,i)
c.ball = Object.ball EntityName( mesh )
c\hitpoints = c\hitpoints - b\damage

--oh also, object isnt in the help file, nor the online one


Stevie G(Posted 2006) [#2]
Store the type handle in the entities name and this will work fine.

c.ball = new ball
c\Mesh = createsphere()
NameEntity c\Mesh, Handle( c )

Stevie


splinux(Posted 2006) [#3]
Object and Handle are undocumented blitz commands.

Handle give you the integer address of an object:

objHandle% = Handle(obj)

Object returns the object in a given address:

obj.TYourObjType = Object.TYourObjType(objHandle)


octothorpe(Posted 2006) [#4]
http://blitzbasic.com/Community/posts.php?topic=53348


Tin-cat(Posted 2006) [#5]
Thanks Stevie! Name entity is exactly what i needed.

check out the sloution here

http://www.blitzbasic.com/codearcs/codearcs.php?code=1629