Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom outputs to door with buttons #6194

Closed

Conversation

PikaChokeMe
Copy link

@PikaChokeMe PikaChokeMe commented Jun 27, 2021

What this PR does is adds an activate_out wiring output to doors with buttons, windowed doors with buttons, and hatches with buttons. It also allows users to suppress the default door open/close action that normally accompanies these integrated button/door assemblies. The idea is that this allows doors and hatches with integrated buttons to act as triggers for downstream logic circuits which may enable more advanced opening and closing functionality. This also has the added benefit that when AI goes to activate doors and hatches with buttons via waypoints to traverse thresholds it also triggers these custom logic circuits and #JustWorks.

For example, with this change merged and the following XML, both players and AI just "clicking" on a door or hatch with buttons can now trigger complex door activation logic:

<Item identifier="doorwbuttons" … >
  …
  <ConnectionPanel … >
    …
    <output name="activate_out" displayname="connection.activateout" />
  </ConnectionPanel>
</Item>
<Item identifier="windoweddoorwbuttons" … >
  …
  <ConnectionPanel … >
    …
    <output name="activate_out" displayname="connection.activateout" />
  </ConnectionPanel>
</Item>
<Item identifier="hatchwbuttons" … >
    …
  <ConnectionPanel … >
    …
    <output name="activate_out" displayname="connection.activateout" />
  </ConnectionPanel>
</Item>
<connection.activateout>activate_out</connection.activateout>

AI waypoints in action with telescoping hatch logic:

barotrauma.e.2021.06.27.-.16.05.05.11.DVR_5.mp4

Hatch telescoping logic (suppressed default behaviour with complex opening logic) and door powered lightswitch raves (default door opening actions):

barotrauma.e.2021.06.27.-.16.05.05.11.DVR_4.mp4

@ignomen
Copy link

ignomen commented Jul 12, 2021

I strongly endorse this.

@PikaChokeMe
Copy link
Author

I strongly endorse this.

I was actually amazed at how well it worked with the AI. It makes all custom door logic just kind of work :O

@mygamingaccount
Copy link

mygamingaccount commented Oct 3, 2022

With this sort of change you could turn "Button door" and "Custom door" into legacy items and have a "Door" (and hatch) instead.

Comment on lines +184 to +187

[Editable, Serialize(false, true, description: "If the door has integrated buttons, should clicking on it also still perform the default action of opening the door.")]
public bool SuppressDefaultAction { get; private set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Suppress default action" is unnecessarily vague (what's the default action?)
I suggest changing the wording to "Toggles when clicked" and have the setting be default on, doing the opposite of what the parameter does now.

@pantherpusher
Copy link

speedmerge

@Regalis11
Copy link
Collaborator

Thank you for the PR! Finally got around to looking into this.

I did a couple of changes (renaming the SuppressDefaultAction as mygamingaccount suggested) and hiding the property if the door doesn't have integrated buttons, and opened a PR in our private repository: https://github.com/Regalis11/Barotrauma-development/pull/4300

@Regalis11 Regalis11 closed this Jun 14, 2023
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.

None yet

5 participants