Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Adds VolumeObject trigger target type to enable direct enable/disable control of volume instances in TombEngine, distinct from VolumeEvent which triggers event sets associated with volumes.

Changes

  • TriggerInstance.cs: Added VolumeObject = 18 to TriggerTargetType enum
  • NgParameterInfo.cs: Exposed VolumeObject target type and VolumesInLevel parameter range for TombEngine
  • NgParameterRange.cs: Implemented VolumesInLevel support for volume instance selection in UI
  • LevelCompilerTombEngine.cs: Added _volumeTable for global volume indexing across rooms
  • FloorData.cs: Implemented VolumeObject compilation with TryGetValue error handling

Implementation

Volumes are indexed globally during compilation, similar to cameras and sinks. Triggers store the volume index in compiled floor data:

// Volume table populated at compile time
_volumeTable = new Dictionary<VolumeInstance, int>();
foreach (var room in _level.ExistingRooms)
    foreach (var obj in room.Objects.OfType<VolumeInstance>())
        _volumeTable.Add(obj, volumeID++);

// Trigger compilation groups VolumeObject with other simple object triggers
case TriggerTargetType.VolumeObject:
    trigger2 = (ushort)(GetTriggerParameter(trigger.Target, trigger, _fdFunctionMask) | func);
    result.Add(trigger2);

Game engine can now reference volumes by index to control their enabled state via trigger actions.

Original prompt

I want to add new trigger object type. It should be for volume object.

Once its compiled in level data I can easily add code to enable, disable volume object in the game engine using triggers.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits January 25, 2026 14:29
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
…le triggers

Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Co-authored-by: TrainWrack <120750885+TrainWrack@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new trigger object type for volume Add VolumeObject trigger target type for direct volume control Jan 25, 2026
Copilot AI requested a review from TrainWrack January 25, 2026 14:39
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