Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
[DOTP 2013] Custom deck
Moderator: CCGHQ Admins
[DOTP 2013] Custom deck
by 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 :
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>
Re: [DOTP 2013] Custom deck
by thefiremind » 28 Mar 2013, 15:05
Try to remove
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.
- Code: Select all
FilteredCard():GetZone() == ZONE_ANY and
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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: [DOTP 2013] Custom deck
by 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
Re: [DOTP 2013] Custom deck
by Reaper » 28 Mar 2013, 15:19
Does not seem to work at all, not even for creatures which are in the game.
Re: [DOTP 2013] Custom deck
by 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: [DOTP 2013] Custom deck
by Reaper » 28 Mar 2013, 15:43
Guess it is a no go then, tried now with 22811.
Re: [DOTP 2013] Custom deck
by 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: [DOTP 2013] Custom deck
by Reaper » 28 Mar 2013, 16:31
Thanks, did that, but sadly it did not fix it, but i appreciate the help alot.
Re: [DOTP 2013] Custom deck
by 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 > 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>
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: [DOTP 2013] Custom deck
by 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
Re: [DOTP 2013] Custom deck Colour question
by 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>
Re: [DOTP 2013] Custom deck
by 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:
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>
- 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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
12 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 43 guests