It is currently 10 May 2025, 18:52
   
Text Size

zone vs active_zone vs influencing_zone

Moderator: CCGHQ Admins

zone vs active_zone vs influencing_zone

Postby Eglin » 15 Mar 2012, 04:30

Howdy folks,

I'm having trouble with a few cards, and I suspect it's related to my failure to understand the difference between the zone specifiers. My triggers are either not getting picked handled or are getting handled at inappropriate times (blue flashing from cards in hand or in library). If I have a card that's supposed to do something while it's in hand (like change the casting cost) depending on something that happened on the battlefield, what zone keywords do I need to use? Is that zone="hand" and influencing_zone="in_play"?

On a related note, if I need to use an end-of-step trigger to reset a flag or something, is there any way to suppress the blue glow and sound effect? Can I just reset my flag inside of the trigger block and return false?

Thanks in advance,
Eglin
User avatar
Eglin
Programmer
 
Posts: 195
Joined: 01 Mar 2012, 14:44
Has thanked: 39 times
Been thanked: 22 times

Re: zone vs active_zone vs influencing_zone

Postby thefiremind » 15 Mar 2012, 09:47

Eglin wrote:I'm having trouble with a few cards, and I suspect it's related to my failure to understand the difference between the zone specifiers. My triggers are either not getting picked handled or are getting handled at inappropriate times (blue flashing from cards in hand or in library).
When I took a look into the executable's code, I got this information:
Code: Select all
STATIC_ABILITY
   tag
   commaspace
   zone
   layer
   influencing_zone
   simple_filter
   unlikely_to_attack
   immunity

SPELL_ABILITY
   tag
   commaspace
   zone
   layer
   internal
   simple_filter
   forced_skip
   suppress_fizzle

UTILITY_ABILITY
   tag
   commaspace

MANA_ABILITY
   tag
   commaspace
   unlikely_to_attack

TRIGGERED_ABILITY
   tag
   commaspace
   zone
   layer
   internal
   pre_trigger
   auto_skip
   dont_ask
   unlikely_to_attack
   forced_skip
   active_zone
   suppress_fizzle
   immunity

ACTIVATED_ABILITY
   tag
   commaspace
   zone
   layer
   sorcery_time
   during_your_turn
   during_opponents_turn
   upkeep
   combat
   non_combat
   per_turn_limit
   simple_filter
   immunity
   auto_skip
   firebreathing
   unlikely_to_attack
   forced_skip
   active_zone
   suppress_fizzle
   any_player
These are the ability types, and for each type, the attributes that can be used. As you can see, only the static abilities have influencing_zone, while the triggered and the activated ones have active_zone. Also note that all those 3 types have zone.
The names suggest that influencing_zone sets the zone in which the static ability will have effect, while active_zone sets the zone in which the card must be in order to make the ability active: in that zone, you'll be able to activate the ability if it's activated, or it will trigger if it's triggered. About the zone attribute, I haven't understood it clearly, so I can't tell you what it really means.
I still have problems deciding when I have to use those attributes, so I search for abilities that are similar to the one I'm coding.
By the way, searching for similar cards and looking at their code is a thing I really recommend, and I discovered a software that makes it easier. Try searching on Google for "depeche view": you provide a directory, and it opens all the files it contains, allowing you to search words inside them, and copy portions of text on clipboard. The commands are weird but they are designed to make everything faster once you get used to them.

Eglin wrote:If I have a card that's supposed to do something while it's in hand (like change the casting cost) depending on something that happened on the battlefield, what zone keywords do I need to use? Is that zone="hand" and influencing_zone="in_play"?
According to me, the influencing_zone should be hand, but as I said, I'm not really an expert about it, so I would try to find a similar card and then go on by trial and error until the ability works. #-o

Eglin wrote:On a related note, if I need to use an end-of-step trigger to reset a flag or something, is there any way to suppress the blue glow and sound effect? Can I just reset my flag inside of the trigger block and return false?
The blue glow and sound effect is suppressed by using internal="1". Note that you can't do everything while using this attribute, but if you just have to modify a flag, you can do it. As a rule of thumb, first test your abilities without declaring them as internal, then, if they work, you can try using internal. If the ability stops to work, you can substitute internal with forced_skip: you'll have the glow, but at least the card won't make you wait (and, more important, the ability will work again :lol:).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: zone vs active_zone vs influencing_zone

Postby Eglin » 15 Mar 2012, 19:20

thefiremind wrote:By the way, searching for similar cards and looking at their code is a thing I really recommend, and I discovered a software that makes it easier. Try searching on Google for "depeche view": you provide a directory, and it opens all the files it contains, allowing you to search words inside them, and copy portions of text on clipboard. The commands are weird but they are designed to make everything faster once you get used to them.
Thanks for the tip. In Win7, you can actually type "content:random_search_query" to search for content within files. Personally, I use a combination of egrep and sed - it's how I generated the wiki pages for the filters/triggers/many of the objects, etc. Even still, it's not always easy pickup on the patterns and synthesize an understanding.

thefiremind wrote:
Eglin wrote:If I have a card that's supposed to do something while it's in hand (like change the casting cost) depending on something that happened on the battlefield, what zone keywords do I need to use? Is that zone="hand" and influencing_zone="in_play"?
According to me, the influencing_zone should be hand, but as I said, I'm not really an expert about it, so I would try to find a similar card and then go on by trial and error until the ability works. #-o
Haha - I was asking for information in hopes that I could get away from trial and error. It's a pretty inefficient way to program.

thefiremind wrote:
Eglin wrote:On a related note, if I need to use an end-of-step trigger to reset a flag or something, is there any way to suppress the blue glow and sound effect? Can I just reset my flag inside of the trigger block and return false?
The blue glow and sound effect is suppressed by using internal="1". Note that you can't do everything while using this attribute, but if you just have to modify a flag, you can do it. As a rule of thumb, first test your abilities without declaring them as internal, then, if they work, you can try using internal. If the ability stops to work, you can substitute internal with forced_skip: you'll have the glow, but at least the card won't make you wait (and, more important, the ability will work again :lol:).
This, sir, is /awesome/. Thank you a million for teaching this to me.
User avatar
Eglin
Programmer
 
Posts: 195
Joined: 01 Mar 2012, 14:44
Has thanked: 39 times
Been thanked: 22 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 24 guests

Login Form