Skip to content

Comments

Add a leave script to scripttriggers#3656

Open
Narre wants to merge 1 commit intoSuperTux:masterfrom
Narre:scripttrigger_leave
Open

Add a leave script to scripttriggers#3656
Narre wants to merge 1 commit intoSuperTux:masterfrom
Narre:scripttrigger_leave

Conversation

@Narre
Copy link
Contributor

@Narre Narre commented Feb 12, 2026

This PR adds a "Leave script" to scripttriggers. This script is triggered upon losing contact with the trigger. It doesn't activate in "button" mode. I made it so that the scripttrigger's trigger counter in non-button mode only increases after leaving the trigger, meaning that in "oneshot" mode, the regular script and the leave script will each trigger once but not again after re-entering the scripttrigger area.

I also added the m_ prefix for member variables in the ScriptTrigger class.

Why? This:
image
(it's from The Curse of Quiddlesworth, and this is a common theme across the add-on; this PR, if merged, would cut the amount of scripttriggers used in there by 60-70%)

DO NOT MERGE until after 0.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant