NameEntity

Blitz3D Forums/Blitz3D Beginners Area/NameEntity

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

NameEntity entity, namestring$ - Sets the namestring of the specified entity.
EntityName( entity ) - Returns the specified entity's namestring.

The namestring is just an ordinary string value. You can use it for whatever you want.

Most modelling programs allow you to set the namestrings of the various parts of a model, so you can use the namestrings, in combination with functions such as FindChild, to search the entity hierachy of a multi-part model for a particular entity within that hierarchy.

You can also use the namestring to store data, or references to data, within an entity. You may wish to store an array index which indexes one or more arrays which contain data about a particular group of entities, for example. You can also use the namestring in combination with the (undocumented) Handle and Object commands to store the handle for a Blitz custom Type. This can be extremely useful when you need to access the custom data associated with an entity that had its entity handle returned as part of a collision, pick, or similar operation.