Originally Posted By: pegamode
If an entity is set in WED and you call (entity->link).name the name is returned.
Correct.
Originally Posted By: pegamode
If an entity is created by ent_create and you call the same NULL is returned.
Correct, but un-important.
Originally Posted By: pegamode
So an entity created by ent_create has no name ...
Incorrect, true it has no name in link, but using link as a name is a BAAD habit.
The link info really only tells you about how it was created in WED or 'originally' as a global object.

The name you 'should' be using, youve already supplied in your examples. -> player1
Because you will use something like the following to create your entity,
player1 = ent_create (str_create("giana.mdl"), vector(489 , -71 , -150), NULL);
you can from here on refer to this entity as "player1", if you want to rename it
on-the-fly eek then you can always do something like this...
Code:
   ENTITY* player1;         //outside all functions - global pointer is available to all
   ENTITY* giana_mdl_02;    //outside all functions - global pointer is available to all
   ...

   ...
   // inside some function 
   //
   if( player1 != NULL )    // make sure player has been created
   {
      giana_mdl_02 = player1;   // 'aim' new name at our entity        (this line perfectly fine)
      player1 = NULL;           // 'remove' old name from our entity   (try to avoid this line, can get messy)
   }
   ...

from now on you access the same entity, by the new name of "giana_mdl_02". Is this what you're after?

So what do you need the link name for? How do you plan on using it?
If we knew that we would be better able to suggest a better way of doing what you want,
rather than messing around with un-trustworthy INTERNAL data structures.



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial