Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)



Card Creation Request Thread
User-made mods in DLC (Downloadable Content) form.
Get MTG cards here for your DotP that aren't available anywhere else!
Get MTG cards here for your DotP that aren't available anywhere else!
Moderator: CCGHQ Admins
Re: Card Creation Request Thread
by NEMESiS » 17 Feb 2013, 23:20
Ok another question:
Why is that whenever I cast more then one copy of this land the game crashes?
Why is that whenever I cast more then one copy of this land the game crashes?
- Code: Select all
<TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Graypelt Refuge enters the battlefield tapped.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Rifugio di Pellegrigia entra nel campo di battaglia TAPpato.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Das Graupelz-Refugium kommt getappt ins Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Refuge de Grisepeau arrive sur le champ de bataille engagé.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Refugio de Pellejo Gris entra al campo de batalla girado.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[灰色革の隠れ家はタップ状態で戦場に出る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Graypelt Refuge enters the battlefield tapped.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Грейпелтское Укрытие выходит на поле битвы повернутым.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Refúgio de Pele-Cinza entra no campo de batalha virado.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():ComesIntoPlayTapped()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY auto_skip="1" pre_trigger="1" filter_zone="ZONE_IN_PLAY" active_zone="ZONE_TRANSITION">
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
EffectController():BeginNewMultipleChoice()
EffectController():AddMultipleChoiceAnswer( "ADD_G_TO_YOUR_MANA_POOL" )
EffectController():AddMultipleChoiceAnswer( "ADD_W_TO_YOUR_MANA_POOL" )
EffectController():AskMultipleChoiceQuestion( "CARD_QUERY_CHOOSE_COLOUR" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if Object():GetMultipleChoiceResult() == 0 then
ObjectDC():Set_Int(0, 1)
elseif Object():GetMultipleChoiceResult() == 1 then
ObjectDC():Set_Int(0, 2)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Graypelt Refuge enters the battlefield, you gain 1 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Rifugio di Pellegrigia entra nel campo di battaglia, guadagni 1 punto vita.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn das Graupelz-Refugium ins Spiel kommt, erhältst du 1 Lebenspunkt dazu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Refuge de Grisepeau arrive sur le champ de bataille, vous gagnez 1 point de vie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Refugio de Pellejo Gris entre al campo de batalla, ganas 1 vida.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[灰色革の隠れ家が戦場に出たとき、あなたは1点のライフを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Graypelt Refuge enters the battlefield, you gain 1 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Грейпелтское Укрытие выходит на поле битвы, вы получаете 1 жизнь.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Refúgio de Pele-Cinza entra no campo de batalha, você ganha 1 ponto de vida.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
local player = EffectController()
if (player ~= nil) then
player:GainLife(1)
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY forced_skip="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Add {G} or {W} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: Aggiungi {G} o {W} alla tua riserva di mana.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Erhöhe deinen Manavorrat um {G} oder {W}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : Ajoutez {G} ou {W} à votre réserve.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: Agrega {G} o {W} a tu reserva de maná.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:あなたのマナ・プールに{G}か{W}を加える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Add {G} or {W} to your mana pool.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: добавьте {G} или {W} в ваше хранилище маны.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Adicione {G} ou {W} à sua reserva de mana.]]></LOCALISED_TEXT>
<AVAILABILITY>
return EffectController():IsAI() == 0
</AVAILABILITY>
<COST type="Mana" cost="{0}" />
<RESOLUTION_TIME_ACTION>
EffectController():BeginNewMultipleChoice()
EffectController():AddMultipleChoiceAnswer( "ADD_G_TO_YOUR_MANA_POOL" )
EffectController():AddMultipleChoiceAnswer( "ADD_W_TO_YOUR_MANA_POOL" )
EffectController():AskMultipleChoiceQuestion( "CARD_QUERY_CHOOSE_COLOUR")
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if Object():GetMultipleChoiceResult() == 0 then
ObjectDC():Set_Int(0, 1)
elseif Object():GetMultipleChoiceResult() == 1 then
ObjectDC():Set_Int(0, 2)
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION layer="6">
local characteristics = Object():GetCurrentCharacteristics()
local mana_color = ObjectDC():Get_Int(0)
characteristics:GrantAbility(mana_color)
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<MANA_ABILITY resource_id="1" filter_zone="ZONE_IN_PLAY">
<COST type="TapSelf" />
<PRODUCES amount="{G}" />
</MANA_ABILITY>
<MANA_ABILITY resource_id="2" filter_zone="ZONE_IN_PLAY">
<COST type="TapSelf" />
<PRODUCES amount="{W}" />
</MANA_ABILITY>
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Card Creation Request Thread
by thefiremind » 17 Feb 2013, 23:49
Crashes happen when the AI evaluates a card that grants mana abilities without having an active mana ability (it doesn't matter if you are controlling the card: the AI evaluates your cards as well). This problem usually doesn't happen with cards that enter the battlefield tapped because the AI doesn't need to evaluate them while they are tapped, anyway I'd suggest to add a default to the mana choice:
- Code: Select all
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION layer="6">
local characteristics = Object():GetCurrentCharacteristics()
local mana_color = ObjectDC():Get_Int(0)
if mana_color == 0 then
mana_color = 1
end
characteristics:GrantAbility(mana_color)
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
< 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: 722 times
Re: Card Creation Request Thread
by thefiremind » 18 Feb 2013, 09:52
It doesn't seem tricky to me... start from Dawn Elemental and add the card-drawing part:
- Code: Select all
<TRIGGERED_ABILITY immunity="1" internal="1" pre_trigger="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[If a source would deal damage to Swans of Bryn Argoll, prevent that damage. The source’s controller draws cards equal to the damage prevented this way.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Se una fonte sta per infliggere danno ai Cigni di Bryn Argoll, previeni quel danno. Il controllore di quella fonte pesca un numero di carte pari al danno prevenuto in questo modo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Falls eine Quelle den Schwänen von Bryn Argoll Schaden zufügen würde, verhindere diesen Schaden. Der Beherrscher dieser Quelle zieht so viele Karten, wie auf diese Weise Schadenspunkte verhindert wurden.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Si une source devait infliger des blessures aux Cygnes de Bryn Argoll, prévenez ces blessures. Le contrôleur de cette source pioche un nombre de cartes égal au nombre de blessures prévenues de cette manière.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Si una fuente fuera a hacer daño a los Cisnes de Bryn Árgoll, prevén ese daño. El controlador de la fuente roba una cantidad de cartas igual al daño prevenido de esta manera.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[いずれかの発生源がブリン・アーゴルの白鳥にダメージを与える場合、それをすべて軽減し、0にする。 その発生源のコントローラーは、これにより軽減されたダメージの点数に等しい枚数のカードを引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[If a source would deal damage to Swans of Bryn Argoll, prevent that damage. The source’s controller draws cards equal to the damage prevented this way.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Если источник должен нанести повреждения Лебедям Брин-Аргола, предотвратите эти повреждения. Контролирующий этот источник игрок берет столько карт, сколько повреждений было предотвращено таким образом.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Se uma fonte for causar dano a Cisnes de Bryn Argoll, previna aquele dano. O controlador da fonte compra um número de cards igual ao dano prevenido dessa maneira.]]></LOCALISED_TEXT>
<TRIGGER value="CREATURE_TOOK_DAMAGE" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local damage_amount = Damage():GetAmount()
local damage_controller = Damage():GetSource():GetPlayer()
if Damage():IsUnpreventable() == 0 and damage_amount > 0 then
Damage():SetAmount(0)
PlayerDrawCards( damage_controller, damage_amount )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
< 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: 722 times
Re: Card Creation Request Thread
by SoulStorm » 18 Feb 2013, 10:40
That's perfect Firemind, the damage controller was the part I was having the most trouble with.
Thanks!
Thanks!
Re: Card Creation Request Thread
by thefiremind » 19 Feb 2013, 12:52
This is Diluvian Primordial as requested by NEMESiS. I used some of the code from Blatant Thievery and it seems to work (tested with only 1 opponent). You'll be asked to choose a spell for each opponent: if you don't want to choose a spell for a particular opponent, finish the query and you'll step to the next one (if any). The only downside is that you can't choose the order for casting the spells, but I had only one idea to allow that, and it was too complicated.
Of course if someone comes up with a better implementation, please share it.
Of course if someone comes up with a better implementation, please share it.
- Attachments
-
DILUVIAN_PRIMORDIAL_366326.zip
- (111.37 KiB) Downloaded 305 times
< 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: 722 times
Re: Card Creation Request Thread
by NEMESiS » 19 Feb 2013, 13:37
Thank you a ton thefiremind, I will test it later today. 

-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Card Creation Request Thread
by RiiakShiNal » 19 Feb 2013, 15:05
An idea for choosing the order is in a second PLAY_TIME_ACTION put the chosen cards into a chest and ask the player which of those spells should be cast first, second, etc... to n-1 opponents for which you actually selected spells for (in a 2 player game would not ask, in a 3 player game would only ask for first, in a 4 player free-for-all would ask for first and second). Then you would cast in the order selected. I could expand on all this if you want.thefiremind wrote:This is Diluvian Primordial as requested by NEMESiS. I used some of the code from Blatant Thievery and it seems to work (tested with only 1 opponent). You'll be asked to choose a spell for each opponent: if you don't want to choose a spell for a particular opponent, finish the query and you'll step to the next one (if any). The only downside is that you can't choose the order for casting the spells, but I had only one idea to allow that, and it was too complicated.
Of course if someone comes up with a better implementation, please share it.
It doesn't seem too complicated, but I also don't know if the AI would properly understand how to order the casts.
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: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Card Creation Request Thread
by thefiremind » 19 Feb 2013, 15:08
That could be a good idea. My idea was to collect all the possible targets in a chest from the start, but it would have been difficult to remove all the cards belonging to the chosen card's owner after each choice.
< 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: 722 times
Re: Card Creation Request Thread
by Thran75 » 24 Feb 2013, 11:48
I wish make a Rebel deck, but doing Lin Sivvi is beyond my skills. Is there someone that could help me?
Re: Card Creation Request Thread
by thefiremind » 24 Feb 2013, 12:36
I coded her for DotP2012, here's the updated version.Thran75 wrote:I wish make a Rebel deck, but doing Lin Sivvi is beyond my skills. Is there someone that could help me?
EDIT: Fixed.
- Attachments
-
LIN_SIVVI_DEFIANT_HERO_21271.zip
- (97.32 KiB) Downloaded 287 times
Last edited by thefiremind on 25 Feb 2013, 12:09, edited 1 time in total.
< 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: 722 times
Re: Card Creation Request Thread
by NEMESiS » 24 Feb 2013, 18:34
Ok I started this off of Dream fracture and tried using Ravenous Rats to add the second ability but I am not sure how I can add the discard mechanic properly. Dismal Failure:
- Code: Select all
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if player ~= nil then
player:SetTargetPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
end
player:ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if player ~= nil then
for i = 0,(1-1) do
local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
if target_card ~= nil then
target_card:Discard()
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource():GetTargetCard() ~= nil then
EffectSource():GetTargetCard():CounterSpell()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Card Creation Request Thread
by thefiremind » 24 Feb 2013, 19:30
There are some problems here...

- You are storing a card (the target spell) in target chest #0:
- Code: Select all
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
- Code: Select all
local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
- A target choice with NO_VALIDATION must be used after a filter that restricts the possible targets. NO_VALIDATION means that you aren't referring to a TARGET_DEFINITION that sets that filter for you. It's OK for this scenario but you need to filter the cards in the hand of the player who controls the spell you are about to counter.
- This is not your fault because some official cards do that, but you should avoid using EffectSource():GetTargetCard(). EffectSource() is a pointer to the card itself but it gets cleaned when the card changes zone. Targetting should fail when the card's target changes zone, not when the card itself changes zone. You can use Object():GetTargetCard() which doesn't have this problem, but it's a DotP2012 notation so even if it still works, I'd suggest to use EffectDC():Get_Targets(0):Get_CardPtr(0) which is the same pointer but in DotP2013 notation, just for the sake of coherence.

- Code: Select all
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local player = target:GetPlayer()
Discard_ResolutionTimeAction1(player, 1)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local player = target:GetPlayer()
target:CounterSpell()
Discard_ResolutionTimeAction2( player, 1 )
end
</RESOLUTION_TIME_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: 722 times
Re: Card Creation Request Thread
by NEMESiS » 25 Feb 2013, 03:12
Ok I don't quite understand that part.thefiremind wrote:EffectSource() is a pointer to the card itself but it gets cleaned when the card changes zone. Targetting should fail when the card's target changes zone, not when the card itself changes zone.
Also, I wanted to get a more clear understanding regarding chests. When referencing a chest this is what I understand about it from wiki entry:
"This object represents a collection of data that stays linked to some other object. All the data chests can be accessed through MTG()."
With that said, is chest (0) the same as a layer as stated here:
viewtopic.php?f=65&t=3676
Also, when referencing something with "()" is that referencing the same chest as previously determined (lets say I had used (0) at the beginning of the ability)? Or what does that mean. (I know I read it somewhere i just cannot find it now)
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Card Creation Request Thread
by RiiakShiNal » 25 Feb 2013, 04:39
In more concrete terms EffectSource() points to the same thing as Object() except if a card changes zone (like going to the graveyard from play) Object() will still be valid (returns the card), but EffectSource() becomes nil.NEMESiS wrote:Ok I don't quite understand that part.thefiremind wrote:EffectSource() is a pointer to the card itself but it gets cleaned when the card changes zone. Targetting should fail when the card's target changes zone, not when the card itself changes zone.
This is partially correct, chests are not all accessed through MTG() anymore, most are accessed from cards (via Object(), EffectSource(), or some other function that returns a card), directly (via ObjectDC() or EffectDC()), or from other chests (like ObjectDC():Get_Chest(0). You can still access some data chests from the MTG() object though.NEMESiS wrote:Also, I wanted to get a more clear understanding regarding chests. When referencing a chest this is what I understand about it from wiki entry:
"This object represents a collection of data that stays linked to some other object. All the data chests can be accessed through MTG()."
No, Data Chests and Layers are very different. Layers determine where in processing that a specific ability effect will be applied with lower layers being applied first. So say you have a Blightsteel Colossus which is being modified by a Sorceress Queen (layer 7B) then a Giant Growth is cast on the Blightsteel Colossus (7C). Blightsteel Colossus's base P/T is 11/11, layer 7B is applied and it becomes 0/2 then layer 7C is applied and it becomes 3/5. You will get the same end result if the order of effects is changed between Sorceress Queen and Giant Growth due to the layers. If you change the layers though you can get a different effect. If you reverse the layers putting Sorceress Queen on 7C and Giant Growth on 7B then the end result would be that the Blightsteel Colossus would be 0/2 instead of the correct 3/5. So layers are important, but they are defintely different from chests.NEMESiS wrote:With that said, is chest (0) the same as a layer as stated here:
viewtopic.php?f=65&t=3676
A Data Chest will hold information relating to either the card (Object DC), the effect itself (Effect DC), or data that the coder has specifically put away (Chests made with Make_Chest()). This data can be pointers to other cards, numbers, or pointers to players which can be accessed by the coder whenever they access the Chest. This could be things like which creature was targeted by the Sorceress Queen or by Giant Growth, it could be how much life to gain from a Stream of Life. The uses for chests are just about endless.
That depends if you use ObjectDC():Get_Chest(0) on one card then later on the same card access ObjectDC():Get_Chest(0) then yes, you are accessing the same chest even if it is in different abilities on the same card. If you try to access ObjectDC():Get_Chest(0) on a different card then it will be a different chest.NEMESiS wrote:Also, when referencing something with "()" is that referencing the same chest as previously determined (lets say I had used (0) at the beginning of the ability)? Or what does that mean. (I know I read it somewhere i just cannot find it now)
If you try to access EffectDC():Get_Chest(0) on one card in one ability then later in the same ability on the same card access EffectDC():Get_Chest(0) again, then yes, it is the same chest. If you try to use EffectDC():Get_Chest(0) from another ability on the same card (or on a different card) then it will be a different chest.
If you change the 0 to a 1 (or another number) between accesses then they will be different chests.
Note that both ObjectDC() and EffectDC() are chests in themselves and can be referenced in multiple ways. On a card you can use ObjectDC(), MTG():ObjectDataChest(), or Object():GetDataChest() and they will refer to the same chest. In an effect you can use EffectDC() or MTG():EffectDataChest() and they will be the same chest.
Unless you are using one of the default chests (ObjectDC(), EffectDC(), EffectController():PlayerDataChest()) then you will need to create it (Make_Chest()) before you can access it (Get_Chest()).
The parenthesis (after a function name) simply denote parameters (data that is sent into a function) if they are empty, "()", then there are no parameters, if the parenthesis contain information (numbers, function calls, strings, etc...) then there are parameters and they are separated from each other by commas, ",". ObjectDC() has empty parenthesis so it has no parameters (gets the data chest for the object), Get_Chest(0) has a single parameter passing the number "0" into the Get_Chest function (gets chest 0 from a datachest referenced immediately before it), Int_Set(0, 1) has two parameters passing in the first parameter as the number "0" and the second as the number "1" (gives the variable "0" the integer value "1" in the data chest that this function was called on).
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: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Return to New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
Who is online
Users browsing this forum: No registered users and 1 guest