Cannot retrieve type

Archives Forums/Blitz3D SDK Programming/Cannot retrieve type

Robert Cummings(Posted 2007) [#1]
'Get entity data
Local myobj:entity = HandleToObject ( bbEntityID( picked ) )


picked is an entity... when I try this code it wont even compile and throws up an error "Unable to convert from 'Object' to entity'"

Any idea what I am doing wrong? I just want to look up the type I associated with the entity using:

bbSetEntityID( e.entity , HandleFromObject( e ) )


big10p(Posted 2007) [#2]
What kind of var type is 'entity'? It needs to be a Type for that code to work.


H&K(Posted 2007) [#3]
Is this related?
http://www.blitzmax.com/Community/posts.php?topic=70326


Gabriel(Posted 2007) [#4]
Without knowing what type Entity is, You usually have to explicitly cast to your type from any function which returns an object.

So you might try

Local myobj:entity = entity( HandleToObject ( bbEntityID( picked ) ) )



Robert Cummings(Posted 2007) [#5]
Thank you Gabriel that seems to be the issue. Docs are very vague, probably would not have hurt to have had one example line showing it.