It is currently 18 Apr 2024, 15:08
   
Text Size

DOTP2013 Dual Lands and Mana Selection Problems.

Moderator: CCGHQ Admins

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby --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 {W} {G} or {1} {W}, 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?
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby pcastellazzi » 11 Aug 2012, 17:31

--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 {W} {G} or {1} {W}, 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?
When everything goes as expected both lands should produce {G} 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).
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.
User avatar
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.

Postby pcastellazzi » 11 Aug 2012, 18:26

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.
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.
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.
User avatar
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.

Postby pcastellazzi » 11 Aug 2012, 18:51

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
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.

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.
User avatar
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.

Postby --Dream-- » 12 Aug 2012, 08:30

pcastellazzi wrote:
--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 {W} {G} or {1} {W}, 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?
When everything goes as expected both lands should produce {G} 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).
Yes, I'm using the implementations from 1111 core. So in this case, the game will see {G} + {G} instead of {G} + {G} or {W} and will just skip the turn:

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.
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby thefiremind » 12 Aug 2012, 08:39

--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
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.
< 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: 721 times

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby --Dream-- » 12 Aug 2012, 09:43

thefiremind wrote:
--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
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.
So we need something like priority="-1" on the ability that changes colour?
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby thefiremind » 12 Aug 2012, 09:44

--Dream-- wrote:
thefiremind wrote:
--Dream-- wrote:The game wont allow the player to pause and activate the color switch ability.
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.
So we need something like priority="-1" on the ability that changes colour?
No, you can't do anything on the code, you have to go to the game options and check the option to keep priority.
< 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: 721 times

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby --Dream-- » 12 Aug 2012, 09:55

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.
Oh right, that seems to be doing the trick.
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: DOTP2013 Dual Lands and Mana Selection Problems.

Postby 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 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.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Previous

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 12 guests


Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 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 12 guests

Login Form