Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



zone vs active_zone vs influencing_zone
Moderator: CCGHQ Admins
zone vs active_zone vs influencing_zone
by 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
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
Re: zone vs active_zone vs influencing_zone
by thefiremind » 15 Mar 2012, 09:47
When I took a look into the executable's code, I got this information: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).
- 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
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.
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.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"?

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 againEglin 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?

< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
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
by Eglin » 15 Mar 2012, 19:20
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: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.
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: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.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"?
This, sir, is /awesome/. Thank you a million for teaching this to me.thefiremind wrote: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 againEglin 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?).
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests