Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Add support for event triggers#43

Open
mzlarsson wants to merge 4 commits intomasterfrom
add-event
Open

Add support for event triggers#43
mzlarsson wants to merge 4 commits intomasterfrom
add-event

Conversation

@mzlarsson
Copy link
Copy Markdown
Contributor

Sidenote: The new referenced sound effect gold.wav is uploaded to drive in Teknik-folder. Could be moved to Färdiga filer once we get apprroval it is a nice sounds. I still haven't decided.

@AntonNeld
Copy link
Copy Markdown
Member

This introduces a layer of complexity. Could the same thing be accomplished by allowing action templates to define multiple actions, and refer to other action templates (with some max depth to crash on circular references)?

Then playing a sound when acquiring an item (for example) would mean a single extra line wherever that action is defined. But I think that's worth it to keep it simple and declarative. If we need to skip the sound in one place, it also becomes easier.

@mzlarsson
Copy link
Copy Markdown
Contributor Author

This introduces a layer of complexity. Could the same thing be accomplished by allowing action templates to define multiple actions, and refer to other action templates (with some max depth to crash on circular references)?

Then playing a sound when acquiring an item (for example) would mean a single extra line wherever that action is defined. But I think that's worth it to keep it simple and declarative. If we need to skip the sound in one place, it also becomes easier.

I agree about the issue of complexity, but it also makes the feature more powerful. When using explicit events we get a behaviour based on what happens and not what SHOULD happen. E.g. if you try to buy an item but you do not have the money for it, no sound will play. Also, you get the benefit on having events that are not connected to actions, e.g. when a video has stopped since it reached the end.

When it comes to declarativeness, I also agree. This PR works well for global things but is not as good in non-global situations. I'm considering the possibility to also be able to declare an event trigger locally on a node to get it closer to its context for non-global situations.

Lastly I'm thinking that we might want some inverse option as well. So you can specify to trigger on an event whenever a specific parameter IS NOT certain value(s).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants