It is currently 27 Apr 2024, 22:17
   
Text Size

Frenzied Goblin & Dauntless Onslaught

Moderator: CCGHQ Admins

Frenzied Goblin & Dauntless Onslaught

Postby Chakan » 25 Aug 2014, 23:08

I'm back again with more problems, shocker I know. The first card I'm having problems with is Frenzied Goblin. That cards ability is if you attack, you can spend 1 red mana to make a creature not be able to block for the turn. I've got it to a point where you can make a creature unable to block, but it doesn't cost anything and it doesn't prompt you if you want to do it, it should be a may ability. Here's what I have for that.

Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
 <TRIGGER value="ATTACKING" simple_qualifier="self" />
   <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
      if player:CanPayResourceCost(1) then
          player:BeginNewMultipleChoice()
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
         player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
      end
    end
  </RESOLUTION_TIME_ACTION>
  <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local result = player:GetMultipleChoiceResult()
       if result ~= nil then
    if result == 0 then
      if player:CanPayResourceCost(1) then
         player:PayResourceCost(1)
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <CONTINUOUS_ACTION layer="6">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
   <UTILITY_ABILITY resource_id="1">
      <COST mana_cost="{R}" type="Mana" />
   </UTILITY_ABILITY>
For the other card, Dauntless Onslaught, it allows you to give +2/+2 to up to two creatures, but if you select two creatures, only one of them seems to get the +2/+2, nothing happens with the other one. I thought this card would've been simple, but I was wrong. Between both of these cards, I've been working on them mostly all day. Here's what I have for this one.

Code: Select all
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Up to two target creatures each get +2/+2 until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Jusqu’à deux créatures ciblées gagnent chacune +2/+2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Hasta dos criaturas objetivo obtienen +2/+2 cada una hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bis zu zwei Kreaturen deiner Wahl erhalten +2/+2 bis zum Ende des Zuges.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Fino a due creature bersaglio prendono +2/+2 fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[クリーチャーを最大2体まで対象とする。それらはターン終了時までそれぞれ+2/+2の修整を受ける。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[생물을 최대 두 개까지 목표로 정한다. 그 생물들은 턴종료까지 각각 +2/+2를 받는다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Не более двух целевых существ получают по +2/+2 до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Até duas criaturas alvo recebem +2/+2 cada uma até o final do turno.]]></LOCALISED_TEXT>
   <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_GET_2_2" definition="0" compartment="0" count="2" up_to="1" />
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
      <CONTINUOUS_ACTION layer="7C">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Power_Add( 2 )
       characteristics:Toughness_Add( 2 )
    end
    </CONTINUOUS_ACTION>
      <DURATION simple_duration="UntilEOT" />
      <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ALLIED_ONLY" />
   </SPELL_ABILITY>
I'm so sorry for begging for help all the time, I've done over 70 cards on my own that work as intended, but I just have some cards that just screw with me so bad and I know I can't fix them on my own, especially when I work for over 6+ hours on them and have mostly nothing to show for it besides a faulty code. I'd gladly appreciate any help anyone can provide me here. Thanks for taking the time to read through this.
User avatar
Chakan
 
Posts: 166
Joined: 07 Jun 2014, 23:08
Has thanked: 11 times
Been thanked: 10 times

Re: Frenzied Goblin & Dauntless Onslaught

Postby sweetLu » 25 Aug 2014, 23:17

For the Frenzied Goblin you are missing some stuff in the 2nd RTA. You'll need to add some "end"s for each if statement and you will have to close out the RTA with </RESOLUTION_TIME_ACTION>.


In Dauntless Onslaught is only giving one creature +2/+2 because you are not doing anything with the 2nd target in the continuous action. You give +2/+2 to the target stored in EffectDC():Get_Targets(0):Get_CardPtr(0). You will need to do the same with the target stored in EffectDC():Get_Targets(0):Get_CardPtr(1).


Try those fixes and let us know if it works. Don't feel bad for asking for help. We all were there at one point in time.
sweetLu
 
Posts: 181
Joined: 16 Jul 2014, 01:24
Has thanked: 21 times
Been thanked: 22 times

Re: Frenzied Goblin & Dauntless Onslaught

Postby thefiremind » 25 Aug 2014, 23:23

Frenzied Goblin: on the second RESOLUTION_TIME_ACTION, you have lots of "if" but none of them has its "end". This is a syntax error and should be reported on SCRIPT_LOG.TXT (inside the directory where DotP is installed) if you look at it after using the card, I recommend to do that when a card doesn't work because it will often point you in the right direction for spotting the bug.

Dauntless Onslaught: only one gets the buff because you are giving the buff to only one. :) EffectDC():Get_Targets(0):Get_CardPtr(0) contains the first card, while the second will be in EffectDC():Get_Targets(0):Get_CardPtr(1). The correct way to do this is to loop through the pointers inside the target chest and give the bonus to all of them (in this case you know there are two at most, so you'll just loop from 0 to 1).
Code: Select all
    <CONTINUOUS_ACTION layer="7C">
    local targetDC = EffectDC():Get_Targets(0)
    if targetDC ~= nil then
       for i=0,1 do
          local target = targetDC:Get_CardPtr(i)
          if target ~= nil then
             local characteristics = target:GetCurrentCharacteristics()
             characteristics:Power_Add( 2 )
             characteristics:Toughness_Add( 2 )
          end
       end
    end
    </CONTINUOUS_ACTION>
SweetLu beat me to it while I was writing, but I'm posting anyway since there's a bit of extra info. :wink:
< 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: Frenzied Goblin & Dauntless Onslaught

Postby NeoAnderson » 26 Aug 2014, 00:08

Chakan wrote:I'm back again with more problems, shocker I know. The first card I'm having problems with is Frenzied Goblin. That cards ability is if you attack, you can spend 1 red mana to make a creature not be able to block for the turn. I've got it to a point where you can make a creature unable to block, but it doesn't cost anything and it doesn't prompt you if you want to do it, it should be a may ability. Here's what I have for that.

TRIGGER NOT WORKING | Open
Code: Select all
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
 <TRIGGER value="ATTACKING" simple_qualifier="self" />
   <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
      if player:CanPayResourceCost(1) then
          player:BeginNewMultipleChoice()
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
         player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
      end
    end
  </RESOLUTION_TIME_ACTION>
  <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local result = player:GetMultipleChoiceResult()
       if result ~= nil then
    if result == 0 then
      if player:CanPayResourceCost(1) then
         player:PayResourceCost(1)
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <CONTINUOUS_ACTION layer="6">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
   <UTILITY_ABILITY resource_id="1">
      <COST mana_cost="{R}" type="Mana" />
   </UTILITY_ABILITY>
Here you can find an example of implementation for this trigger :
Code: Select all
 <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Frenzied Goblin attacks, you may pay {R}. If you do, target creature can’t block this turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que le Gobelin hystérique attaque, vous pouvez payer {R}. Si vous faites ainsi, la créature ciblée ne peut pas bloquer ce tour-ci.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que el Trasgo frenético ataque, puedes pagar {R}. Si lo haces, la criatura objetivo no puede bloquear este turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Wildgewordene Goblin angreift, kannst du {R} bezahlen. Falls du dies tust, kann eine Kreatur deiner Wahl in diesem Zug nicht blocken.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta il Goblin Delirante attacca, puoi pagare {R}. Se lo fai, una creatura bersaglio non può bloccare in questo turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[激情のゴブリンが攻撃するたび、クリーチャー1体を対象とする。あなたは{R}を支払ってもよい。そうしたなら、このターン、それではブロックできない。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[광란한 고블린이 공격할 때마다, 당신은 {R}를 지불할 수 있다. 그렇게 한다면, 생물을 목표로 정한다. 그 생물은 이 턴에 방어할 수 없다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Неистовый Гоблин атакует, вы можете заплатить {R}. Если вы это делаете, целевое существо не может блокировать в этом ходу.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Goblin Ensandecido ataca, você pode pagar {R}. Se fizer isso, a criatura alvo não poderá bloquear neste turno.]]></LOCALISED_TEXT>
 <TRIGGER value="ATTACKING" simple_qualifier="self" />
   <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
      if player:CanPayManaCost("{R}") then
          player:BeginNewMultipleChoice()
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
         player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
      end
    end
  </RESOLUTION_TIME_ACTION>
  <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local result = player:GetMultipleChoiceResult()
       if result == 1 then
          player:PayManaCost("{R}")
     local filter = ClearFilter()
       local player = EffectController()
          local filter = ClearFilter()
      filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
     player:SetItemCount( 1 )
     for i = 0, (1-1) do
          player:SetItemPrompt(i, "CARD_QUERY_CHOOSE_CREATURE_GAIN_CANT_BLOCK" )
     end
     player:ChooseItems( EffectDC():Make_Targets(0)  )
      end
    end
</RESOLUTION_TIME_ACTION>

    <CONTINUOUS_ACTION layer="6">
    local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_CANT_BLOCK, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
Honestly i don't like card that triggers also when is not needed but in this case i removed any skip check about availability of mana, because if you're using manual mana it will not give you the time to add it.
May block is not needed if you use Multiple Choices question.
If you play with manual mana, there is another possibility, make this trigger as an activated ability with activation restrictions, this will make it more simple to use and it will not trigger any turn, but it will make the card a little bit less compliant to the original MTG one.
Attachments
Frenzied Goblin.rar
Frenzied Goblin Card + TDX ART
(348.19 KiB) Downloaded 206 times
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: Frenzied Goblin & Dauntless Onslaught

Postby Chakan » 26 Aug 2014, 00:42

They look like silly mistakes to me on my behalf, but thanks for helping guys. I appreciate it.
User avatar
Chakan
 
Posts: 166
Joined: 07 Jun 2014, 23:08
Has thanked: 11 times
Been thanked: 10 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 33 guests


Who is online

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

Login Form