Solved spawn entities with an alias

Question that is answered or resolved.

PS_VITA

Active member
Hi, On level txt I know how to spawn
an object and assign it an alias.

How is this done with a spawn script?

I'm familiar with the spawn01 script created by @DCurrent and I know I can use setspawnentry("alias", "_");
but what do I need to write or modify in the script in order to have both the entity name an assign an alias at spawn?

Thank you
 
Solution
Entities don't actually have an alias property. That's just a spawn command that sets the entity's name property as it spawns into play. Otherwise name is the same as the model's name. The entity's name property is accessible through script:

C:
char entity_name = "";

entity_name = getentityproperty(<entity pointer>, "name");

entity_name = "John_Smith";

changeentityproperty(<entity pointer>, "name", entity_name);

Additionally there's a defaultname property. It also starts as the model's name, and never changes unless you do it with script.

DC
Entities don't actually have an alias property. That's just a spawn command that sets the entity's name property as it spawns into play. Otherwise name is the same as the model's name. The entity's name property is accessible through script:

C:
char entity_name = "";

entity_name = getentityproperty(<entity pointer>, "name");

entity_name = "John_Smith";

changeentityproperty(<entity pointer>, "name", entity_name);

Additionally there's a defaultname property. It also starts as the model's name, and never changes unless you do it with script.

DC
 
Solution
Entities don't actually have an alias property. That's just a spawn command that sets the entity's name property as it spawns into play. Otherwise name is the same as the model's name. The entity's name property is accessible through script:

C:
char entity_name = "";

entity_name = getentityproperty(<entity pointer>, "name");

entity_name = "John_Smith";

changeentityproperty(<entity pointer>, "name", entity_name);

Additionally there's a defaultname property. It also starts as the model's name, and never changes unless you do it with script.

DC
Great! And Thank you!
 
Back
Top Bottom