It is currently 08 Sep 2025, 19:54
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby Zambooo » 31 Jan 2015, 16:03

thank you again. I'll try them both today :) (Reap Intellect and Doubling Chant)

Edit: Reap Intellect works fine but I can't choose whether to exile the cards from the library and/or graveyard. According to the rules for this card I should be able to choose ("You can choose to leave cards with those names in the zone they are in. You don't have to exile them")
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Formal Request Thread

Postby Xander9009 » 01 Feb 2015, 07:23

Zambooo wrote:thank you again. I'll try them both today :) (Reap Intellect and Doubling Chant)

Edit: Reap Intellect works fine but I can't choose whether to exile the cards from the library and/or graveyard. According to the rules for this card I should be able to choose ("You can choose to leave cards with those names in the zone they are in. You don't have to exile them")
So, this is probably way more complicated than it needs to be. However, since what you were asking for was basically what took me so long to do for Doubling Chant, I just copied that code over, modified it a bit, and then tripled it to search graveyards and hands as well. I've tested it (but only once) and it seemed to work as expected (after a bit of tinkering to find which lines were misbehaving). There is one minor flaw: when you search the hand, it will ask which cards to exile including those that you originally targeted. Since you can target any number, this isn't too big of an issue and will only cause problems if they a) have more than 2 of a card in their hand and b) you want to leave them with exactly 1 (or exactly 2 if they have four in their hand). Any other time, you can either target none (and it will exile the one original target) or all (and it will obviously exile them all).
Reap Intellect | Open
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="REAP_INTELLECT_CW_368958" />
  <CARDNAME text="REAP_INTELLECT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Reap Intellect]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Fenaison d’intelligence]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cosechar el intelecto]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Intellekt ernten]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mietere Intelletto]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[知力の刈り取り]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[지능 수확]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Стяжание Интеллекта]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Reap Intellect]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[剥夺智识]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[剝奪智識]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="368958" />
  <ARTID value="CW368958" />
  <ARTIST name="Steven Belledin" />
  <CASTING_COST cost="{X}{2}{U}{B}" />
  <TYPE metaname="Sorcery" />
  <EXPANSION value="DGM" />
  <RARITY metaname="C" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Target opponent reveals his or her hand. You choose up to X nonland cards from it and exile them. For each card exiled this way, search that player’s graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[L’adversaire ciblé révèle sa main. Vous y choisissez jusqu’à X cartes non-terrain et vous les exilez. Pour chaque carte exilée de cette manière, cherchez dans le cimetière, la main et la bibliothèque de ce joueur n’importe quel nombre de cartes ayant le même nom que cette carte et exilez-les. Ce joueur mélange ensuite sa bibliothèque.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El oponente objetivo muestra su mano. Tú eliges de ahí hasta X cartas que no sean de tierra y las exilias. Por cada carta exiliada de esta manera, busca en el cementerio, mano y biblioteca de ese jugador cualquier cantidad de cartas con el mismo nombre que esa carta y exílialas. Luego ese jugador baraja su biblioteca.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ein Gegner deiner Wahl zeigt die Karten auf seiner Hand offen vor. Du bestimmst davon bis zu X Karten, die keine Länder sind, und schickst sie ins Exil. Durchsuche für jede auf diese Weise ins Exil geschickte Karte den Friedhof, die Hand und die Bibliothek dieses Spielers nach einer beliebigen Anzahl von Karten mit demselben Namen wie diese Karte und schicke sie alle ins Exil. Dieser Spieler mischt dann seine Bibliothek.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Un avversario bersaglio rivela la sua mano. Scegli fino a X carte non terra da essa ed esiliale. Per ogni carta esiliata in questo modo, passa in rassegna il cimitero, la mano e il grimorio di quel giocatore per un qualsiasi numero di carte con lo stesso nome di quella carta ed esiliale. Poi quel giocatore rimescola il suo grimorio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[対戦相手1人を対象とする。そのプレイヤーは自分の手札を公開する。あなたはその中から土地でないカードをX枚選び、それらのカードを追放する。これにより追放されたカード1枚につき、そのプレイヤーの墓地と手札とライブラリーから、そのカードと同じ名前を持つカードを望む枚数探し、それらを追放する。その後、そのプレイヤーは自分のライブラリーを切り直す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[상대 한 명을 목표로 정한다. 그 플레이어는 자신의 손을 공개한다. 당신은 그중에서 대지가 아닌 카드를 최대 X장까지 골라 추방한다. 이렇게 추방된 카드 한 장 마다 그 플레이어의 무덤, 손 및 서고를 뒤져 그 카드와 이름이 같은 카드를 원하는 만큼 찾아 추방한다. 그러고 나서 그 플레이어는 자신의 서고를 섞는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Целевой оппонент показывает свою руку. Вы выбираете из нее не более Х карт, не являющихся землями, и изгоняете их. Для каждой карты, изгнанной таким образом, найдите на кладбище, в руке и в библиотеке того игрока любое количество карт с таким же именем, как у нее, и изгоните их. Затем тот игрок тасует свою библиотеку.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Target opponent reveals his or her hand. You choose up to X nonland cards from it and exile them. For each card exiled this way, search that player’s graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[目标对手展示其手牌。你选择其中至多X张非地牌,并将它们放逐。从该牌手的坟墓场、手牌以及牌库中搜寻任意数量与以此法放逐的任一张牌同名的牌,并将它们放逐。然后该牌手将其牌库洗牌。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[目標對手展示其手牌。你選擇其中至多X張非地牌,並將它們放逐。從該玩家的墳墓場、手牌以及牌庫中搜尋任意數量與以此法放逐的任一張牌同名的牌,並將它們放逐。然後該玩家將其牌庫洗牌。]]></LOCALISED_TEXT>
      <SFX text="TARGET_PESTS_PLAY" />
      <TARGET tag="CARD_QUERY_CHOOSE_PLAYER_DISCARD_1" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
         local filter = ClearFilter()
         filter:SetFilterType( FILTER_TYPE_PLAYERS )
         filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
      </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         if target_player ~= nil then
            target_player:RevealHand()
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         if target_player ~= nil then
            local filter = ClearFilter()
            filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_LAND )
            filter:SetZone( ZONE_HAND, target_player )
            local FilterCount = filter:Count()
            local Count = GetEffectX()
            if Count &gt; FilterCount then
               Count = FilterCount
            end
            EffectController():SetItemCount(Count)
            for i=0, Count-1 do
               EffectController():SetItemPrompt(i, "CARD_QUERY_CHOOSE_CARD_TO_EXILE" )
            end
            EffectController():ChooseItems( EffectDC():Make_Chest(1), QUERY_FLAG_UP_TO + QUERY_FLAG_AI_COMPLEX )
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local TargetCards = EffectDC():Get_Chest(1)
         if TargetCards ~= nil then
            local Count = TargetCards:Count()
            EffectDC():Set_Int(2, Count)
            local CardChest = EffectDC():Make_Chest(3)
            for i=0, Count-1 do
               local Card = TargetCards:Get_CardPtr(i)
               if Card ~= nil then
                  local NewCard = true
                  for j=0, i-1 do
                     local PreviousCard = TargetCards:Get_CardPtr(j)
                     if PreviousCard ~= nil and PreviousCard:GetCardName() == Card:GetCardName() then
                        NewCard = false
                     end
                  end
                  if NewCard == true then
                     CardChest:Set_CardPtr(i, Card)
                  end
               end
            end
         end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION repeating="1">
         local n = MTG():GetActionRepCount()
         local Card = EffectDC():Get_Chest(3) and EffectDC():Get_Chest(3):Get_CardPtr(n)
         local Count = EffectDC():Get_Int(2)
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         local TargetChest = EffectDC():Get_Chest(4)
         if TargetChest == nil then
            TargetChest = EffectDC():Make_Chest(4)
            if TargetChest == nil then
               return true
            end
         end
         if Card ~= nil and target_player ~= nil then
            local filterCount = ClearFilter()
            filterCount:Add( FE_CARD_NAME, OP_IS, Card )
            filterCount:SetZone( ZONE_GRAVEYARD, target_player)
            local CardCount = filterCount:Count()
            EffectController():SetItemCount(CardCount)
            for i=0, CardCount-1 do
               EffectController():SetItemPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_EXILE" )
            end
            EffectController():ChooseItems(TargetChest:Make_Targets(n), QUERY_FLAG_UP_TO)
         end
         return n ~= Count
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION repeating="1">
         local n = MTG():GetActionRepCount()
         local Card = EffectDC():Get_Chest(3) and EffectDC():Get_Chest(3):Get_CardPtr(n)
         local Count = EffectDC():Get_Int(2)
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         local TargetChest = EffectDC():Get_Chest(5)
         if TargetChest == nil then
            TargetChest = EffectDC():Make_Chest(5)
            if TargetChest == nil then
               return true
            end
         end
         if Card ~= nil and target_player ~= nil then
            local filterCount = ClearFilter()
            filterCount:Add( FE_CARD_NAME, OP_IS, Card )
            filterCount:SetZone( ZONE_HAND, target_player)
            local CardCount = filterCount:Count()
            EffectController():SetItemCount(CardCount)
            for i=0, CardCount-1 do
               EffectController():SetItemPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_EXILE" )
            end
            EffectController():ChooseItems(TargetChest:Make_Targets(n), QUERY_FLAG_UP_TO)
         end
         return n ~= Count
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION repeating="1">
         local n = MTG():GetActionRepCount()
         local Card = EffectDC():Get_Chest(3) and EffectDC():Get_Chest(3):Get_CardPtr(n)
         local Count = EffectDC():Get_Int(2)
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         local TargetChest = EffectDC():Get_Chest(6)
         if TargetChest == nil then
            TargetChest = EffectDC():Make_Chest(6)
            if TargetChest == nil then
               return true
            end
         end
         if Card ~= nil and target_player ~= nil then
            local filterCount = ClearFilter()
            filterCount:Add( FE_CARD_NAME, OP_IS, Card )
            filterCount:SetZone( ZONE_LIBRARY, target_player)
            local CardCount = filterCount:Count()
            EffectController():SetItemCount(CardCount)
            for i=0, CardCount-1 do
               EffectController():SetItemPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_EXILE" )
            end
            EffectController():ChooseItems(TargetChest:Make_Targets(n), QUERY_FLAG_UP_TO)
         end
         return n ~= Count
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local TargetCards = EffectDC():Get_Chest(1)
         if TargetCards ~= nil then
            local Count = TargetCards:Count()
            for i=0, Count-1 do
               local Card = TargetCards:Get_CardPtr(i)
               if Card ~= nil then
                  Card:Exile()
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local Count = EffectDC():Get_Int(2)
         local TargetChest = EffectDC():Get_Chest(4)
         if TargetChest ~= nil then
            for i=0, Count-1 do
               local Targets = TargetChest:Get_Targets(i)
               if Targets ~= nil then
                  local TargetCount = Targets:Count()
                  if TargetCount &gt; 0 then
                     for j=0, TargetCount-1 do
                        local Target = Targets:Get_CardPtr(j)
                        if Target ~= nil then
                           Target:Exile()
                        end
                     end
                  end
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local Count = EffectDC():Get_Int(2)
         local TargetChest = EffectDC():Get_Chest(5)
         if TargetChest ~= nil then
            for i=0, Count-1 do
               local Targets = TargetChest:Get_Targets(i)
               if Targets ~= nil then
                  local TargetCount = Targets:Count()
                  if TargetCount &gt; 0 then
                     for j=0, TargetCount-1 do
                        local Target = Targets:Get_CardPtr(j)
                        if Target ~= nil then
                           Target:Exile()
                        end
                     end
                  end
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local Count = EffectDC():Get_Int(2)
         local TargetChest = EffectDC():Get_Chest(6)
         if TargetChest ~= nil then
            for i=0, Count-1 do
               local Targets = TargetChest:Get_Targets(i)
               if Targets ~= nil then
                  local TargetCount = Targets:Count()
                  if TargetCount &gt; 0 then
                     for j=0, TargetCount-1 do
                        local Target = Targets:Get_CardPtr(j)
                        if Target ~= nil then
                           Target:Exile()
                        end
                     end
                  end
               end
            end
         end
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
         if target_player ~= nil then
            target_player:ShuffleLibrary()
         end
      </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
   <AUTHOR><![CDATA[Xander9009]]></AUTHOR>
   <EDITORS><![CDATA[Xander9009, Xander9009]]></EDITORS>
   <DATE><![CDATA[26-01-15, 01-02-15]]></DATE>
</CARD_V2>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby Zambooo » 03 Feb 2015, 19:59

Hello again :D
I'd like to ask for Crush Underfoot this time. I made a version myself but it's not working (and it's probably a mess too :( )
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Formal Request Thread

Postby Xander9009 » 03 Feb 2015, 20:00

Zambooo wrote:Hello again :D
I'd like to ask for Crush Underfoot this time. I made a version myself but it's not working (and it's probably a mess too :( )
It's okay if it's a mess. Go ahead and post it so we can tell you what's wrong. Then you'll know how to fix it and how to do better next time. :)
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby Zambooo » 03 Feb 2015, 20:28

okay but you asked for it :P

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CRUSH_UNDERFOOT_283143384" />
  <CARDNAME text="CRUSH_UNDERFOOT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sous le pied]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aplastar con el pie]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstampfen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Calpestare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[踏み潰し]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Смерть под Пятой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sola Esmagadora]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="283143384" />
  <ARTID value="A283143384" />
  <ARTIST name="Steven Belledin" />
  <CASTING_COST cost="{1}{R}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tombe à cinq orteils
—Expression sangamie signifiant
« l’empreinte d’un géant »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tumba con cinco dedos
—Refrán kithkin que significa
“una huella de gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Grab mit fünf Zehen
—Kithkinausdruck für
„Fußabdruck eines Riesen”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tomba a cinque dita
—Frase kithkin che significa
“impronta di un gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[五つ爪先の墓穴
――キスキンの言葉で
「巨人の足跡」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пятипалая могила
— Выражение кискенов, означающее
“след ноги гиганта”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Túmulo de cinco dedos
— Frase kithkin que significa
“pegada de gigante”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Tribal" />
  <TYPE metaname="Instant" />
  <SUB_TYPE metaname="Giant" />
  <EXPANSION value="LRW" />
  <RARITY metaname="U" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez une créature Géant que vous contrôlez. Elle inflige un nombre de blessures égal à sa force à la créature ciblée.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige una criatura Gigante que controles. Esa criatura hace una cantidad de daño igual a su fuerza a la criatura objetivo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme eine Riesenkreatur, die du kontrollierst. Sie fügt einer Kreatur deiner Wahl Schadenspunkte in Höhe ihrer Stärke zu.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli una creatura Gigante che controlli. Infligge un danno pari alla propria forza a una creatura bersaglio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー1体を対象とする。あなたがコントロールする巨人・クリーチャーを1体選ぶ。 その巨人はそのクリーチャーに、自身のパワーに等しい点数のダメージを与える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите существо-Гиганта под вашим контролем. Оно наносит целевому существу количество повреждений, равное своей силе.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha uma criatura do tipo Gigante que você controla. Ela causa dano igual ao seu poder à criatura alvo.]]></LOCALISED_TEXT>
   <TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="0" compartment="0" count="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
   <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
   filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
   local chosen_giant = EffectDC():Get_Targets(1):Get_CardPtr(0)
   if chosen_giant ~= nil then
      local power = chosen_giant:GetCurrentPower()
      local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(1)
      if ( target_creature ~= nil ) then
         EffectSourceLKI():DealDamageTo( power, target_creature )
      end
   end
    </RESOLUTION_TIME_ACTION>
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
   
  </SPELL_ABILITY>
</CARD_V2>
PS: I also noted that the damage source is supposed to be the giant, not the Instant..
PPS: "Crush Underfoot doesn't target the Giant creature you control. You choose that Giant as Crush Underfoot resolves".. just another thing I can't code
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Formal Request Thread

Postby Xander9009 » 03 Feb 2015, 21:09

Zambooo wrote:okay but you asked for it :P

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CRUSH_UNDERFOOT_283143384" />
  <CARDNAME text="CRUSH_UNDERFOOT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sous le pied]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aplastar con el pie]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstampfen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Calpestare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[踏み潰し]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Смерть под Пятой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sola Esmagadora]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="283143384" />
  <ARTID value="A283143384" />
  <ARTIST name="Steven Belledin" />
  <CASTING_COST cost="{1}{R}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tombe à cinq orteils
—Expression sangamie signifiant
« l’empreinte d’un géant »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tumba con cinco dedos
—Refrán kithkin que significa
“una huella de gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Grab mit fünf Zehen
—Kithkinausdruck für
„Fußabdruck eines Riesen”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tomba a cinque dita
—Frase kithkin che significa
“impronta di un gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[五つ爪先の墓穴
――キスキンの言葉で
「巨人の足跡」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пятипалая могила
— Выражение кискенов, означающее
“след ноги гиганта”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Túmulo de cinco dedos
— Frase kithkin que significa
“pegada de gigante”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Tribal" />
  <TYPE metaname="Instant" />
  <SUB_TYPE metaname="Giant" />
  <EXPANSION value="LRW" />
  <RARITY metaname="U" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez une créature Géant que vous contrôlez. Elle inflige un nombre de blessures égal à sa force à la créature ciblée.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige una criatura Gigante que controles. Esa criatura hace una cantidad de daño igual a su fuerza a la criatura objetivo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme eine Riesenkreatur, die du kontrollierst. Sie fügt einer Kreatur deiner Wahl Schadenspunkte in Höhe ihrer Stärke zu.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli una creatura Gigante che controlli. Infligge un danno pari alla propria forza a una creatura bersaglio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー1体を対象とする。あなたがコントロールする巨人・クリーチャーを1体選ぶ。 その巨人はそのクリーチャーに、自身のパワーに等しい点数のダメージを与える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите существо-Гиганта под вашим контролем. Оно наносит целевому существу количество повреждений, равное своей силе.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha uma criatura do tipo Gigante que você controla. Ela causa dano igual ao seu poder à criatura alvo.]]></LOCALISED_TEXT>
   <TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="0" compartment="0" count="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
   <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
   filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(1) )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
   local chosen_giant = EffectDC():Get_Targets(1):Get_CardPtr(0)
   if chosen_giant ~= nil then
      local power = chosen_giant:GetCurrentPower()
      local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(1)
      if ( target_creature ~= nil ) then
         EffectSourceLKI():DealDamageTo( power, target_creature )
      end
   end
    </RESOLUTION_TIME_ACTION>
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
   
  </SPELL_ABILITY>
</CARD_V2>
PS: I also noted that the damage source is supposed to be the giant, not the Instant..
PPS: "Crush Underfoot doesn't target the Giant creature you control. You choose that Giant as Crush Underfoot resolves".. just another thing I can't code
It's not a mess, it's actually pretty well done.

To make the giant be the thing that deals the damage, you just need to read the "DealDamageTo()" function a bit more literally. You've got a variable with the giant, a variable with the target, and a function for dealing damage to. You want to have "giant deals X damage to target", so "chosen_giant:DealDamageTo( power, target_creature )". You just replace "EffectSourceLKI()" with what you want to actually deal the damage, your giant which you've stored in the variable "chosen_giant".

With that, it should work. <RESOLUTION_TIME_ACTION> blocks are run when the card resolves, so you happen to already have coded that bit the way it should be.

EDIT: Actually, I'm not certain that won't be considered targeting the giant. If it is, you should be able to change "Make_Targets" to "Make_Chest" and "Get_Targets" with "Get_Chest".
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby Zambooo » 03 Feb 2015, 22:01

still there must be something wrong.. I've now changed the damage source but when I cast the spell it does the following:
1- ask me to choose the creature I want to deal damage
2- the spell somehow "resolves"
3- it asks me to choose the Giant
4- the spell goes right into the graveyard, no damage assigned :(

note: it did this even when I had 'EffectSourceLKI()' instead of 'chosen_giant'
note2: it is supposed to ask me first the Giant and then the creature. will it be enough to move RESOLUTION_TIME_ACTION (where I select the Giant) before TARGET_DEFINITION?

edit: the code now is the following
| Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CRUSH_UNDERFOOT_283143384" />
  <CARDNAME text="CRUSH_UNDERFOOT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sous le pied]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aplastar con el pie]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstampfen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Calpestare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[踏み潰し]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Смерть под Пятой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sola Esmagadora]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="283143384" />
  <ARTID value="A283143384" />
  <ARTIST name="Steven Belledin" />
  <CASTING_COST cost="{1}{R}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tombe à cinq orteils
—Expression sangamie signifiant
« l’empreinte d’un géant »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tumba con cinco dedos
—Refrán kithkin que significa
“una huella de gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Grab mit fünf Zehen
—Kithkinausdruck für
„Fußabdruck eines Riesen”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tomba a cinque dita
—Frase kithkin che significa
“impronta di un gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[五つ爪先の墓穴
――キスキンの言葉で
「巨人の足跡」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пятипалая могила
— Выражение кискенов, означающее
“след ноги гиганта”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Túmulo de cinco dedos
— Frase kithkin que significa
“pegada de gigante”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Tribal" />
  <TYPE metaname="Instant" />
  <SUB_TYPE metaname="Giant" />
  <EXPANSION value="LRW" />
  <RARITY metaname="U" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez une créature Géant que vous contrôlez. Elle inflige un nombre de blessures égal à sa force à la créature ciblée.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige una criatura Gigante que controles. Esa criatura hace una cantidad de daño igual a su fuerza a la criatura objetivo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme eine Riesenkreatur, die du kontrollierst. Sie fügt einer Kreatur deiner Wahl Schadenspunkte in Höhe ihrer Stärke zu.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli una creatura Gigante che controlli. Infligge un danno pari alla propria forza a una creatura bersaglio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー1体を対象とする。あなたがコントロールする巨人・クリーチャーを1体選ぶ。 その巨人はそのクリーチャーに、自身のパワーに等しい点数のダメージを与える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите существо-Гиганта под вашим контролем. Оно наносит целевому существу количество повреждений, равное своей силе.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha uma criatura do tipo Gigante que você controla. Ela causa dano igual ao seu poder à criatura alvo.]]></LOCALISED_TEXT>
   <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
   filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
   <TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="0" compartment="0" count="1" />
   <TARGET_DEFINITION id="1">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
   local chosen_giant = EffectDC():Get_Targets(0):Get_CardPtr(0)
   if chosen_giant ~= nil then
      local power = chosen_giant:GetCurrentPower()
      local target_creature = EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target_creature ~= nil then
         chosen_giant:DealDamageTo( power, target_creature )
      end
   end
    </RESOLUTION_TIME_ACTION>
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
   
  </SPELL_ABILITY>
</CARD_V2>
and i got this in my SCRIPT_LOG
| Open
[lua] [string "CRUSH_UNDERFOOT_283143384_TITLE (RESOLUTION_TIME_ACTION)~0x000003c4"]:5: attempt to index a nil value
User avatar
Zambooo
 
Posts: 242
Joined: 01 Jul 2012, 21:33
Has thanked: 19 times
Been thanked: 17 times

Re: Formal Request Thread

Postby Xander9009 » 04 Feb 2015, 01:22

My bad. I only checked your target pointer for the giant, not for the target creature. You have
Code: Select all
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(1)
But that last 1 should be a zero. All of those (and MOST programming arrays and "chest" type things) start counting at zero. So, since there's only one target in that chest, the only valid card pointer is Get_CardPtr(0). Anything else will return nil. That shouldn't have given you an error log, though, because you check that the value isn't nil before working with it. Anyway, I changed that and tested it. It works. Change this back to having your prefix and it should work. I've put it in the Community Wad (for testing), so if you'd rather just grab it there, that works, too.

Crush Underfoot | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
   <FILENAME text="CRUSH_UNDERFOOT_CW_370446" />
   <CARDNAME text="CRUSH_UNDERFOOT" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sous le pied]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aplastar con el pie]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstampfen]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Calpestare]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[踏み潰し]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Смерть под Пятой]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sola Esmagadora]]></LOCALISED_TEXT>
   </TITLE>
   <MULTIVERSEID value="370446" />
   <ARTID value="CW370446" />
   <ARTIST name="Steven Belledin" />
   <CASTING_COST cost="{1}{R}" />
   <FLAVOURTEXT>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tombe à cinq orteils
—Expression sangamie signifiant
« l’empreinte d’un géant »]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tumba con cinco dedos
—Refrán kithkin que significa
“una huella de gigante”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Grab mit fünf Zehen
—Kithkinausdruck für
„Fußabdruck eines Riesen”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tomba a cinque dita
—Frase kithkin che significa
“impronta di un gigante”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[五つ爪先の墓穴
――キスキンの言葉で
「巨人の足跡」]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пятипалая могила
— Выражение кискенов, означающее
“след ноги гиганта”]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Túmulo de cinco dedos
— Frase kithkin que significa
“pegada de gigante”]]></LOCALISED_TEXT>
   </FLAVOURTEXT>
   <TYPE metaname="Tribal" />
   <TYPE metaname="Instant" />
   <SUB_TYPE metaname="Giant" />
   <EXPANSION value="LRW" />
   <RARITY metaname="U" />
   <SPELL_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez une créature Géant que vous contrôlez. Elle inflige un nombre de blessures égal à sa force à la créature ciblée.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige una criatura Gigante que controles. Esa criatura hace una cantidad de daño igual a su fuerza a la criatura objetivo.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme eine Riesenkreatur, die du kontrollierst. Sie fügt einer Kreatur deiner Wahl Schadenspunkte in Höhe ihrer Stärke zu.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli una creatura Gigante che controlli. Infligge un danno pari alla propria forza a una creatura bersaglio.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー1体を対象とする。あなたがコントロールする巨人・クリーチャーを1体選ぶ。 その巨人はそのクリーチャーに、自身のパワーに等しい点数のダメージを与える。]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите существо-Гиганта под вашим контролем. Оно наносит целевому существу количество повреждений, равное своей силе.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha uma criatura do tipo Gigante que você controla. Ela causa dano igual ao seu poder à criatura alvo.]]></LOCALISED_TEXT>
      <TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
         local filter = ClearFilter()
         filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
      </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
         local filter = ClearFilter()
         filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
         filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
         filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
         EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(1) )
      </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
         local chosen_giant = EffectDC():Get_Targets(1):Get_CardPtr(0)
         if chosen_giant ~= nil then
            local power = chosen_giant:GetCurrentPower()
            local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
            if ( target_creature ~= nil ) then
               EffectSourceLKI():DealDamageTo( power, target_creature )
            end
         end
      </RESOLUTION_TIME_ACTION>
      <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
   </SPELL_ABILITY>
   <AUTHOR><![CDATA[Zambooo]]></AUTHOR>
   <EDITORS><![CDATA[Zambooo]]></EDITORS>
   <DATE><![CDATA[03-02-14]]></DATE>
</CARD_V2>
EDIT: This was based on your original code. Riiak's post properly corrects your newer code.
Last edited by Xander9009 on 04 Feb 2015, 01:44, edited 1 time in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby RiiakShiNal » 04 Feb 2015, 01:36

Zambooo wrote:still there must be something wrong.. I've now changed the damage source but when I cast the spell it does the following:
1- ask me to choose the creature I want to deal damage
Targets are always chosen as the spell is cast. This prevents casting the spell without valid targets and allows other effects to work properly. It doesn't matter where you place the TARGET tag.

Zambooo wrote:2- the spell somehow "resolves"
So far so good.

Zambooo wrote:3- it asks me to choose the Giant
You have an issue here. The timing is correct as you are supposed to choose the giant at resolution time, but in your ChooseItem() call you have EffectDC():Make_Targets(0) though you have already used index 0 to store your target from step 1. So you are overwriting your damage target with the giant. You have 2 options you can either change the TARGET compartment to a different number or you can adjust your Make_Targets() call and subsequent gets for both. I would change the compartment since based on what you have that is the simplest change (since later you are already referring to the target as index 1).

Zambooo wrote:4- the spell goes right into the graveyard, no damage assigned :(

note: it did this even when I had 'EffectSourceLKI()' instead of 'chosen_giant'
See my note for step 3.

Zambooo wrote:note2: it is supposed to ask me first the Giant and then the creature. will it be enough to move RESOLUTION_TIME_ACTION (where I select the Giant) before TARGET_DEFINITION?
No, according to the card's text and MtG rules it should ask you for the target first then the giant later. TARGETs will always be processed before PLAY_TIME_ACTIONs and PLAY_TIME_ACTIONs will always be processed before RESOLUTION_TIME_ACTIONs so between the types the order in the card does not matter. Within a type (for example multiple RESOLUTION_TIME_ACTIONs) the order does matter as the one that is first will be processed first.

Zambooo wrote:and i got this in my SCRIPT_LOG
| Open
[lua] [string "CRUSH_UNDERFOOT_283143384_TITLE (RESOLUTION_TIME_ACTION)~0x000003c4"]:5: attempt to index a nil value
This was because you had never set index 1 to anything and thus Get_Targets(1) was nil but since you had Get_Targets(1):Get_CardPtr(0) that was essentially saying nil:Get_CardPtr(0) which generated the error.

Corrected Card | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="CRUSH_UNDERFOOT_283143384" />
  <CARDNAME text="CRUSH_UNDERFOOT" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sous le pied]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aplastar con el pie]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zerstampfen]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Calpestare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[踏み潰し]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Crush Underfoot]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Смерть под Пятой]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sola Esmagadora]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="283143384" />
  <ARTID value="A283143384" />
  <ARTIST name="Steven Belledin" />
  <CASTING_COST cost="{1}{R}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tombe à cinq orteils
—Expression sangamie signifiant
« l’empreinte d’un géant »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tumba con cinco dedos
—Refrán kithkin que significa
“una huella de gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Grab mit fünf Zehen
—Kithkinausdruck für
„Fußabdruck eines Riesen”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tomba a cinque dita
—Frase kithkin che significa
“impronta di un gigante”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[五つ爪先の墓穴
――キスキンの言葉で
「巨人の足跡」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Five-toed grave
—Kithkin phrase meaning
“a giant’s footprint”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пятипалая могила
— Выражение кискенов, означающее
“след ноги гиганта”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Túmulo de cinco dedos
— Frase kithkin que significa
“pegada de gigante”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Tribal" />
  <TYPE metaname="Instant" />
  <SUB_TYPE metaname="Giant" />
  <EXPANSION value="LRW" />
  <RARITY metaname="U" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choisissez une créature Géant que vous contrôlez. Elle inflige un nombre de blessures égal à sa force à la créature ciblée.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Elige una criatura Gigante que controles. Esa criatura hace una cantidad de daño igual a su fuerza a la criatura objetivo.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bestimme eine Riesenkreatur, die du kontrollierst. Sie fügt einer Kreatur deiner Wahl Schadenspunkte in Höhe ihrer Stärke zu.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scegli una creatura Gigante che controlli. Infligge un danno pari alla propria forza a una creatura bersaglio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャー1体を対象とする。あなたがコントロールする巨人・クリーチャーを1体選ぶ。 その巨人はそのクリーチャーに、自身のパワーに等しい点数のダメージを与える。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose a Giant creature you control. It deals damage equal to its power to target creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Выберите существо-Гиганта под вашим контролем. Оно наносит целевому существу количество повреждений, равное своей силе.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Escolha uma criatura do tipo Gigante que você controla. Ela causa dano igual ao seu poder à criatura alvo.]]></LOCALISED_TEXT>
   <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
   filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_GIANT )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    EffectController():ChooseItem( "CARD_QUERY_CHOOSE_GIANT", EffectDC():Make_Targets(0) )
    </RESOLUTION_TIME_ACTION>
   <TARGET tag="CARD_QUERY_CHOOSE_DEAL_DAMAGE" definition="1" compartment="0" count="1" />
   <TARGET_DEFINITION id="1">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
   local chosen_giant = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
   if chosen_giant ~= nil then
      local power = chosen_giant:GetCurrentPower()
      local target_creature = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
      if target_creature ~= nil then
         chosen_giant:DealDamageTo( power, target_creature )
      end
   end
    </RESOLUTION_TIME_ACTION>
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
   
  </SPELL_ABILITY>
</CARD_V2>
Minor changes to your code:
  • Changed the compartment of your TARGET to 1 to indicate that you want to put it into index 1.
  • Changed your calls to EffectDC():Get_Targets(x):Get_CardPtr(0) to EffectDC():Get_Targets(x) and EffectDC():Get_Targets(x):Get_CardPtr(0) which is a shortcut for first checking that Get_Targets(x) is not nil before trying to Get_CardPtr(0).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby Xander9009 » 04 Feb 2015, 01:49

Oh. I went by the original script posted, which didn't have that chest index mismatch. The giant was put into target chest 1. That explains why I didn't see where the nil value came from; because the code I was looking at didn't produce the nil value. The "Make_Targets(1)" was changed to "Make_Targets(0)" even though that wasn't needed.

Also, Riiak, I've actually wondered about the last bit you posted. I've known what it was for, but why does it work? It seems to me that
Code: Select all
something = EffectDC():Get_Targets(x) and EffectDC():Get_Targets(x):Get_CardPtr(0)
should be processed roughly as
Code: Select all
something = EffectDC():Get_Targets(x)
something = EffectDC():Get_Targets(x):Get_CardPtr(0)
So the result would still be trying to index a nil value. Obviously, it works. I'm just not sure why. If you don't know or don't care to explain, I'm alright with just knowing it does work. It's just something I was curious about awhile back. Is it just hardcoded in either DotP or Lua for that particular syntax? That's the only way I can make sense of it.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby RiiakShiNal » 04 Feb 2015, 02:09

It works due to logical short-circuiting so this:
Code: Select all
something = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
more closely translates to:
Code: Select all
something = EffectDC():Get_Targets(0)
if (something ~= nil) then
  something = EffectDC():Get_Targets(0):Get_CardPtr(0)
end
The reasoning is that if you have 2 boolean conditions separated by an and then both must be true for the whole expression to be true. Lua allows for short-circuiting the code by running the first condition and if that is false then it doesn't even bother to try the second condition. Since this is done in an assignment statement it first gets the value of the first expression and if that is nil then it is false and doesn't evaluate the second expression. If the first is not nil then it is true and thus must evaluate the second expression. If the second expression gets evaluated then that final value gets assigned to the variable.

Thus this can be expanded to multiple expressions as well like:
Code: Select all
something = EffectDC() and EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Formal Request Thread

Postby Xander9009 » 04 Feb 2015, 02:23

See, I know about the short-circuiting (I'm pretty sure I asked you a long time ago if lua would short circuit 'cause I wanted to be lazy, and you said yeah). I'd thought of that kind of explanation, but that didn't really click. I figured if it was because the first bit was returning false when nil, then it should return false in place of nil elsewhere, so I decided short-circuiting must not be the solution. However, with the confirmation that that's how it's done, I realize that it does in fact make sense. Thanks.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby G36cBossMan » 04 Feb 2015, 03:38

I would like to request sets m10-m13
G36cBossMan
 
Posts: 21
Joined: 21 Mar 2014, 03:34
Has thanked: 0 time
Been thanked: 0 time

Re: Formal Request Thread

Postby Xander9009 » 04 Feb 2015, 04:50

G36cBossMan wrote:I would like to request sets m10-m13
I don't recall a request like this ever being filled, and I've been here since pretty early on with 2014. The only people I find even remotely likely to fill it would be me, Neo, and Tejahn. Neo's been gone for about 2 months, I'm not about to add 4 entire main blocks to my plate, and I doubt Tejahn would want to either. You should request specific cards. Heck, request every card, but over time, each time only requesting the ones your interested in at the moment. Also, before you request a card, please make sure it's not already available. Easiest way to see if it's available, check the Community Wad. Note that the card list is only mostly complete. I've added about 20 cards today. For a complete list, check this link and just search for the card. If it's not there, there's still a small chance it's been done, but there are only 5 authors I know of whose cards aren't in there.

If that link doesn't work, try this one and click Open in Drive.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: Formal Request Thread

Postby RiiakShiNal » 04 Feb 2015, 11:19

I have never seen a set request filled and I've been on the forums since DotP 2010.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 16 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 16 guests

Login Form