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

Swappable player outfits #72347

Merged
merged 5 commits into from
May 13, 2024
Merged

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Mar 12, 2024

Summary

Features "The player can swap between defined outfits with the 'set of clothes' item"

Purpose of change

Many, many feature requests, though none that haven't been killed by stale bot.

Describe the solution

An item, "Set of clothes" with a new use action "CHANGE_OUTFIT"

Changing outfit works by 'a'ctivating the item. It happens instantly to the player's eyes (move costs to put on/take off are still subtracted), but code-wise it is pretty simple. First it spawns a new outfit, then goes over the player's clothes and puts them all into the new outfit's pocket. Once that's done, the activated outfit is iterated over and each contained item is worn by the player (or dropped if unwearable).

Describe alternatives you've considered

N/A this is the alternative

Testing

2024-03-12.17-28-37.mp4

Additional context

Minor known issues:
There is no way (AFAIK) to interrupt changing, so if you had a lot of huge bulky clothes and they took a while to put on, you could put yourself into a dangerous situation accidentally. Resolved by moving to an activity actor.

@mqrause
Copy link
Contributor

mqrause commented Mar 12, 2024

There is no way (AFAIK) to interrupt changing, so if you had a lot of huge bulky clothes and they took a while to put on, you could put yourself into a dangerous situation accidentally.

You can and should make this an activity that you assign in the iuse. Taking off and wearing a bunch of clothing/armor is far too long an action to be uninterruptible.

@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing labels Mar 12, 2024
@RenechCDDA RenechCDDA marked this pull request as draft March 12, 2024 22:35
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Mar 12, 2024
@carlarctg
Copy link
Contributor

I'd really love it if this was made a little less 'magical'. instead of the abstract item being visible and tangible, have it be craftable from a duffel bag, with maybe a lesser capacity makeshift and another primitive version.

@RenechCDDA
Copy link
Member Author

You can and should make this an activity that you assign in the iuse. Taking off and wearing a bunch of clothing/armor is far too long an action to be uninterruptible.

Do you have any recommendations for how to handle the case of an interruption? Currently if you just stopped in the middle you would be left with more clothes than previously existed and an extra outfit_storage, and there's no way for it to 'know' how to clean up. (The direct answer is 'tell it how to clean up' but I would prefer to avoid scenarios where this is possible at all.)

I guess I could properly iterate over the components and erase each one as it is taken out/delete it off your person as it is put in, but the current approach was a significant boon in terms of simplicity.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Mar 15, 2024
@I-am-Erk
Copy link
Member

I'd really love it if this was made a little less 'magical'. instead of the abstract item being visible and tangible, have it be craftable from a duffel bag, with maybe a lesser capacity makeshift and another primitive version.

except why would you need a duffel bag? An 'outfit' is an abstract concept, you can just point to a pile of unsorted clothes and say "the jeans, red t-shirt, and black hoodie are my outfit", it's not magical. The idea here is that your avatar is lumping these things together and remembering that they belong as one, but they don't have to be stuffed into the same bag for that.

@RenechCDDA
Copy link
Member Author

I'll get back to this once we're done with the 0.H push. The basic idea for implementing it as an activity is simple: At the start of the activity, get the movecost for taking off all your items and putting on all the new ones. Do not actually do that yet.. Set the movecost for the activity.

When activity finishes, instantly do all the wearing at once. Then, set moves to 0 (clearing your move debt). This allows the activity to be interruptible, but without having to deal with interrupting it in the middle, at least in the current iteration.

From the development discord, #development channel
https://discord.com/channels/598523535169945603/598535827169083403/1217988768196464783
image

Copy link
Contributor

github-actions bot commented May 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label May 2, 2024
@github-actions github-actions bot removed the stale Closed for lack of activity, but still valid. label May 12, 2024
@RenechCDDA RenechCDDA marked this pull request as ready for review May 12, 2024 03:28
@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label May 12, 2024
@RenechCDDA
Copy link
Member Author

image

Shoo, begone. I banish thee, stalebot.

@dseguin dseguin added (P5 - Long-term) Long-term WIP, may stay on the list for a while. and removed stale Closed for lack of activity, but still valid. labels May 12, 2024
@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label May 12, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 12, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 13, 2024
@I-am-Erk
Copy link
Member

Yay

@RenechCDDA
Copy link
Member Author

Yay

Basic build passed, quickly merge it before stalebot comes back!

@kevingranade kevingranade merged commit 81ede3c into CleverRaven:master May 13, 2024
22 of 27 checks passed
@RenechCDDA RenechCDDA deleted the fashion_on_the_go branch May 13, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions NPC / Factions NPCs, AI, Speech, Factions, Ownership (P5 - Long-term) Long-term WIP, may stay on the list for a while. stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants