It is currently 27 Apr 2024, 03:24
   
Text Size

How to make Cursecatcher?

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

How to make Cursecatcher?

Postby sumomole » 07 Oct 2011, 10:01

When the AI to play a spell, the game will be out, what is the reason?
Code: Select all
<ACTIVATED_ABILITY suppress_fizzle="1" auto_skip="1" zone="stack">
     <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice Cursecatcher: Counter target instant or sorcery spell unless its controller pays {1}.]]></LOCALISED_TEXT>
    <COST type="SacrificeSelf" />
    <TARGET_DETERMINATION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_INSTANT )
    filter:AddCardType( CARD_TYPE_SORCERY )
    filter:SetZone( ZONE_STACK )
    return TargetBadF()
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    ChooseTarget( "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if Object():GetTargetCard() ~= nil then
       MTG():ObjectDataChest():Set_CardPtr( 1, Object():GetTargetCard() )
      MTG():ObjectDataChest():Int_Set( 0, 1 )
    end
    </RESOLUTION_TIME_ACTION>
    <AI_BASE_SCORE score="900" zone="in_play" /> 
  </ACTIVATED_ABILITY>
  <TRIGGERED_ABILITY active_zone="any">
    <TRIGGER value="ABILITY_RESOLVED" simple_qualifier="self">
    if MTG():ObjectDataChest():Get_Int(0) == 1 then
    MTG():ObjectDataChest():Set_Int(0, 0)
    return true
    else
    return false
    end
    </TRIGGER>
    <COST type="mana" cost="{1}" qualifier="conditional" />
    <RESOLUTION_TIME_ACTION conditional="else">
    if MTG():ObjectDataChest():Get_CardPtr( 1 ) ~= nil then
      MTG():ObjectDataChest():Get_CardPtr( 1 ):CounterSpell()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: How to make Cursecatcher?

Postby nabeshin » 19 Oct 2011, 22:31

You think this piece of a code a joke of coders? (in old-dotp Cursecatcher)
Code: Select all
<EFFECT>
Object():Register_Player_Set( 0, Object():GetTargetCard():GetController() )
Object():Register_Object_Set( 0, Object():GetTargetCard() )
Object():SetController( Object():Register_Player_Get( 0 ) )
Object():Register_Set( 1, 2 )
</EFFECT
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 31 times

Re: How to make Cursecatcher?

Postby thefiremind » 24 Nov 2011, 17:49

I'm having a similar problem trying to code Spellstutter Sprite. If I play it while the stack is empty, nothing strange happens, but if I play it while something else is on the stack, the game crashes with a BEX error. I know that Spellstutter Sprite is available as a community card for old DotP (and Cursecatcher, too), but looking at how they were coded for old DotP doesn't help me.

This was the first implementation I tried:
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Spellstutter Sprite enters the battlefield, counter target spell with converted mana cost X or less, where X is the number of Faeries you control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
    <TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
    <TARGET_DETERMINATION>
    local total = 0
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddSubType( CREATURE_TYPE_FAERIE )
    filter:SetController( Object():GetController() )
    filter:NotTargetted()
    total = filter:Count()
    filter:Clear()
    filter:SetZone( ZONE_STACK )
    filter:SetStackObjectType( STACK_OBJECT_CARD )
    filter:SetConvertedCostMax( total )
    return TargetBadF()
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    ChooseTarget( "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if target ~= nil then
      Object():GetTargetCard():CounterSpell()
    end
    </RESOLUTION_TIME_ACTION>
    <AI_BASE_SCORE score="900" zone="hand" />
  </TRIGGERED_ABILITY>
Then I tried with a static ability that counts the number of Fairies continuously (as the old DotP card suggested), but the result was the same. I made other little changes, but the game kept crashing.

Has anybody been successful in making a DotP2012 card that counters a spell without being an Instant?
< 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: How to make Cursecatcher?

Postby nabeshin » 29 Nov 2011, 10:16

It occurs after a window of a choice of the target or to him?
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 31 times

Re: How to make Cursecatcher?

Postby thefiremind » 29 Nov 2011, 10:37

The game crashes as soon as the card is visually moved to the center of the field (trying to get on the stack), and only if there's something on the stack already.
< 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: How to make Cursecatcher?

Postby nabeshin » 29 Nov 2011, 10:47

thefiremind wrote:The game crashes as soon as the card is visually moved to the center of the field (trying to get on the stack), and only if there's something on the stack already.
erase "target determination" tag, an may be change res. time to playtime X 2
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 31 times


Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 22 guests


Who is online

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

Login Form