-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow talk effects to be conditional #56083
Conversation
I understand what you are going for but I'm a little concerned about it being the default behavior. |
It's only for the effects listed, but my approach is probably a bit heavy handed and I can understand trimming this down, but I think these transactional effects should always fail at minimum:
I'm open to architectural changes to this, but I'm not sure how that would work. Any suggestions are welcome though. |
@Ramza13
|
One way is to add better conditions to prevent this happening, testing for if the player has enough cash for example, I know that's kinda clunky though and won't work for all of them. Of the things you changed most make sense, message is the one I'm most opposed to as that one in a lot of cases could be for things that could legitimately happen to an npc or monster with the message only for the player. |
Unfortunately conditions need to happen before the dialogue is shown. Anything using the trade window happens during an effect, hence the need for these changes. I can't think of a better way to deal with these, without some serious infrastructure re-work.
I considered this, but I think this is beyond my capability at this time. If you (or anyone else) is willing to help add that functionality, that would be welcome.
Seems reasonable. I'm not super familiar with the usage. I don't think it should ever actually fail from what I've looked at in code, but not being 100% confident, I can totally back out it there. |
Ok I will add that. |
@Ramza13 Have you had a chance to look at this yet? If not, I think I have all my other infrastructure work in a decent place, so I have some free time to re-work this PR if you could at least point me in the right direction. |
Bah I'm sorry, I've been working on the moving monsters/items mapgen stuff which is way harder than I thought and put this off. It should be a pretty simple thing, I'm gonna commit to working on it tomorrow or maybe tonight if I can. |
That's ok, I figured you were working on a bunch of things already and were just busy. I've found other stuff I can work on for the time being, but this will be an awesome improvement when its complete. (As will your other changes when you get those working). I certainly appreciate the assistance though, so keep up the great work! I've certainly hit a few of those "harder than you thought" tasks lately, especially getting into this infrastructure work. I'll keep this in draft for now, but I suspect your work will completely replace it. Feel free to reference or ignore it to your heart's content. |
Summary
Infrastructure "Allow talk effects to be conditional"
Purpose of change
Allow some effects to fail, such as
u_spend_cash
. This will cancel any future effects. Main goal is to prevent getting things for free from trading during dialogue.u_spend_cash
(and other conditional effects) firstPossible fix, but needs testing or updating: Rubiks 'help me install CBMs' option has some trade-based oddities #54211After investigating, this is out of scope for this issue.(Might fix other issues, but I can't find any right now even though I thought some existed for free trading or canceling trading)
Describe the solution
Make talk effects conditional and bail out if the condition fails.
Affects the following effects:
Describe alternatives you've considered
Testing
Tested as part of #55690.
Example:
If you don't spend the cash by canceling out of the trade window, none of the other effects occur now.
Additional context
None