Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
DOTP2013 Dual Lands and Mana Selection Problems.
Moderator: CCGHQ Admins
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by --Dream-- » 11 Aug 2012, 12:58
Here's a problem I'm having with this API:
First turn - I play, say, a Forest.
Second turn - I play, say, Sunpetal Grove or Razorverge Thicket (the card doesnt get tapped). I have a card in my hand with mana cost or , and the game doesnt let me play it. Even if I click the non-basic land and press "activate ability", I still can't play the card I mentioned.
Is this a known issue?
First turn - I play, say, a Forest.
Second turn - I play, say, Sunpetal Grove or Razorverge Thicket (the card doesnt get tapped). I have a card in my hand with mana cost or , and the game doesnt let me play it. Even if I click the non-basic land and press "activate ability", I still can't play the card I mentioned.
Is this a known issue?
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by pcastellazzi » 11 Aug 2012, 17:31
When everything goes as expected both lands should produce until you activate the color switch ability. Can you please post your SCRIPT_LOG.TXT? Also are you using the implementations from 1111 core? (if not please post your code).--Dream-- wrote:Here's a problem I'm having with this API:
First turn - I play, say, a Forest.
Second turn - I play, say, Sunpetal Grove or Razorverge Thicket (the card doesnt get tapped). I have a card in my hand with mana cost or , and the game doesnt let me play it. Even if I click the non-basic land and press "activate ability", I still can't play the card I mentioned.
Is this a known issue?
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by pcastellazzi » 11 Aug 2012, 18:26
I tried with simple stuff like an utility ability and internal="1" and they did not work. An utility ability can not be activated as expected, and internal="1" does not make the trigger or the characteristic to be ignored. Until (i hope) DotP 2014 best thing we can do is document it. I added a section with this problems to the code documentation.RiiakShiNal wrote:I think this is an issue that just isn't going to go away at least not until we get proper mana abilities that don't need a work-around like this.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by pcastellazzi » 11 Aug 2012, 18:51
After looking at your code, you have some misconceptions about GrantAbility(). This function work in pair with resource_id="N" (N should be a positive integer). Resources 1 to 5 are used by the library, everything else you can use.Tyrany wrote:Hi, need some advice, i was trying to make a gemhide sliver based on your code and i'm facing some problems as the grant ability crap skips the activated ability and goes straight to the first mana ability, so maybe you can give me some advice on how to do this please
To make this work you need to assign a resource_id to the color selection ability, to the colour activation ability and to the trigger, then grant them all.
Something like (only relevant parts are shown):
- Code: Select all
<!-- sliver ability -->
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<FILTER>
return (
FilteredCard() ~= nil
and FilteredCard():GetZone() == ZONE_IN_PLAY
and FilteredCard():GetSubType():Test(CREATURE_TYPE_SLIVER) ~= 0
)
</FILTER>
<CONTINUOUS_ACTION layer="6">
if FilteredCard() ~= nil then
-- grant colour selection
FilteredCard():GetCurrentCharacteristics():GrantAbility(10)
-- grant mana ability activation
FilteredCard():GetCurrentCharacteristics():GrantAbility(20)
-- grant clean up trigger
FilteredCard():GetCurrentCharacteristics():GrantAbility(30)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<!-- colour selection -->
<ACTIVATED_ABILITY resource_id="10" filter_zone="ZONE_IN_PLAY"> ... </ACTIVATED_ABILITY
<!-- mana ability activation -->
<STATIC_ABILITY resource_id="20" internal="1" filter_zone="ZONE_IN_PLAY"> ... </STATIC_ABILITY>
<!-- clean up trigger -->
<TRIGGERED_ABILITY resource_id="30" internal="1" filter_zone="ZONE_IN_PLAY"> ... </TRIGGERED_ABILITY>
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by --Dream-- » 12 Aug 2012, 08:30
Yes, I'm using the implementations from 1111 core. So in this case, the game will see + instead of + or and will just skip the turn:pcastellazzi wrote:When everything goes as expected both lands should produce until you activate the color switch ability. Can you please post your SCRIPT_LOG.TXT? Also are you using the implementations from 1111 core? (if not please post your code).--Dream-- wrote:Here's a problem I'm having with this API:
First turn - I play, say, a Forest.
Second turn - I play, say, Sunpetal Grove or Razorverge Thicket (the card doesnt get tapped). I have a card in my hand with mana cost or , and the game doesnt let me play it. Even if I click the non-basic land and press "activate ability", I still can't play the card I mentioned.
Is this a known issue?
Starting hand: Forest + Doomed Traveler + other 5 cards with mana cost greater than 2
First turn: Forest is played
Second turn: Player draws and plays Sunpetal Grove.
The game wont allow the player to pause and activate the color switch ability.
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by thefiremind » 12 Aug 2012, 08:39
From what I understood, it's a problem similar to the one I had when I tried to code suspend: check the option to keep priority, so the main phases won't pass automatically.--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
< 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: 721 times
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by --Dream-- » 12 Aug 2012, 09:43
So we need something like priority="-1" on the ability that changes colour?thefiremind wrote:From what I understood, it's a problem similar to the one I had when I tried to code suspend: check the option to keep priority, so the main phases won't pass automatically.--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by thefiremind » 12 Aug 2012, 09:44
No, you can't do anything on the code, you have to go to the game options and check the option to keep priority.--Dream-- wrote:So we need something like priority="-1" on the ability that changes colour?thefiremind wrote:From what I understood, it's a problem similar to the one I had when I tried to code suspend: check the option to keep priority, so the main phases won't pass automatically.--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
< 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: 721 times
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by --Dream-- » 12 Aug 2012, 09:55
Oh right, that seems to be doing the trick.thefiremind wrote:No, you can't do anything on the code, you have to go to the game options and check the option to keep priority.
Re: DOTP2013 Dual Lands and Mana Selection Problems.
by pcastellazzi » 19 Sep 2012, 08:19
I rewrote the MultiLand hack. The new version allow the AI to use dual lands/multi lands. The demo DLC include two multi colored decks i made for testing. A GW pod and UB zombie. The AI seems to handle this new code better than i expected. If you have any problems/suggestions please post them here.
The code is in the usual place.
The code is in the usual place.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
25 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 12 guests