Page 1 of 1

New Event: on_entity_teleported, script_raised_teleported

Posted: Sun Mar 01, 2020 6:47 am
by eradicator
What

Official support for event based teleportation handling between mods.

Details

Several mods like Picker Dollies or Warptorio 2 allow the player to teleport/move existing entities. However due to lack of an "official" event for this everyone implements their own undocumented remote interface for sharing event ids which makes it difficult for other mod authors to support "moving" as a generic function.

Expected

Ideally it would be awesome if LuaEntity.teleport() also supported "{raise_teleported=true}" style equivalent to LuaSurface.create_entity. The event could look something like this:

Code: Select all

on_entity_teleported or script_raised_teleported

  Called after an entity was teleported.

  Contains
    entity :: LuaEntity
    source_position :: Position
    source_surface :: LuaSurface
    player_index :: uint (optional): The player that caused the teleporting.
    

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Fri Mar 13, 2020 10:11 am
by Optera
+1
Having to register to custom events on each mod teleporting entities around became a loosing battle.

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Thu Jan 05, 2023 12:58 pm
by ILLISIS
+1 from me

Space Exploration's upcoming version will teleport spiders to other surfaces instead of cloning them so having a natural event-driven way to detect a surface change of a spider will be useful.

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Mon Feb 06, 2023 6:55 am
by Stringweasel
+1

Would be great to ensure your custom entities don't break without you knowing. For example with SE's spaceships and my Space Spidertron

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Mon Feb 06, 2023 11:48 am
by Xorimuth
+1
Picker dollies and Space Exploration both use teleportation and are both very common. It would be nice not to have to rely on implementing custom events, etc.

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Mon Feb 06, 2023 3:03 pm
by Pi-C
+1! GCKI may teleport vehicles to another surface. If a vehicle controlled by AAI Programmable Vehicles is teleported to another surface, it will resume its path there -- even if that doesn't make sense. While I have a custom event that I can raise (or so I believe), it would be more transparent for other mods if they could listen to a vanilla event instead of having to ask me for the latest event ID.

Re: New Event: on_entity_teleported, script_raised_teleported

Posted: Fri Mar 03, 2023 4:42 pm
by Stringweasel
This is implemented 1.1.77. Awesome! :D