Page 1 of 1

[2.0.28] player_index missing from some `on_space_platform_built_entity` events

Posted: Tue Jan 07, 2025 7:00 pm
by coldarn
Removing entities on a space platform via right-click fires the `on_space_platform_built_entity` event with `player_index` field populated in the event object.

Removing via cut action or removal blueprint does NOT include `player_index` in the event callback.

Both of these actions are performed by a player and affect the undo/redo stack, so IMO should indicate which player performed them.

Use case: updating entity tags in the undo stack after removal with data a mod needs to restore the previous game state if undo is triggered.

Re: [2.0.28] player_index missing from some `on_space_platform_built_entity` events

Posted: Tue Jan 07, 2025 9:12 pm
by boskid
That is absolutely Not a bug. on_space_platform_built_entity is raised when a space platform builds entity. Player can only request entities to be built by placing ghosts. on_space_platform_built_entity does not contain player_index for the same reason why on_robot_built_entity does not contain player_index.

Re: [2.0.28] player_index missing from some `on_space_platform_built_entity` events

Posted: Wed Jan 08, 2025 12:05 am
by IsaacOscar
I had a similar problem, event.entity.last_user should hopefully give the player that built the ghost.