Hands-On Usage
create_entity is commonly used to dynamically spawn decorative or functional entities on the map, such as summoning a monument model in the capital province after a nation completes a specific focus, or generating a battlefield effect marker at specified coordinates when an event fires. Below is a typical example of spawning an entity at a specific province within an event and storing its id in a variable:
immediate = {
create_entity = {
entity = my_monument_entity
province = 3614
var = my_monument_id
rotation = 0.0
scale = 1.0
visible = my_monument_visible_trigger
}
}
Synergy
[set_entity_position](/wiki/effect/set_entity_position): After an entity is created, this command can be called at any time to move it to new coordinates, commonly used for dynamic markers that need to track changing front lines.
[set_entity_animation](/wiki/effect/set_entity_animation): When used together, you can play a specified animation immediately after the entity is spawned for more vivid visual effects.
[destroy_entity](/wiki/effect/destroy_entity): After recording the entity via var or id, you can destroy it in another trigger or event, achieving a complete lifecycle management of "spawn—display—destroy".
[set_entity_rotation](/wiki/effect/set_entity_rotation): After spawning, dynamically correct the orientation based on script logic, suitable for entities that need to face a specific target.
Common Pitfalls
- The
entity field takes a GFX entry name, not a model filename. Beginners often directly paste .mesh file paths or localization names, causing the game to silently fail to find the entry without any error message, and the entity will never appear on the map.
- Province coordinates and manual coordinates can stack but direction is easy to get wrong:
x/z are offsets relative to the center of a province/state. If you specify both a province and large manual coordinate offsets, the entity may end up at an unexpected location or even outside the map boundary. It is recommended to debug using only province first, then fine-tune the offset values after confirming the position.