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

On triggers #176

Closed
TheRamenChef opened this Issue Oct 1, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@TheRamenChef
Copy link
Collaborator

TheRamenChef commented Oct 1, 2018

It's kind of strange how a trigger can activate itself, and inconvenient when I want to set up a one-time collision trigger. It would also help to be able to override the activate method more easily to add more functionality.

@steffen-wilke

This comment has been minimized.

Copy link
Collaborator

steffen-wilke commented Oct 1, 2018

I don't fully understand the problem/request here. Could you please describe it in more detail?

Have you tried to use the Trigger.isOneTime flag combined with TriggerActivation.COLLISION?

The logic for activating a Trigger is currently implemented in its update() method. If you want to further specify who can activate the Trigger, you could provide activators which would tell the trigger which entities can activate it. Another option would be to add a TriggerActivatingCondition which is essentially just a simple check against a provided TriggerEvent that controls whether the Trigger can be activated by this event.

It would also help to be able to override the activate method more easily to add more functionality.

Are we speaking about a custom Trigger implementation that behaves somewhat different from the "normal" Trigger implementation? What functionality exactly are we talking about here?

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

TheRamenChef commented Oct 1, 2018

Have you tried to use the Trigger.isOneTime flag combined with TriggerActivation.COLLISION?

That is exactly what I'm doing.

If you want to further specify who can activate the Trigger, you could provide activators which would tell the trigger which entities can activate it.

That would only be feasible if you wanted specific entities to activate it.

I tried a TriggerActivatingCondition, and that unfortunately doesn't work, because the trigger is consumed before the condition is checked. A TriggerEvent is not fired, but the trigger can never be activated again.

Regarding the custom implementation, I'm talking about a lot of potential extensions, for example, adding more activation methods, a shorthand for a TriggerActivatingCondition or TriggerListener, or making the trigger IRenderable.

@steffen-wilke steffen-wilke added bug feature and removed question labels Oct 1, 2018

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