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 RiiakShiNal » 06 Apr 2013, 19:30
When it works it does seem to include all areas, but sometimes it just doesn't work for unknown reasons. For example I could not get it to work properly for Counterbore and had to re-write the card using EvaluateObjects(). I have had no problem using ZONE_ANY for attributes like active_zone, from_zone, etc..., but I have issues getting it to work properly for filter_zone.sumomole wrote:You mean ZONE_ANY doesn't include all the areas?
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 sumomole » 06 Apr 2013, 20:55
I think Counterbore can be coded by filter_zone = "ZONE_ANY" and <FILTER/>.RiiakShiNal wrote:When it works it does seem to include all areas, but sometimes it just doesn't work for unknown reasons. For example I could not get it to work properly for Counterbore and had to re-write the card using EvaluateObjects(). I have had no problem using ZONE_ANY for attributes like active_zone, from_zone, etc..., but I have issues getting it to work properly for filter_zone.sumomole wrote:You mean ZONE_ANY doesn't include all the areas?

- Code: Select all
<SPELL_ABILITY filter_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Counter target spell. Search its controller’s graveyard, hand, and library for all cards with the same name as that spell and exile them. Then that player shuffles his or her library.]]></LOCALISED_TEXT>
<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 ignore_filter="1">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
EffectDC():Get_Targets(0):LKIShield_CardPtr(0)
EffectDC():Set_PlayerPtr(3, target:GetPlayer())
target:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local player = EffectDC():Get_PlayerPtr(3)
local filter = Object():GetFilter()
if player ~= nil then
filter:Clear()
filter:May()
filter:SetPlayer( player )
filter:SetZone( ZONE_HAND )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
EffectController():SetTargetCount( 1 )
EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD", EffectDC():Make_Targets(1))
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local player = EffectDC():Get_PlayerPtr(3)
local filter = Object():GetFilter()
if player ~= nil then
filter:Clear()
filter:May()
filter:NotTargetted()
filter:SetZone( ZONE_LIBRARY )
filter:SetPlayer( player )
EffectController():SetTargetCount( 1 )
EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD", EffectDC():Make_Targets(2) )
end
</RESOLUTION_TIME_ACTION>
<FILTER>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
return target:GetCardName() == FilteredCard():GetCardName() and
(FilteredCard():GetZone() == ZONE_GRAVEYARD or
FilteredCard():GetZone() == ZONE_HAND or
FilteredCard():GetZone() == ZONE_LIBRARY)
end
return false
</FILTER>
<RESOLUTION_TIME_ACTION>
if FilteredCard() ~= nil then
FilteredCard():GuidedReveal( FilteredCard():GetZone() , ZONE_REMOVED_FROM_GAME )
FilteredCard():RemoveFromGame()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local player = EffectDC():Get_PlayerPtr(3)
if player ~= nil then
player:ShuffleLibrary()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Card Creation Request Thread
by nivmizzet1 » 07 Apr 2013, 02:48
Thanks guys. Both those fixes worked.
______________________________________
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
- nivmizzet1
- Posts: 617
- Joined: 21 Mar 2013, 10:10
- Has thanked: 100 times
- Been thanked: 25 times
Re: Card Creation Request Thread
by RiiakShiNal » 07 Apr 2013, 03:44
I tried coding it using filter_zone="ZONE_ANY" and <FILTER> at first, but it would not reliably exile cards of the same name from the library and graveyard, though it seemed to work perfectly for exiling cards from the hand. That is why I had to end up coding it using EvaluateObjects() so that it would work reliably.sumomole wrote:I think Counterbore can be coded by filter_zone = "ZONE_ANY" and <FILTER/>.![]()
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
[Real]Melek, Izzet Paragon from DGM
by sumomole » 07 Apr 2013, 04:53
Unfortunately, that is very interesting card is fake, this real, but also very interesting.
Melek, Izzet Paragon.zip
- (114.45 KiB) Downloaded 267 times
Last edited by sumomole on 08 Apr 2013, 05:51, edited 5 times in total.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Card Creation Request Thread
by sumomole » 07 Apr 2013, 04:57
I successfully tested with the above code, the cards can be removed from all areas.RiiakShiNal wrote:I tried coding it using filter_zone="ZONE_ANY" and <FILTER> at first, but it would not reliably exile cards of the same name from the library and graveyard, though it seemed to work perfectly for exiling cards from the hand. That is why I had to end up coding it using EvaluateObjects() so that it would work reliably.sumomole wrote:I think Counterbore can be coded by filter_zone = "ZONE_ANY" and <FILTER/>.![]()

-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Card Creation Request Thread
by NotJJ » 07 Apr 2013, 14:28
Would it be possible to create Ertai the corrupted's ability, if so would someone be able to make it for me or give me some guidance on how to make it.
Re: Card Creation Request Thread
by sumomole » 07 Apr 2013, 14:47
NotJJ wrote:Would it be possible to create Ertai the corrupted's ability, if so would someone be able to make it for me or give me some guidance on how to make it.
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{U}, {T}, Sacrifice a creature or enchantment: Counter target spell.]]></LOCALISED_TEXT>
<COST type="Mana" cost="{U}" />
<COST type="TapSelf" />
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CREATURE_OR_ENCHANTMENT_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME></COST>
<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(1) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Card Creation Request Thread
by Blue Ghost » 07 Apr 2013, 21:00
Newbie here. I'm trying to code Zedruu the Greathearted, but I can't get its activated ability to work. I'm sure it should be possible, but I don't know of any exact precedent for it. Can someone help?
Also, how would one go about implementing how the AI uses the ability?
Also, how would one go about implementing how the AI uses the ability?
- Blue Ghost
- Posts: 52
- Joined: 07 Apr 2013, 20:41
- Has thanked: 6 times
- Been thanked: 0 time
Re: Card Creation Request Thread
by thefiremind » 07 Apr 2013, 22:09
I made Zedruu and attached it here. It's untested, but it should work.Blue Ghost wrote:Newbie here. I'm trying to code Zedruu the Greathearted, but I can't get its activated ability to work. I'm sure it should be possible, but I don't know of any exact precedent for it. Can someone help?
(I wrote "CARD_QUERY_CHOOSE_PERMANENT_TO_GIVE" for the second target's query text, which is undefined for now, but I couldn't find an already defined string that was fitting enough.)
This may be an unsolvable problem... the AI evaluates the best thing to do by looking ahead a couple of turns and seeing how various combinations of plays affect the game. What you get from Zedruu's upkeep trigger will probably be not enough to convince the AI to give away permanents, unless there's an evident gain (for example, I think that a Bronze Bombshell might convince the AI to activate Zedruu). The only thing you can do is try and see what happens. If the AI absolutely refuses to use Zedruu, you can at least include some other means to give away permanents that don't need activation (Puca's Mischief, Spawnbroker, etc.) so the AI will somehow play your deck properly even without activating Zedruu.Blue Ghost wrote:Also, how would one go about implementing how the AI uses the ability?
- Attachments
-
ZEDRUU_THE_GREATHEARTED_236499.zip
- (109.8 KiB) Downloaded 260 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 Blue Ghost » 08 Apr 2013, 03:27
Thank you so much! It appears the parameters in the ChooseTargets function were tripping me up. Is there an explanation as to what they mean?
- Blue Ghost
- Posts: 52
- Joined: 07 Apr 2013, 20:41
- Has thanked: 6 times
- Been thanked: 0 time
Re: Card Creation Request Thread
by Blue Ghost » 08 Apr 2013, 03:54
Sorry, another quick question. I'm now working on Questing Phelddagrif. If I understand correctly, Questing Phelddagrif's controller is considered the owner of the generated tokens, despite them being under an opponent's control, is that right? How would I go about implementing that?
EDIT: Never mind, I forgot about the rules change. No token exploits for me.
Also, is it possible to code Prophetic Prism?
EDIT: Never mind, I forgot about the rules change. No token exploits for me.
Also, is it possible to code Prophetic Prism?
- Blue Ghost
- Posts: 52
- Joined: 07 Apr 2013, 20:41
- Has thanked: 6 times
- Been thanked: 0 time
Re: Card Creation Request Thread
by thefiremind » 08 Apr 2013, 09:06
There's not only one function to choose targets, and the parameters vary according to the function:Blue Ghost wrote:Thank you so much! It appears the parameters in the ChooseTargets function were tripping me up. Is there an explanation as to what they mean?
- ChooseTarget( target_definition_id, query_string, target_chest )
- ChooseTargets( target_definition_id, target_chest )
- ChooseTargetWithFlags( target_definition_id, query_string, target_chest, flags )
- ChooseTargetsWithFlags( target_definition_id, target_chest, flags )
- ChooseTargetFromDCWithFlags( target_definition_id, query_string, browser_chest, target_chest, flags )
- ChooseTargetsFromDCWithFlags( target_definition_id, browser_chest, target_chest, flags )
- target_definition_id: the id of the TARGET_DEFINITION that you want to enforce on the choice, or NO_VALIDATION (whose value is -1) if you don't want to enforce any definition (in the latter case you usually define a filter before calling the function)
- target_chest: the chest where the target(s) will be stored (never ever use the same register number for different things in the same ability)
- query_string: a string that will be substituted by localised text found in one of the Excel-style XMLs in the TEXT_PERMANENT directory (you don't use this here when choosing more than one target because you must set the prompt for each of the targets with separate SetTargetPrompt function calls)
- flags: a series of constants that can be added to each other and will have various effects on the target choice (for example, QUERY_FLAG_CAN_BE_FINISHED_EARLY will add a "finish" button to the query for the player)
- browser_chest: a chest that contains a selection of cards to choose from (useful when you really can't do what you want with just a filter)
As always when coding mana abilities with costs that aren't just TapSelf, you can't do it normally, you could use mana tokens with all the usual problems that come with them.Blue Ghost wrote:Also, is it possible to code Prophetic Prism?
< 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 gorem2k » 08 Apr 2013, 23:22
Doran, the siege tower for dotp 2013.
I've tried injecting the card from Firemind's DLC v9 to a new wad, the card was playable but had no effect
then I've tried coding it myself using some hints from Calcite Snapper.. but this is far too complicated for me!
I believe there used to be a single-line code in dotp 2012 for reversing power/toughness. is this removed or ?
I've tried injecting the card from Firemind's DLC v9 to a new wad, the card was playable but had no effect

then I've tried coding it myself using some hints from Calcite Snapper.. but this is far too complicated for me!
I believe there used to be a single-line code in dotp 2012 for reversing power/toughness. is this removed or ?
Re: Card Creation Request Thread
by thefiremind » 09 Apr 2013, 00:03
It doesn't actually reverse p/t, it just uses toughness for combat damage, as it should. Anyway yes, it still exists and still works.gorem2k wrote:I believe there used to be a single-line code in dotp 2012 for reversing power/toughness. is this removed or ?
I made a small improvement from DotP2012: Doran's ability will be effective only during combat phase. This way you can see the real power of the creatures out of combat phase, which could be useful.
DORAN_THE_SIEGE_TOWER_140201.zip
- (116.59 KiB) Downloaded 227 times
EDIT:
I saw Melek on the Wizards site right now... the fact that he's a "Weird Wizard" makes me giggle.sumomole wrote:Unfortunately, that is very interesting card is fake, this real, but also very interesting.

I like Master of Cruelties even more, too bad we don't have a CHARACTERISTIC_MUST_ATTACK_ALONE so we can't code it.
< 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
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 10 guests