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

Improve user-generated entity/wirelink outputs #2891

Merged
merged 3 commits into from
Dec 9, 2023

Conversation

Denneisk
Copy link
Member

@Denneisk Denneisk commented Nov 22, 2023

Simple facelift to user-generated ("Create Entity") outputs.

  • Add output remover keybind (shift+r) to wire tool to remove user-generated outputs
  • Fixed port number assignment to not give bad values for same inputs
  • Made user-generated entity and wirelink outputs creation more sensible
  • Changed wire_adv networking to use a single networkstring
  • Removed using WireLib.CreateWirelinkOutput when it's not necessary
  • Removed E2 entity:wirelink() creates a wirelink output
  • ??? other magic to make this work

Fixes #2888

- Add output remover
- Made adding entity and wirelink outputs more sensible
- Cleaned up port assignment to not give bad indices
- Removed using CreateWirelinkOutput when it's not necessary
- Removed E2 `entity:wirelink()` creates a wirelink output
- ??? other magic to make this work
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we do something like shift+r with the wire tool removes outputs? Making a whole new tool for this is kind of messy.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess so. I didn't want to touch the wire tool because I figured it had enough features.

Refactored wire_adv netcode to use a single networkstring
@thegrb93
Copy link
Contributor

thegrb93 commented Dec 4, 2023

I think it looks okay. Not sure if it will break addon compatibility

@Denneisk
Copy link
Member Author

Denneisk commented Dec 4, 2023

I think it looks okay. Not sure if it will break addon compatibility

I doubt any addon is using anything here in an unsafe way. Net messages part is more just for safety in case.

@thegrb93 thegrb93 merged commit 95adeb4 into wiremod:master Dec 9, 2023
1 check failed
@Fasteroid
Copy link
Contributor

I think it looks okay. Not sure if it will break addon compatibility

:trollface:

Comment on lines -279 to -281
if not self.entity.extended then
WireLib.CreateWirelinkOutput( self.player, self.entity, {true} )
end
Copy link
Contributor

@Fasteroid Fasteroid Dec 12, 2023

Choose a reason for hiding this comment

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

#2940, just posting review to make it official

@Grocel
Copy link
Contributor

Grocel commented Dec 12, 2023

I think it looks okay. Not sure if it will break addon compatibility

Well at least there is one addon I know off that could get issues. The removal of the wirelink output breaks the "isWired" detection needed in the entity of my project. This will lead e2 wirelinks to no longer work with it.

More details: Grocel/3D-Stream-Radio#20

@Denneisk
Copy link
Member Author

Well at least there is one addon I know off that could get issues. The removal of the wirelink output breaks the "isWired" detection needed in the entity of my project. This will lead e2 wirelinks to no longer work with it.

The solution you use is not a good indicator of wirelinks being used. You'll need to work around the fact that wirelinks can ignore wires.

TriggerOutput accepts varargs so I'll have it send a table indicating it's a wirelink. That will be far simpler.

@Grocel
Copy link
Contributor

Grocel commented Dec 13, 2023

The solution you use is not a good indicator of wirelinks being used. You'll need to work around the fact that wirelinks can ignore wires.

Yeah, I know. Wiremod had nothing else I could have used for that. Is was somewhat ok to use for my use case, though.

TriggerOutput accepts varargs so I'll have it send a table indicating it's a wirelink. That will be far simpler.

As seen in #2942. I need something like this, thanks.

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.

Wirelinks create nil errors on client
4 participants