Hands-On Usage
set_entity_position is commonly used to dynamically reposition custom map entities (such as visual effects, decorative objects, or battlefield markers). For example, you can trigger an event to move a visual entity to a specified province or state to enhance narrative presentation. When combined with create_entity to spawn an entity, you can immediately use this command to place it precisely at the target location. It's also frequently seen in loop logic, where entities appear to "move" across the map as the game progresses.
# Move entity with id=101 to province 3080 (Paris)
set_entity_position = {
id = 101
province = 3080
}
Synergy
[create_entity](/wiki/effect/create_entity) — Create the entity first, then use this command to position it. This is the most typical "create-then-place" workflow.
[set_entity_rotation](/wiki/effect/set_entity_rotation) — After repositioning an entity, you typically need to adjust its rotation simultaneously. Use both commands together to achieve complete pose control.
[set_entity_animation](/wiki/effect/set_entity_animation) — Switch animation states after repositioning to ensure the entity displays the correct visual effects at its new location.
[destroy_entity](/wiki/effect/destroy_entity) — Use this in conjunction when the entity completes its purpose and needs to be removed from its new position, forming a complete lifecycle of "move → display → destroy".
Common Pitfalls
- Silent failure from incorrect id — The
id must correspond to an entity that already exists (created via create_entity). Providing a non-existent id won't trigger an error but will have no effect whatsoever. New players often mistakenly think the command itself is broken.
- Position offset from mixing coordinate systems —
x/y are map world coordinates, while province/state are game-data-based positioning methods. You cannot freely mix them expecting cumulative effects — when both are specified, the game will only use one according to its internal priority. Always choose one positioning method explicitly.