|
Post by SALARD on Jan 15, 2019 22:12:41 GMT
Hi I created a secret system which adds a reaction
for instance whenthiscreatureisattacked is a trigger - i add reaction before the the apply attack damage and i notice that the attack damage apply reaction is carried out before the trigger reaction. Does this have anything to do with the reactions when they are performed like a queue or are they performed right when the addreaction is carried out (which does not seem to be the case)
thank you
|
|
|
Post by Admin on Jan 16, 2019 14:44:35 GMT
The action system is rather complex, so it might be in your benefit to read the lesson on it again to make sure you understand each of its features: theliquidfire.com/2017/09/11/make-a-ccg-action-system/But I'll try to summarize and see if it helps: 1. Every change to the game is considered an action 2. Reactions to actions can occur before or after other actions 3. The action system applies actions and reactions in a depth-first order This means that you need to think carefully about which action you want your secret to observe as well as which phase of the action you want it to react to. If I had a secret which read "before this creature is attacked", then I would expect a reaction secret to observe the prepare phase of an attack action. If I had a secret that read "after this creature is attacked", then I would expect a reaction secret to observe the perform phase of an attack action. You may also need to review the action viewer stuff and see how key frames play a role in when stuff is applied. Hope that helps!
|
|
|
Post by tst on May 13, 2020 23:17:21 GMT
I hope everyone is safe and well. Like most, I have some free time so I've been looking at this. I am wondering, would a trigger be meant to observe a GameAction in the same way that we observe them elsewhere? I ask because while most seem like they would work, DamageAction and DrawCardsAction would only fire "once" even though they could damage multiple targets or draw multiple cards. So if I was observing for "Draw a card" and n cards are drawn, I would only ever observe that one action instead of n. Would I instead fire say, a new event for "Card Drawn" and observe that instead? Or am I missing the point here. Thanks
|
|
|
Post by Admin on May 14, 2020 16:56:31 GMT
A lot of your questions are really coming down to design decisions. For example, the difference between DrawCardsAction sending one event vs multiple events, is that the one action contains within it the number of cards that were drawn, therefore posting an event once per drawn card was not needed. Likewise the damage action contains within it the list of targets for it to apply to. Any triggered reaction to these events could simply be constructed to "understand" what it is responding to. Does that help?
|
|
|
Post by tst on May 14, 2020 17:33:00 GMT
Right, so I imagine I would be posting new actions as added reactions if (from a design position) that is what I wanted to do for each card drawn or each target damaged. I guess my question was if I should be observing GameActions as for my triggers at all since some were as granular as the other GameActions but what you're saying makes sense to me now (rather than creating some other structure to observe). Thank you!
|
|