[Custom Condition] Baz Scene Check Condition

BazSceneCheckCondition

Checks which game scene the player is in, or which scene they came from.

To help support my work, consider becoming a patron. :folded_hands:

DOWNLOAD:
BazSceneCheckCondition.gd (22.8 KB)

Requirements

AGMaker 1.3.0+

Installation

  1. Download BazSceneCheckCondition.gd (attached below).
  2. Drop it into your project’s custom_conditions/ folder. If that folder doesn’t exist, create it at the project root. A subfolder like custom_conditions/scene/ is fine.
  3. That’s it. It’ll show up in the Add Condition dialog under the Scene / シーン group. Nothing to enable.

What it does

Checks the current or previous game scene by its file path, not by node name.

  • Current or Previous. Test the scene the player is in now, or the one they came from, chosen with one toggle.
  • Matches by scene file. It compares the res:// path, so it’s safe even though every scene’s root node is named GameScene, and it behaves the same in exported builds.
  • Friendly scene dropdown. Auto scans your project and hides engine and template scenes, so you just pick the one you want.
  • Previous works from the first transition. Reliable right away, so you can branch on “did the player arrive from the Title or Game Over screen?”.
  • Single scene equality. Each condition matches one scene. Combine several with AGMaker’s And / Or / Not for multi scene checks.

How to use

  • Which Scene picks whether you’re testing the current scene or the previous one.
  • Scene Picker is the target scene. The dropdown auto scans your project and hides engine and template scenes.

The first time you set Which Scene to Previous, the condition adds a small helper node (BazSceneTracker) to your main scene (core.tscn) automatically. One time, no autoload, fully reversible. You’ll see a friendly yellow notice confirming it, and that’s expected, not an error.

Tips

  • Branch on where the player came from. Use Previous for respawn logic after a Game Over, skipping an intro when they arrive from the Title, unlocking a door only if they came from a specific room, and so on.
4 Likes