Skip to content

Add trigger to call Level.TeleportTo() - #1146

Open
grog398 wants to merge 5 commits into
EverestAPI:devfrom
grog398:dev
Open

Add trigger to call Level.TeleportTo()#1146
grog398 wants to merge 5 commits into
EverestAPI:devfrom
grog398:dev

Conversation

@grog398

@grog398 grog398 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

The rationale for this trigger is already described in the linked issue for this feature.

Some additional functionality added to the trigger not directly required to call Level.TeleportTo():

  • An "Only Once" condition
  • A flag condition

@maddie480-bot maddie480-bot added the 1: review needed This PR needs 2 approvals to be merged (bot-managed) label Jul 19, 2026
Comment thread Celeste.Mod.mm/Mod/Entities/TeleportTrigger.cs Outdated
Comment thread Celeste.Mod.mm/Mod/Entities/TeleportTrigger.cs Outdated
Comment thread Celeste.Mod.mm/Mod/Entities/TeleportTrigger.cs
grog398 and others added 4 commits July 19, 2026 17:17
Co-authored-by: microlith57 <microlith57@gmail.com>
Co-authored-by: microlith57 <microlith57@gmail.com>
# Conflicts:
#	Celeste.Mod.mm/Mod/Entities/TeleportTrigger.cs

@microlith57 microlith57 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay!


_nextLevel = data.Attr("nextLevel");
_introType = data.Enum("introType", Player.IntroTypes.None);
_useWorldCoordinates = data.Bool("useWorldCoordinates");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to ever use world coordinates? I feel like using world coords is just more cumbersome than room relative coords. Furthermore this could be a node instead.


if (!_useWorldCoordinates || level.Session.MapData.Levels.FirstOrDefault(l => l.Name == _nextLevel) is not { } nextLevel) return;

_nearestSpawn += nextLevel.Position;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is right, TeleportTo takes dest room relative coordinates, so it should be subtracted instead.

return;
}

if (!_useWorldCoordinates || level.Session.MapData.Levels.FirstOrDefault(l => l.Name == _nextLevel) is not { } nextLevel) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fail the teleport entirely (and maybe warn the user) instead of delaying the crash to somewhere else if the _nextLevel doesn't exist.

player,
_nextLevel,
_introType,
_nearestSpawn);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to allow for null values of _nearestSpawn since vanilla also implements that case.

@maddie480-bot maddie480-bot added 2: changes requested This PR cannot be merged because changes were requested (bot-managed) and removed 1: review needed This PR needs 2 approvals to be merged (bot-managed) labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: changes requested This PR cannot be merged because changes were requested (bot-managed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants