-
Notifications
You must be signed in to change notification settings - Fork 146
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 Item Transfer System #476
Conversation
I'm sorry, I accidentally deleted it while trying to rename the branch |
Hello, DangerRevolution, yes, of course, you can edit my post, but I still don't know myself what I would like to write here. |
Updated the description slightly. |
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.
Just playtested this:
Two issues, everything else is fine.
A) In Debug; someone receiving an item throws an exception. I can recreate it and send you the error if you don't manage to recreate it. It's something to do with the target not having the correct component to recieve.
B (Part 1) Giving yourself an item; switching hands and recieving it from yourself. Then, clicking on yourself again to hand it back to yourself locks the alert to your screen even if you walk away from the item.
In this screenshot I followed the steps with the Captain's ID you see in the picture.
B (Part 2): Receiving an item from a player; then clicking yourself with it will ALSO trigger the prompt to give and lock this alert to your screen, until you fuck around with it to stop the alert.
Otherwise; system is very nice. A cool addition. Just needs some minor changes.
@@ -110,3 +110,6 @@ alerts-revenant-essence-desc = The power of souls. It sustains you and is used f | |||
alerts-revenant-corporeal-name = Corporeal | |||
alerts-revenant-corporeal-desc = You have manifested physically. People around you can see and hurt you. | |||
alerts-offer-name = Offer | |||
alerts-offer-desc = Something offers you some kind of item |
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.
alerts-offer-desc = Something offers you some kind of item | |
alerts-offer-desc = Someone offers you an item. |
offer-item-give-other = {$user} handed {THE($item)} to {$target} | ||
offer-item-give-target = {$user} handed you a {THE($item)} | ||
|
||
offer-item-no-give = You're no longer offer a {THE($item)} to {$target} |
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.
offer-item-no-give = You're no longer offer a {THE($item)} to {$target} | |
offer-item-no-give = You're stop offering {THE($item)} to {$target} |
I think I fixed everything, but I'm not sure about the first one, I would appreciate it if you would send me the error. |
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.
Error code:
Exception has occurred: CLR/Robust.Shared.Utility.DebugAssertException
An unhandled exception of type 'Robust.Shared.Utility.DebugAssertException' occurred in Robust.Shared.dll: 'Entity 2479 is not the owner of the component. Component: HandsComponent'
at Robust.Shared.Utility.DebugTools.AssertOwner(Nullable1 uid, IComponent component) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\Utility\DebugTools.cs:line 178 at Robust.Shared.GameObjects.EntitySystem.Resolve[TComp](EntityUid uid, TComp& component, Boolean logMissing) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntitySystem.Resolve.cs:line 22 at Content.Shared.Hands.EntitySystems.SharedHandsSystem.TryPickup(EntityUid uid, EntityUid entity, String handName, Boolean checkActionBlocker, Boolean animateUser, Boolean animate, HandsComponent handsComp, ItemComponent item) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Shared\Hands\EntitySystems\SharedHandsSystem.Pickup.cs:line 50 at Content.Server.OfferItem.OfferItemSystem.Receive(EntityUid uid, OfferItemComponent component) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\OfferItem\OfferItemSystem.cs:line 53 at Content.Server.Alert.Click.AcceptOffer.AlertClicked(EntityUid player) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\Alert\Click\AcceptingOffer.cs:line 21 at Content.Shared.Alert.AlertsSystem.HandleClickAlert(ClickAlertEvent msg, EntitySessionEventArgs args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Shared\Alert\AlertsSystem.cs:line 324 at Robust.Shared.GameObjects.EventBusExt.HandlerWrapper
1.Invoke(EntitySessionMessage1 msg) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EventBusExt.cs:line 46 at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass4_0
1.b__0(Unit& ev) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 173
at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 335
at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 324
at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent(EventSource source, Object toRaise) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 267
at Robust.Server.GameObjects.ServerEntityManager.b__8_0(Object _, Object systemMsg) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 53
at Robust.Server.GameObjects.ServerEntityManager.DispatchEntityNetworkMessage(MsgEntity message) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 280
at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 191
at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 729
at Robust.Server.BaseServer.b__66_1(Object sender, FrameEventArgs args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 542
at Robust.Shared.Timing.GameLoop.Run() in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\Timing\GameLoop.cs:line 235
at Robust.Server.BaseServer.MainLoop() in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 569
at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\Program.cs:line 76
at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\Program.cs:line 44
at Robust.Server.ContentStart.Start(String[] args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\ContentStart.cs:line 10
at Content.Server.Program.Main(String[] args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\Program.cs:line 9`
offer-item-give-other = {$user} handed {THE($item)} to {$target} | ||
offer-item-give-target = {$user} handed you a {THE($item)} | ||
|
||
offer-item-no-give = You're stop offering {THE($item)} to {$target} |
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.
offer-item-no-give = You're stop offering {THE($item)} to {$target} | |
offer-item-no-give = You stop offering {THE($item)} to {$target} |
offer-item-full-hand = You don't have a free hand | ||
|
||
offer-item-try-give = You offer the {THE($item)} to {$target} | ||
offer-item-try-give-target = {$user} offer you a {THE($item)} |
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.
offer-item-try-give-target = {$user} offer you a {THE($item)} | |
offer-item-try-give-target = {$user} offers you a {THE($item)} |
@@ -0,0 +1,13 @@ | |||
offer-item-empty-hand = You don't have anything in your hand to give! | |||
|
|||
offer-item-full-hand = You don't have a free hand |
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.
offer-item-full-hand = You don't have a free hand | |
offer-item-full-hand = Your hand isn't free to receive the item. |
done |
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.
Round 2 of errors; this seems to happen on the target of the giving.
Exception has occurred: CLR/Robust.Shared.Utility.DebugAssertException
An unhandled exception of type 'Robust.Shared.Utility.DebugAssertException' occurred in Robust.Shared.dll: 'Entity 2449 is not the owner of the component. Component: HandsComponent'
at Robust.Shared.Utility.DebugTools.AssertOwner(Nullable1 uid, IComponent component) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\Utility\DebugTools.cs:line 178 at Robust.Shared.GameObjects.EntitySystem.Resolve[TComp](EntityUid uid, TComp& component, Boolean logMissing) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntitySystem.Resolve.cs:line 22 at Content.Shared.Hands.EntitySystems.SharedHandsSystem.TryPickup(EntityUid uid, EntityUid entity, String handName, Boolean checkActionBlocker, Boolean animateUser, Boolean animate, HandsComponent handsComp, ItemComponent item) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Shared\Hands\EntitySystems\SharedHandsSystem.Pickup.cs:line 50 at Content.Server.OfferItem.OfferItemSystem.Receive(EntityUid uid, OfferItemComponent component) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\OfferItem\OfferItemSystem.cs:line 53 at Content.Server.Alert.Click.AcceptOffer.AlertClicked(EntityUid player) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\Alert\Click\AcceptingOffer.cs:line 21 at Content.Shared.Alert.AlertsSystem.HandleClickAlert(ClickAlertEvent msg, EntitySessionEventArgs args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Shared\Alert\AlertsSystem.cs:line 324 at Robust.Shared.GameObjects.EventBusExt.HandlerWrapper
1.Invoke(EntitySessionMessage1 msg) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EventBusExt.cs:line 46 at Robust.Shared.GameObjects.EntityEventBus.<>c__DisplayClass4_0
1.b__0(Unit& ev) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 173
at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEventCore(EventSource source, Unit& unitRef, EventData subs) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 335
at Robust.Shared.GameObjects.EntityEventBus.ProcessSingleEvent(EventSource source, Unit& unitRef, Type eventType) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 324
at Robust.Shared.GameObjects.EntityEventBus.RaiseEvent(EventSource source, Object toRaise) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\GameObjects\EntityEventBus.Broadcast.cs:line 267
at Robust.Server.GameObjects.ServerEntityManager.b__8_0(Object _, Object systemMsg) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 53
at Robust.Server.GameObjects.ServerEntityManager.DispatchEntityNetworkMessage(MsgEntity message) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 280
at Robust.Server.GameObjects.ServerEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 191
at Robust.Server.BaseServer.Update(FrameEventArgs frameEventArgs) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 729
at Robust.Server.BaseServer.b__66_1(Object sender, FrameEventArgs args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 542
at Robust.Shared.Timing.GameLoop.Run() in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Shared\Timing\GameLoop.cs:line 235
at Robust.Server.BaseServer.MainLoop() in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\BaseServer.cs:line 569
at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\Program.cs:line 76
at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\Program.cs:line 44
at Robust.Server.ContentStart.Start(String[] args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\RobustToolbox\Robust.Server\ContentStart.cs:line 10
at Content.Server.Program.Main(String[] args) in C:\Users\user\Documents\GitHub\Forks\EE\Einstein-Engines\Content.Server\Program.cs:line 9
which command should I use to run this check? |
it happens in any debug build. should be |
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.
Some very surface level stuff, will give a deeper review later but looks very cool 👍
offer-item-give-target = {$user} handed you a {THE($item)} | ||
|
||
offer-item-no-give = You stop offering {THE($item)} to {$target} | ||
offer-item-no-give-target = {$user} is no longer offer a {THE($item)} to you |
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.
offer-item-no-give-target = {$user} is no longer offer a {THE($item)} to you | |
offer-item-no-give-target = {$user} is no longer offer a {THE($item)} to you | |
Content.Shared/Alert/AlertType.cs
Outdated
@@ -52,7 +52,8 @@ public enum AlertType : byte | |||
SuitPower, | |||
BorgHealth, | |||
BorgCrit, | |||
BorgDead | |||
BorgDead, | |||
Offer |
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.
Offer | |
Offer, |
Always use trailing commas, so the diffs look better in the future
Resources/keybinds.yml
Outdated
@@ -255,6 +255,10 @@ binds: | |||
type: State | |||
key: V | |||
mod1: Shift | |||
- function: OfferItem | |||
type: State | |||
key: V |
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 don't know what a good bind would be, but Ctrl+V is wild
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.
now F, I hope it will be better this way.
Fixed it, I hope now for sure. |
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.
Very cool; need to do final test when I'm home regarding the exception but otherwise approved :)
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.
The code is pretty good, but I have a slight problem with the system, and it's one I think will be an issue with players. I actually completely intentionally loaded this system in a dev environment, without reading any documentation whatsoever on how to do it, and I was incapable of figuring out how to do the Give-Item action until I gave up and read the code. This was done by me to simulate a "New Player" discovering the system organically. I had assumed based on experience with this game that it would be a context-sensitive verb that appears in a right click menu.
The keyboard shortcut method works well, I just wish there were better ways of revealing to the player that a system such as this exists. In the future I would like to see a context-sensitive right click verb being implemented as an optional way to use this.
Description
This PR adds the ability to transfer objects from one player's hand to another player's hand, as in SS13.
I have little coding experience, so my solutions may not be ideal.
TODO
Media
https://youtu.be/zTQWTsYm1gw
Changelog
🆑