Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Checklist

Links to issue(s) this pull request concerns (if applicable)

N/A

Pull request description

Adds engine support for TO_VOLUME trigger type already present in compiled levels. Enables dynamic control of volume enabled state via triggers and anti-triggers.

Changes

  • trigger.h: Added TO_VOLUME to TRIGOBJECTS_TYPES enum
  • trigger.cpp: Implemented TO_VOLUME handler in TestTriggers()
    • Locates target volume via global index across all rooms
    • Sets Enabled = true on trigger activation
    • Sets Enabled = false on anti-trigger (ANTIPAD/ANTITRIGGER/HEAVYANTITRIGGER)

Implementation

Volume lookup uses sequential iteration through g_Level.Rooms[].TriggerVolumes to resolve global index to specific volume instance. Follows existing pattern of trigger value as direct index (cf. TO_OBJECT, TO_CAMERA).

case TO_VOLUME:
    // Find volume by global index
    int globalIndex = 0;
    for (auto& room : g_Level.Rooms) {
        for (auto& volume : room.TriggerVolumes) {
            if (globalIndex == value) {
                targetVolume->Enabled = (triggerType != ANTIPAD && 
                                        triggerType != ANTITRIGGER && 
                                        triggerType != HEAVYANTITRIGGER);
                break;
            }
            globalIndex++;
        }
    }
Original prompt

I have added a new TRIGOBJECTS_TYPES for volumes. Update the trigger code so that when triggered the TriggerVolume enabled field becomes true and when anti triggered it becomes false


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…state

Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Copilot AI changed the title [WIP] Update trigger code for TRIGOBJECTS_TYPES to manage volume states Implement TO_VOLUME trigger support for controlling volume enabled state Jan 25, 2026
Copilot AI requested a review from TrainWrack January 25, 2026 14:41
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.

2 participants