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

Leashes #120

Merged
merged 14 commits into from
Aug 23, 2024
Merged

Leashes #120

merged 14 commits into from
Aug 23, 2024

Conversation

Mnemotechnician
Copy link
Contributor

Description

This PR adds leashes and the necessary logic for them.

Leash normally is an item craftable in the autolathe from some cloth, steel, and plastic. In order to attach the leash, you need an entity with a LeashAnchor or a clothing that has a LeashAnchor. An example of the former is most animals and all station pets - you can leash them without any tools. An example of the latter is all collars - in order to attach a leash to them, you need to open the strip menu and right-click the anchor item while holding a leash. The leash can be detached by right-clicking the person to whom it's attached. If it's attached via clothing, the respective clothing cannot be removed until the leash is removed (otherwise you get weird behavior).

There are still some bugs, e.g. you can pick up a leashed person, and then the leash joint will stop working until they're put back down, but they should be minor enough (the leash will automatically break if the person manages to get too far away, or moves to a different map via ftl or otherwise, or gets deleted, etc).

Note

If someone has a better icon sprite, or wants to create inhand sprites, I'll gladly accept those. The current icon is more of a placeholder, since I'm by no means an artist.

Media

image

8mb.video-M0T-S3JYeI3T.mp4

Changelog

🆑

  • add: A new leash item has been added to autolathe to help you keep your animals and station pets in check. If the station pet in question has hands and can speak, the leash can be attached to their collar via strip menu.

@github-actions github-actions bot added Status: Needs Review Someone please review this Status: Merge Conflict FIX YOUR PR AAAGH labels Aug 19, 2024
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: Sprite Changes any png or json in an RSI Changes: YML Changes any yml files labels Aug 19, 2024
Copy link
Contributor

github-actions bot commented Aug 19, 2024

RSI Diff Bot; head commit 984a93c merging into 83162d5
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/Floof/Objects/Tools/leash-rope.rsi

State Old New Status
rope Added

Resources/Textures/Floof/Objects/Tools/leash.rsi

State Old New Status
icon Added

Edit: diff updated after 984a93c

@github-actions github-actions bot removed the Status: Merge Conflict FIX YOUR PR AAAGH label Aug 19, 2024
@FoxxoTrystan FoxxoTrystan added the Priority: 2-Medium Needs to be resolved at some point label Aug 19, 2024
Copy link
Collaborator

@FoxxoTrystan FoxxoTrystan left a comment

Choose a reason for hiding this comment

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

All looks gud.
Request some suggestions for event and you should look in Floof ENT/Mobs so you can also collar the scug.

Afterall, good job lad!

@Mnemotechnician
Copy link
Contributor Author

you should look in Floof ENT/Mobs so you can also collar the scug.

Pretty sure I added LeashAnchor to scugs along with other animals. Those don't need any special clothing to be leashed (otherwise it'd be painful to use a leash on animals because collars are not easily accessible outside of loadouts).

@Mnemotechnician
Copy link
Contributor Author

Nevermind, now I did.

@0x6273
Copy link
Contributor

0x6273 commented Aug 20, 2024

Found a bug:

  • Leash a mob.
  • Put the leash item in your bag.
  • Unequip the bag and drop it on the ground.
  • Visually, the leash is connected to the bag on the ground, but moving around still pulls the mob.
  • Control Mob the mob that's leashed and move around and it causes the person that had the leash to move around, even tho it's in a bag that's on the ground.

image
Here the leash is attached to the bag visually, but the urist and the harpy are still connected and pull eachother.

Copy link
Collaborator

@Memeji Memeji left a comment

Choose a reason for hiding this comment

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

Absolutely loving the progress so far!
Only request I have, is to make the behavior of the person being pulled to look more seamlessly. Instead of them locking to a tile, if possible.
Besides that, looks great!

@Mnemotechnician
Copy link
Contributor Author

Found a bug: <...>

This is really odd... The bug only happens when you put the leash into an equipped bag and take it off afterwards. This seems like an engine issue; I'll try to recreate the joint whenever the leash gets re-parented...

@Mnemotechnician
Copy link
Contributor Author

Yea no, I cannot fix that. This is an issue with the physics engine, which is out of my scope... However, the leash will still break if the leash entity and the leashed entity get too far away from each other, which compensates it for a bit... If you can suggest a solution, besides simply disallowing putting leashes into storages (note that they work correctly so long as said storage is not equipped clothing), I can apply it.

@FoxxoTrystan FoxxoTrystan merged commit a850f03 into Fansana:master Aug 23, 2024
14 checks passed
Floof-Station-Bot added a commit that referenced this pull request Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: Sprite Changes any png or json in an RSI Changes: YML Changes any yml files Priority: 2-Medium Needs to be resolved at some point Status: Needs Review Someone please review this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants