Based on Bill's code above:
Graphics3D 1024,768,32,2 Global light = CreateLight() Global sky=CreateSphere(50) EntityColor sky,0,156,196 ScaleEntity sky,30,10,30 FlipMesh sky ground=CreatePlane(1) EntityColor ground,48,56,8 TranslateEntity ground,0,-5,0 EntityOrder sky,999 Global camera=CreateCamera() MoveEntity camera, 0,0,-5 RotateEntity camera,0,0,180 ; Create a bank used to store a single integer value. Global G_intbank = CreateBank( 4 ) ; Declare the constant used to identify the monster object class. This should be a positive, non-zero value. Const C_MONSTER = 1 ; Declare the variable which determines the maximum number of monsters which can appear in the game. Global G_max_monsters = 10 ; Declare the monster object blueprint. Type T_monster Field entity Field name$ End Type ; Declare the monster objects array. Dim A_monster.T_monster( G_max_monsters ) ;..... ; Create a new monster, and give it a name. index = 1 A_monster( index ) = New T_monster A_monster( index )\entity = CreateCube() A_monster( index )\name$ = "Hubert" EntityPickMode A_monster( index )\entity,2 ; Store the monster's object class number, and array index number, inside its namestring. ; These two values will be stored as two 16 bit shorts stored in a 32 bit integer. PokeShort G_intbank, 0, C_MONSTER PokeShort G_intbank, 2, index NameEntity A_monster( index )\entity, PeekInt( G_intbank, 0 ) ;.... While Not KeyDown(1) HidePointer TurnEntity camera,MouseYSpeed(),0-MouseXSpeed(),0 RenderWorld ; Camera pick a point in the viewport with the specified camera and grab the entity handle of any object that gets picked. entity = CameraPick( camera, 512,360 ) If entity ; Make sure that the 'entity' variable contains a non-zero number, indicating that something was picked. ; Extract the value stored in the picked entity's namestring, as an integer number. value = EntityName( entity ) If value ; Make sure that the 'value' variable contains a non-zero number, ; indicating that an integer value was actually stored in the picked entity's namestring. ; This assumes that zero is not used as a valid value for object data stored in the namestring. ; Store the value in the int bank so it can then be extracted as two short values. PokeInt G_intbank, 0, value ; Get the object's class number. object_class = PeekShort( G_intbank, 0 ) ; Get the object's index number. index = PeekShort( G_intbank, 2 ) Select object_class Case C_MONSTER ; Display the name of the monster. Text 10, 10, A_monster( index )\name$ End Select EndIf EndIf Flip Wend