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

Multiple actions to one state #1234

Open
distantforest1 opened this issue Nov 23, 2022 · 4 comments
Open

Multiple actions to one state #1234

distantforest1 opened this issue Nov 23, 2022 · 4 comments

Comments

@distantforest1
Copy link

distantforest1 commented Nov 23, 2022

So what's the feature?
Would be great if I could have multiple actions lead to a single state. There are many cases where I would need this feature, here is one minimal example of one case:

Red 'Next' => Green;
Green 'Next' => Yellow;

Yellow 'Normal Attack' => Red;
Yellow 'Special Attack' => Red;
Yellow 'Defend' => Blue;

Is this related to a problem? If so, what?
It says that there is already a connection between the two.

Describe the solution you'd like
Having multiple actions from one state to another.

Describe alternatives you've considered
Creating multiple 'in-between' states for between each Attack. Not quite ideal, and doesn't cover all the cases I'm looking at.

Additional context as you see fit
I'm using the different "Attacks" as actions. Depending on which action it came from, it will deal more damage or less damage. For instance if the 'Normal Attack' was detected, it will do 1 damage, but if the 'Special Attack' action was detected it will do 2 damage.

@StoneCypher
Copy link
Owner

This comes up somewhat frequently (eg #531, 419, 352, 325, 31)

Fixing this requires a /lot/ of breaking api changes

I do intend to fix this but it basically drives a new major; it's deeply non-trivial

While you wait, you can get by with argument data if you aren't already using that for something else

@distantforest1
Copy link
Author

How do use the argument data? Is that with the newData parameter in the go/transition function?
MTL.go("Green", { test: "Hello world" });

@StoneCypher
Copy link
Owner

ya, that's correct

@StoneCypher
Copy link
Owner

relevant test cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants