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) 2014
Formal Request Thread
Moderator: CCGHQ Admins
Re: Formal Request Thread
by thefiremind » 06 Jul 2013, 09:20
I thought about that too, but then I re-read the first post and understood that he wanted card requests here, too, so he could index them in the first post. It's not a bad idea, the only problem is convincing everyone to stop using the other thread for DotP2014.gorem2k wrote:I think Master Necro made this thread for reference in simplifying code mechanics.
Supporting more abilities for auto-completion was on my plans since the first day. The problem is that I started with abilities for which I always give the full localised text which is supposed to replace the original, while some abilities would need to discover something useful from the original localised text, use the information for the ability, and keep the localised text unchanged. I need to find a way to make the 2 different approaches live together. But either I mod, or I update my generator... I can't do both at once.gorem2k wrote:I thought about an idea this morning; would be nice if thefiremind web generator would include them when there's a need for it. this would save us time. but then, the tool is already priceless.
It doesn't work because it's a mix of DotP2013 and DotP2014 syntax. You had better starting from DotP2014 cards without even looking at DotP2013 examples, at least for the first cards you code for the new game. I'll provide some code soon.BloodReyvyn wrote:I tried to make Korlash, Heir to Blackblade and I am obviously failing at something since it (a) allows me to discard any card from my hand and (b) acts like it is activating an ability, but nothing happens when it resolves.
EDIT: This is the cost part for grandeur:
- Code: Select all
<COST type="Discard" definition="0" compartment="1" query_tag="CARD_QUERY_CHOOSE_CARD_TO_DISCARD" item_count="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:SetZone( ZONE_HAND, EffectController() )
filter:Add( FE_CARD_NAME, OP_IS, Object() )
</COST_DEFINITION>
Remember that this will use register #1 because it says compartment="1", so don't use register #1 inside the ability (or change the tag so that it uses another one, if you like).
The resolution of the grandeur ability for Korlash can be made starting from Explosive Vegetation:
- Code: Select all
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
local effectController = EffectController()
filter:Add( FE_SUBTYPE, OP_IS, LAND_TYPE_SWAMP )
filter:SetZone( ZONE_LIBRARY, effectController )
effectController:SetItemCount( 2 )
for i = 0, (2-1) do
effectController:SetItemPrompt(i, "CARD_QUERY_CHOOSE_LAND_TO_PUT_ONTO_THE_BATTLEFIELD_TAPPED" )
end
effectController:ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
for i = 0,(2-1) do
local target_card = EffectDC():Get_Targets(0):Get_CardPtr(i)
if target_card ~= nil then
target_card:PutOntoBattlefieldTapped( EffectController() )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
I'd wait for someone else to answer this... for example, sumomole should be able to tell you if you can make it "DotP2013 Cloudpost style" given that he discovered this:BloodReyvyn wrote:On an unrelated note, I was going to try to make Cabal Coffers but I am unsure of how to approach that one. Is there a better way to do this in D14 or am I going to have to make mana tokens to get it to work?
viewtopic.php?f=63&t=10951
< 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: Formal Request Thread
by Master Necro » 06 Jul 2013, 12:06
Actually you both got it right.thefiremind wrote:I thought about that too, but then I re-read the first post and understood that he wanted card requests here, too, so he could index them in the first post. It's not a bad idea, the only problem is convincing everyone to stop using the other thread for DotP2014.gorem2k wrote:I think Master Necro made this thread for reference in simplifying code mechanics.
And I have question about the dredge code, I know it said that I should replace the N with tha wanted number but that is just the localized text where do I put the number in the code, should it look like this:
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController(N))
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by Xander9009 » 06 Jul 2013, 12:16
It appears to be in the bottom section. It appears three times. Down in the resolution time actions.Master Necro wrote:And I have question about the dredge code, I know it said that I should replace the N with tha wanted number but that is just the localized text where do I put the number in the code, should it look like this:
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController(N))
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController(N))
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Master Necro » 06 Jul 2013, 12:29
No. I put it there and asked should it look like that the original code is this:Xander9009 wrote:It appears to be in the bottom section. It appears three times. Down in the resolution time actions.Master Necro wrote:And I have question about the dredge code, I know it said that I should replace the N with tha wanted number but that is just the localized text where do I put the number in the code, should it look like this:
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController(N))
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController(N))
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController(N))
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_GRAVEYARD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dredge N]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller" pre_trigger="1">
if DredgeAbilityTrigger(EffectController()) then
MTG():OverrideEvent()
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
DredgeAbilityChoice(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityResolve(EffectController())
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
DredgeAbilityDraw(EffectController())
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by sumomole » 06 Jul 2013, 12:31
Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text.Master Necro wrote:And I have question about the dredge code, I know it said that I should replace the N with tha wanted number but that is just the localized text where do I put the number in the code, should it look like this:
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by Master Necro » 06 Jul 2013, 12:32
That is waaaay cool. Thanks.sumomole wrote:Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text.Master Necro wrote:And I have question about the dredge code, I know it said that I should replace the N with tha wanted number but that is just the localized text where do I put the number in the code, should it look like this:
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by Xander9009 » 06 Jul 2013, 12:38
Somehow I managed to not catch that bit. My bad.Master Necro wrote::mrgreen: No. I put it there and asked should it look like that the original code is this:
I agree with Master Necro, that's pretty neat.sumomole wrote:Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Master Necro » 06 Jul 2013, 13:32
Also I am trying to make Necroplasm how do I code:
At the beginning of your end step, destroy each creature with converted mana cost equal to the number of +1/+1 counters on Necroplasm.
At the beginning of your end step, destroy each creature with converted mana cost equal to the number of +1/+1 counters on Necroplasm.
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by Xander9009 » 06 Jul 2013, 13:50
I'm currently trying to get Triumph of Ferocity working. After that, I'll look into it a bit more, but at a glance, try code from Advocate of the Beast for the beginning of the end step, Overwhelming Stampede for going through each creature[change "Power_Get()" for "GetConvertedManaCost()" and remove the owner requirement], and possibly Beastmaster Ascension for counting the counters [change "CountCounters(MTG():GetCountersType("Quest"))" to "CountCounters(MTG():PlusOnePlusOneCounters())"].
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by thefiremind » 06 Jul 2013, 13:58
I think this is the best way:Master Necro wrote:Also I am trying to make Necroplasm how do I code:
At the beginning of your end step, destroy each creature with converted mana cost equal to the number of +1/+1 counters on Necroplasm.
- Code: Select all
<TRIGGERED_ABILITY>
-- Localised text omitted
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_END_OF_TURN
</TRIGGER>
<FILTER filter_id="0">
local counters = EffectSourceLKI():CountCounters( MTG():PlusOnePlusOneCounters() )
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CMC, OP_IS, counters)
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():Destroy()
end
</RESOLUTION_TIME_ACTION>
<SFX text="GLOBAL_MASSACRE_PLAY" />
</TRIGGERED_ABILITY>
EDIT: Fixed typo.
Last edited by thefiremind on 06 Jul 2013, 21:44, 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: 721 times
Re: Formal Request Thread
by Xander9009 » 06 Jul 2013, 14:05
Oh, cool. I didn't know you could destroy all filtered creatures like that. Well, less "didn't know" and more "overlooked".
Anyway, what is the different between EffectSource() and EffectSourceLKI()? I've seen a few cards use the second one, but I don't know what the difference is, so I don't know when I should use one instead of the other.
Anyway, what is the different between EffectSource() and EffectSourceLKI()? I've seen a few cards use the second one, but I don't know what the difference is, so I don't know when I should use one instead of the other.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Master Necro » 06 Jul 2013, 14:33
Thanks and I have added it to the first post.thefiremind wrote:I think this is the best way:Master Necro wrote:Also I am trying to make Necroplasm how do I code:
At the beginning of your end step, destroy each creature with converted mana cost equal to the number of +1/+1 counters on Necroplasm.I'm not sure if the counters are remembered even when Necroplasm leaves the battlefield before resolution, but I think they are, that's why I used EffectSourceLKI().
- Code: Select all
<TRIGGERED_ABILITY>
-- Localised text omitted
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_END_OF_TURN
</TRIGGER>
<FILTER filter_id="0">
local counters = EffectSourceLKI():CountCounters( MTG():PlusOnePlusOneCounters() )
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CMC, OP_IS, counters)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():Destroy()
end
</RESOLUTION_TIME_ACTION>
<SFX text="GLOBAL_MASSACRE_PLAY" />
</TRIGGERED_ABILITY>
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by RiiakShiNal » 06 Jul 2013, 14:41
Both refer to the card that the effect belongs to, but EffectSourceLKI() is still valid even after the card changes zones (like goes to graveyard, exiled, returned to hand, etc...). The LKI stands for Last Known Info and LKI versions of objects are used when the object might leave play before the effect resolves, but it is important that the object still have a valid pointer and not be nil.Xander9009 wrote:Oh, cool. I didn't know you could destroy all filtered creatures like that. Well, less "didn't know" and more "overlooked".
Anyway, what is the different between EffectSource() and EffectSourceLKI()? I've seen a few cards use the second one, but I don't know what the difference is, so I don't know when I should use one instead of the other.
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: Formal Request Thread
by infernalsham » 06 Jul 2013, 16:35
How should I go about to code Aurelia's Fury? Currently basing it around the coding of Fiery Justice.
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
- infernalsham
- Posts: 17
- Joined: 27 Jun 2013, 15:54
- Has thanked: 3 times
- Been thanked: 1 time
Re: Formal Request Thread
by thefiremind » 06 Jul 2013, 16:42
Aurelia's Fury isn't so easy... I'd start with Flames of the Firebrand and do it like this:
If this doesn't work, try to substitute the first GetEffectX() with GetPaidX() since I'm not sure about the difference.
- Code: Select all
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_1_DAMAGE" definition="0" compartment="0" damage_assignment="1">
MTG():SetTargetCount( GetEffectX() )
</TARGET>
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local source = EffectSourceLKI()
local targetDC = EffectDC():Get_Targets(0)
for i=0,GetEffectX()-1 do
local target_creature = targetDC:Get_CardPtr(i)
local target_player = targetDC:Get_PlayerPtr(i)
local damage = targetDC:Get_Assignment(i)
if ( target_creature ~= nil ) then
source:DealDamageTo(damage, target_creature)
elseif ( target_player ~= nil ) then
source:DealDamageTo(damage, target_player)
end
end
</RESOLUTION_TIME_ACTION>
If this doesn't work, try to substitute the first GetEffectX() with GetPaidX() since I'm not sure about the difference.
< 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
Who is online
Users browsing this forum: No registered users and 49 guests