ObjectHandle must be used with object ?

Blitz3D Forums/Blitz3D Beginners Area/ObjectHandle must be used with object ?

StOrM3(Posted 2004) [#1]
Error message during compilation, upon encountering this line
NameEntity hold(count)\item,Handle(hold(count)\item)


and hold(count)item is either a loaded model or a pivot, or a cube or a sphere. Any ideas as to why handle is not working as expected ?


N(Posted 2004) [#2]
This might be off, but this is how I've known it to be. Handle returns the integer handle of an object (type). Object returns a reference to a type if you pass a valid handle to it.

I'm guessing you're not familiar with the Object/Handle instructions?

Take out the call to Handle and see if it works (just plain hold(count)\item).


StOrM3(Posted 2004) [#3]
okay, I took out handle and just left hold(counter)\item and it worked. So now what is the item's name ? Which is a mesh handle, or a handle to a pivot or sphere, or cube.. ?


N(Posted 2004) [#4]
Do a 'Print EntityName(hold(count)\item)', that should return the entity's name. In this case, I'm assuming you're naming the entity after its integer handle (all entities are referenced by integers in Blitz).


big10p(Posted 2004) [#5]
Handle() returns an integer ID unique to the particular type instance you pass it.

In the above code you're attempting to obtain the handle of an entity (sphere, cube, whatever). Entities are not types and types are not entities!! Sorry for stating the obvious but you seem to be getting confused as to what Handle()/object() do - they only work on type instances.

Anyway, try this instead:

NameEntity hold(count)\item,Handle(hold(count))