Sending additional commands when a card is discarded

I am working on a module where layers can be applied to a card from a deck. I would like all these layers removed automatically when the card is discarded. Can someone give some quick tips or point me at a module that implements this effectively?

By removed, I’m assuming you mean the layers should be reset.

If that’s the case, the Layer traits has a reset command (unless you’re having it follow an Expression). If it does have an option for a reset command, I would imagine you could use the same command you’re using to discard the card.

If you are right-clicking a card to discard it, then apply the Discard menu command to a Trigger Action and have it send a command to the Layers to reset and another command to discard it.

Perfect. That’s exactly what I needed to know.