Skip to content

Add Destroyed Only trigger event - #1592

Open
JoyfulShush wants to merge 11 commits into
Vinifera-Developers:developfrom
JoyfulShush:add-destroyed-only-trigger-event
Open

Add Destroyed Only trigger event#1592
JoyfulShush wants to merge 11 commits into
Vinifera-Developers:developfrom
JoyfulShush:add-destroyed-only-trigger-event

Conversation

@JoyfulShush

Copy link
Copy Markdown
Contributor

A new trigger event that strictly occurs only when attached object is destroyed.

  • Changing houses, capturing it, and selling it doesn't count.
  • Destruction trigger event persists even when captured - very useful for "Capture and Keep Safe" missions.
  • Works well with Entered By by linking triggers together - if you want to react to the structure being captured
  • Also works well with the Building Exists trigger.

To use this, add the following event to WAE's events in the file at the end of the file:
Map Editor/Editor/Config/Default/Events.ini

[DestroyedOnly]
Name=Destroyed Only
Description=Triggers when the attached object was destroyed, specifically. Unlike other 'Destroyed By' events, it does not trigger for being captured, sold or changing houses. Persists across captures, and is ideal for "Capture and Hold" mission objectives.

Introduce a new extended trigger event EXT_TEVENT_DESTROYED_ONLY and wire it into the event system. Add the enum entry in vinifera_defines.h, register the event as attachable to objects in tevent hooks, and add an object hook that fires the event when an object with an attached tag is destroyed by taking damage (captures/sales/house-changes do not trigger it). Also add necessary includes in objectext_hooks.cpp to support tagging and event triggering.
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown

This comment is automatically generated by Nightly.link and allows non-registered users to get download the artifacts for this pull request.

These links are also updated when the pull request is pushed to.

Comment on lines +395 to +398

case EXT_TEVENT_DESTROYED_ONLY: {
if (event != Event) return false;
}

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.

This is sus... Why is this required for this event, but not for any of the vanilla ones? =

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