-
Notifications
You must be signed in to change notification settings - Fork 654
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
Trade crate storage machine for cargo ships #3016
base: master
Are you sure you want to change the base?
Conversation
RSI Diff Bot; head commit 55e6d36 merging into 15c48c5 Resources/Textures/_NF/Structures/Machines/crate_machine.rsi
Resources/Textures/_NF/Structures/Storage/crate_storage_rack.rsi
|
This PR needs a quick glance over review before doing a more thorough review. There's still plenty to improve i am sure |
How much does each rack hold? |
It currently holds two each. Let me know if you think it needs more, ill rework sprites |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Given the infrastructure making it hold three crates per tile would be a pretty distinct upgrade over simply attempting to smash crates via conveyor. |
i figured myself though that the benefit of it being automatable with conveyors already is huge |
Another note on this: adding more (upgraded) crate storage racks is also an option, this can easily be done, even for different types - like barrels. |
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.
Without diving too deep into this:
- Let's say I have things bound for multiple places. How would I best use this in that case?
- Do we want to lean more into conveyor belts as the only real solution for moving goods? We have mechs, we have vehicles, why pick the most passive option?
// Skip crate storage racks that aren't mounted on a grid. | ||
if (compXform.GridUid == null) | ||
continue; |
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.
Not needed given 26-27, 40-41.
if (!comp.Powered) | ||
continue; |
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.
I'd recommend using SharedPowerReceiverSystem.IsPowered rather than storing the powered state in the component.
Dirty(rackUid.Value, rackComp); | ||
|
||
storedCrates.Add(new StoredCrate { CrateUid = crateUid, CrateStorageRack = rackUid.Value }); | ||
_transformSystem.SetCoordinates(crateUid, new EntityCoordinates(GetStorageMap(), Vector2.Zero)); |
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.
Curious, why use a dedicated map for this vs. nullspace?
} | ||
|
||
// Dictionary where the key is the entity id of the crate storage and the value is the list of stored crates. | ||
private readonly Dictionary<EntityUid, List<StoredCrate>> _storedCrates = new(); |
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.
Why not use the components themselves to structure the interactions ("this machine knows about these crates, stored on these racks")? The entire fact that the entity ID is your key implies that you can store it per-entity without issue.
You can also:
A) clear it when the component shuts down (no more funny orphaned crates)
B) get the approximate value whenever some dingus sells their ship with 400 crates in off-map storage.
About the PR
This PR adds a machine and a rack that allows storage of trade crates on cargo ships.
It is intended for mappers to allow adding these to the ships.
Conveyor belts can be constructed under it for automation! Heck yes!
Any crate that has the trade crate component is insertable and there is no whitelist for this.
Once they are grabbed by the machine, they are moved to a frozen map until they are called back again.
TODO:
Why / Balance
This is a way to get rid of the crate stacking mechanics currently in place.
How to test
Open entity spawn panel and look for "cratestorage".
Spawn a crate storage machine and a few racks.
Link a button or a remote signaller to the crate storage machine by right clicking the machine, then clicking on the machine icon in the pop-up list.
Any crate that has a trade crate component will work.
Media
cratestoragerack_2.mp4
Requirements
Breaking changes
Changelog
🆑