-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Adds Parcel Wrap #34471
base: master
Are you sure you want to change the base?
Adds Parcel Wrap #34471
Conversation
RSI Diff Bot; head commit 3ed9e5a merging into 6361a12 Resources/Textures/Objects/Misc/ParcelWrap/parcel_wrap.rsi
Resources/Textures/Objects/Misc/ParcelWrap/wrapped_parcel.rsi
|
The RSI test failure is complaining about the licenses I've used. TG station's repo's license is AGPL-3.0 . Does that not cover the sprites as well? What should I use instead? |
Use CC license Can you double-check the attribution of the art assets? I think the main page of the tg repo states sprites are CC or something, while GPL applies only to code. |
update attribution on modified `unwrapped` sprite to better conform to CC's guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, code looks great! Lot of minor nitpick stuff. The only actual issues:
1.) Move as much of this as you can into shared (Especially the verbs)
2.) I think a doafter would make a lot of sense. They are annoying to make but it would feel a lot better!
3.) It feels weird that one wrap has an infinite amount of uses. I think making it like an item stack or something would be nice (Or at least some kind of maximum usages).
If you need help with any of this ask on discord!
Also, it would also be fun if PAIs had their name changed if they were in a parcel! Just add the component to the list in pai.yml:77 - Fully up to you though (I'm also biased 😆)
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
- state: parcel-medium | ||
map: [ "enum.WrappedParcelVisuals.Layer" ] | ||
- type: WrappedParcel | ||
unwrapSound: /Audio/Effects/poster_broken.ogg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems odd. The noise sounds great but I'm not sure that its a good idea to reuse like this (Same with the handcuffs)! I'll ask to get confirmation.
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Server/ParcelWrap/EntitySystems/ParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
@beck-thompson , I kinda sidestepped a few of your organizational comments by shattering the system into three files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting the system up into mutliple files like that is much cleaner good job 👍
Some more prediction issues but they shouldn't be too difficult to fix! Again, if you have any questions let me know here or discord 🫡
Content.Shared/ParcelWrap/EntitySystems/ParcelWrappingSystem.ParcelWrap.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/ParcelWrappingSystem.ParcelWrap.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/SharedParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// How many times this wrap can be used to create parcels. | ||
/// </summary> | ||
[DataField(required: true), AutoNetworkedField, Access(typeof(SharedParcelWrappingSystem))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might not need the access after you move stuff around! Also if this has a default don't bother making it required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All components should have restricted access by default, but you can move typeof(SharedParcelWrappingSystem)
to the access attribute on the component, not just this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like if the [Access]
on the class is omitted, the default is unrestricted. (eg. DrinkSystem
was able to modify this field directly with no RA complaints).
And, following the principle of least privilege, since only this Uses
field needs to be changed by systems, the friend
should be set on just this field.
Content.Shared/ParcelWrap/EntitySystems/ParcelWrappingSystem.ParcelWrap.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/SharedParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/SharedParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/ParcelWrappingSystem.WrappedParcel.cs
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// How many times this wrap can be used to create parcels. | ||
/// </summary> | ||
[DataField(required: true), AutoNetworkedField, Access(typeof(SharedParcelWrappingSystem))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All components should have restricted access by default, but you can move typeof(SharedParcelWrappingSystem)
to the access attribute on the component, not just this field.
Content.Shared/ParcelWrap/EntitySystems/ParcelWrappingSystem.ParcelWrap.cs
Outdated
Show resolved
Hide resolved
Content.Shared/ParcelWrap/EntitySystems/SharedParcelWrappingSystem.cs
Outdated
Show resolved
Hide resolved
One more thing I forgot to mention (because I hate looking over yaml), for entity prototypes you should stick to the |
replace mostly-duped client/server with if(onserver)
@slarticodefast indicated this implementation has some issues: https://discord.com/channels/310555209753690112/770682801607278632/1331719351283351563 Follow the replies on https://discord.com/channels/310555209753690112/770682801607278632/1333271598676971570 to see the back and forth, but I'm of the opinion that there's not really any components that can just solve this, so check out my proposed changes to generalize the behavior here away from being tied to parcels: Until I get some more feedback, I don't think there's anything more I can do with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on the PR! The prediction stuff is nasty but everything seems to work now 🫡
(Someone else with more experiencing might need to weigh in on if there is a way to make it more generalizable)
About the PR
Adds Parcel Wrap, which can wrap items into nice little parcel boxes :)
(Many thanks to @lvvova1 , who put together a previous PR which I referenced quite a lot: #7974 )
AfterInteractEvent
) or used via aUtilityVerb
, which enables wrapping things which have storage, which'd eat the wrap rather than use it.UseInHandEvent
) or via anInteractionVerb
, which enables unwrapping things which are too big to pick up (currently not strictly necessary).Why / Balance
More ways to hide bombs is more fun. Also I want mail to be more of a thing, and this moves in that direction.
Technical details
ParcelWrapComponent
WrappedParcelComponent
ParcelWrappingSystem
WrappedParcel
s in such a way that they copy the size of the wrapped item, which guards against size-arbitrage.WrappedParcel
entity prototypeMedia
https://github.com/user-attachments/assets/35df1d43-580e-4fe3-b7e7-dcfcc84d9ce8
(Shows off the
doafter
s and examine text)https://github.com/user-attachments/assets/f8dc8d13-f295-468c-9c17-7973a1f37e26
(Known bugs in this media: popup refers to the parcel rather than the contents; wrapping in a container can be jank when things have unusual shapes)
https://github.com/user-attachments/assets/fef7de45-ab09-47f6-a571-a8af8d3cd782
(Demos fixes to the bugs in the previous)
(Cargo order + crate)
Requirements
Breaking changes
All new stuff
Changelog
🆑