It is currently 23 Apr 2024, 08:40
   
Text Size

[DOTP 2013] Custom deck

Moderator: CCGHQ Admins

[DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 14:11

Hello, i was making cards for a custom deck with own functions, however, im not able to get one card to work in the way i want it, maybe anyone of you can elaborate what i am doing wrong ?

This is an excerpt from the part which is not functioning correctly, what i am trying to achieve is a card, which gives all creatures, so even cards in hand, changeling, is this possible ?
I tried it this way :
Code: Select all
<?xml version='1.0'?>
<CARD_V2>
  <FILENAME text="REAPER_OF_WORLDS_2287222211" />
  <CARDNAME text="REAPER_OF_WORLDS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Reaper of Worlds]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="2287222211" />
  <ARTID value="131191" />
  <ARTIST name="Daarken" />
  <CASTING_COST cost="{4}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Puisse mon ignominie ériger des murs plus épais que le fer et plus résistants que le sombracier. »
—Thrun, le dernier troll]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Que mi deshonra construya muros más duros que el hierro y más resistentes que el acero oscuro.”
—Thrun, el último trol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Lasse meine Schande Mauern erbauen, die dicker als Eisen und stärker als Nachtstahl sind.“
—Thrun, der letzte Troll]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“Lasciate che la mia infamia costruisca muri più spessi del ferro e più forti del darksteel.”
—Thrun, l’ultimo troll]]></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[“Que minha ignomínia construa barreiras mais espessas que o ferro e mais fortes que o aço negro.”
— Thrun, o último trol]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Artifact" />
  <EXPANSION value="DPG" />
  <RARITY metaname="R" />
  <STATIC_ABILITY filter_zone="ZONE_ANY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures you control have Changeling]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature che controlli hanno volare, attacco improvviso, cautela, travolgere, rapidità e protezione dal nero e dal rosso.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die du kontrollierst, haben Flugfähigkeit, Erstschlag, Wachsamkeit, Trampelschaden, Eile, Schutz vor Schwarz und Schutz vor Rot.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures que vous contrôlez ont le vol, l’initiative, la vigilance, le piétinement, la célérité, la protection contre le noir et la protection contre le rouge.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas que controlas tienen las habilidades de volar, dañar primero, vigilancia, arrollar, prisa, protección contra negro y protección contra rojo.]]></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[As criaturas que você controla têm voar, iniciativa, vigilância, atropelar, ímpeto, proteção contra o preto e proteção contra o vermelho.]]></LOCALISED_TEXT>
    <FILTER>
    return (FilteredCard() ~= nil and
    FilteredCard():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and
    FilteredCard():GetZone() == ZONE_ANY and
    FilteredCard():GetController() == EffectController() )
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       if characteristics ~= nil then
          characteristics:Characteristic_Set( CHARACTERISTIC_CHANGELING, 1 )
       end
    end 
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>    
  <HELP title="MORE_INFO_BADGE_TITLE_21" body="MORE_INFO_BADGE_BODY_21" zone="ZONE_ANY" />
  <AI_BASE_SCORE score="1200" zone="ZONE_IN_PLAY" />
</CARD_V2>
Thanks in advance for helping.
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby thefiremind » 28 Mar 2013, 15:05

Try to remove
Code: Select all
FilteredCard():GetZone() == ZONE_ANY and
since you are already setting this with the filter_zone tag and I'm not sure about how it would be treated inside the filter, then change GetController with GetPlayer, so you are including cards that you own outside the battlefield (hand and graveyard).

Maybe you already know, but don't test the card just by looking at the changeling badge: you can't see badges in your hand, but that doesn't mean that your card doesn't work.
< 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: [DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 15:10

true, i was not testing it with badges, was testing it with stats from cards like winged splicer, but im gonna try it now with getplayer
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 15:19

Does not seem to work at all, not even for creatures which are in the game.
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby thefiremind » 28 Mar 2013, 15:34

Then try to reduce the Multiverse ID's digits, the number you are using could be too big.
< 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: [DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 15:43

Guess it is a no go then, tried now with 22811.
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby thefiremind » 28 Mar 2013, 16:18

If you are not using theta version, try to delete your profile (eventually after making a backup copy) before each change to custom cards.
< 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: [DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 16:31

Thanks, did that, but sadly it did not fix it, but i appreciate the help alot.
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby RiiakShiNal » 28 Mar 2013, 16:58

ZONE_ANY does not seem to work for the filter_zone attribute (I had issues with this for another card) so you will probably either need to use multiple STATIC_ABILITY blocks to achieve this effect or manually iterate through all cards by filtering and evaluating them (can be done in a single ability but has more code).

Code: Select all
<CONTINUOUS_ACTION layer="6">
  local filter = Object():GetFilter()
  filter:SetZone( ZONE_ANY )
  filter:SetPlayer( EffectController() )
  filter:AddCardType( CARD_TYPE_CREATURE )
  local count = filter:EvaluateObjects()
  if (count &gt; 0) then
    for i=0,count-1 do
      local card = filter:GetNthEvaluatedObject(i)
      if (card ~= nil) then
        local characteristics = card:GetCurrentCharacteristics()
        if characteristics ~= nil then
          characteristics:Characteristic_Set( CHARACTERISTIC_CHANGELING, 1 )
        end
      end
    end
  end
</CONTINUOUS_ACTION>
If that doesn't work then you're probably going to have to use multiple static abilities to get it to work (one ability for each zone). You could edit the above to do the loop once for each zone, but again that's more work and more potential for bugs.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: [DOTP 2013] Custom deck

Postby Reaper » 28 Mar 2013, 17:20

Thanks alot to both of you, it was indeed the ZONE_ANY which gave the problem, but thanks for suggestions by both
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck Colour question

Postby Reaper » 28 Mar 2013, 17:42

Hello, if i want to add a colour to the creatures i do it like this ?

Code: Select all
<STATIC_ABILITY filter_zone="ZONE_HAND">   
   <FILTER>
    return (FilteredCard() ~= nil and
    FilteredCard():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and
    FilteredCard():GetZone() == ZONE_IN_PLAY and
    FilteredCard():GetPlayer() == EffectController() )
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetColour()
       if characteristics ~= BLACK then
          characteristics:Colour_Add(BLACK)
       end
    end 
    </CONTINUOUS_ACTION>
</STATIC_ABILITY>
Thanks in advance
Reaper
 
Posts: 19
Joined: 13 Jan 2013, 01:20
Has thanked: 2 times
Been thanked: 0 time

Re: [DOTP 2013] Custom deck

Postby thefiremind » 28 Mar 2013, 17:45

characteristics ~= BLACK has no sense... characteristics is an object (and we don't know its internal structure) that contains the colors of the card and you can't access it like that. Moreover, the black color isn't defined as BLACK, but as COLOUR_BLACK.

If you look at Rise from the Grave you find this:
Code: Select all
    <CONTINUOUS_ACTION layer="5">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Colour_Get():Add( COLOUR_BLACK )
    end
    </CONTINUOUS_ACTION>
so what you need is:
Code: Select all
    <CONTINUOUS_ACTION layer="5">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       characteristics:Colour_Get():Add( COLOUR_BLACK )
    end
    </CONTINUOUS_ACTION>
< 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


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

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

Login Form