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

Request Extra Reroll Options - Old/New Roll & Kept #17942

Closed
7H3LaughingMan opened this issue Jan 7, 2025 · 8 comments
Closed

Request Extra Reroll Options - Old/New Roll & Kept #17942

7H3LaughingMan opened this issue Jan 7, 2025 · 8 comments
Labels
wontfix This will not be worked on

Comments

@7H3LaughingMan
Copy link
Contributor

There doesn't appear to be an easy way to determine information about the discarded roll when re-rolling, before discarding the old roll completely would it be possible to add something like the below to the roll options to make it easier.

check:reroll:old:roll:5
check:reroll:new:roll:5
check:reroll:kept:new
@TMunsie
Copy link
Collaborator

TMunsie commented Jan 7, 2025

What is the use case or rules application? This seems entirely extraneous.

@7H3LaughingMan
Copy link
Contributor Author

It would be entirely for modules, I don't really think there is anything regarding rules that this would apply to. The main purpose is for modules to have a an easy way to know the old results and what was kept when a reroll happens. When you reroll a dice nothing is really kept around regarding the old roll if it keeps the new roll, or the new roll if it keeps the old roll nor does it provide information on what roll it decided to keep.

When the old chat message is deleted there is no indication as to why it's being deleted, after that the system recreates the chat message using whatever roll is kept. There is an indication that the new message was because of a reroll but you have no easy way from a module perspective on how the kept roll compared to the roll that was dropped. The pf2e.reroll hook just provides the rolls and there is no context to the rolls or a way to link the rolls to a specific chat message.

Since the roll options are just bits of string and is already being used to notate that a reroll happened or if a hero point was used, it would make sense to also store a bit of information about the reroll process there as well. It would be around 3-5 lines of extra code and would require no maintenance unless there was a major re-write to how rolls and rerolls are handled.

A lot of modules are listening to the preCreateChatMessage or createChatMessage hooks to see the results of a roll and doing something based on those results. For example prompting you to make a selection or applying an effect, they can see if a reroll happened but don't have an easy way to know if they need to undo something or not to do the same thing again so a reroll happens and they just do the same thing pretty much. So having a way for modules to know they need to do something else or that nothing really changed seem like a net benefit.

@TMunsie
Copy link
Collaborator

TMunsie commented Jan 7, 2025

I’ll leave it for a code lead to assess, but adding extra code to the system and adding more to the data model without a use case other than “maybe a module might use it some day” isn’t normally a priority or something that the leads would likely want to add. It’s some work for, at this point, literally nothing.

@7H3LaughingMan
Copy link
Contributor Author

I don't really think there is anything to add to the data model. Unless I am missing something getting the roll options from an ItemPF2e or an ActorPF2e returns a string[], so there is no model being enforced with them.

As for a use case, I am wanting to add this kind of functionality to PF2e Assistant so that it can undo anything it did when a reroll happens incase it needs to do something else. Or figured out that it doesn't need to do anything since the results of the roll didn't change.

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented Jan 8, 2025

I'm leaning against no. For your use case, I'm thinking storing the previous result in the message flags is probably a better solution.

Perhaps there might be a use case for an options based solution with some sort of remove after roll upgrade. I recall there being effects that are consumed when it would change the result. A solution that can handle that would probably be ideal, since what you're looking for would be a subset of that.

@7H3LaughingMan
Copy link
Contributor Author

Storing it in the message flags is fine as well, as long as there is a way to get the previous results easily than I am happy. Only reason I suggested roll options is because some stuff is getting added there for rerolls.

@stwlam
Copy link
Collaborator

stwlam commented Jan 9, 2025

Any reason the hooks aren't sufficient?

@7H3LaughingMan
Copy link
Contributor Author

The hooks provide no context about the rolls, nor a way to link them to what chat message is being re-rolled.

@stwlam stwlam added the wontfix This will not be worked on label Jan 18, 2025
@stwlam stwlam closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants