It is currently 18 Apr 2024, 05:57
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby thefiremind » 06 Jul 2013, 09:20

gorem2k wrote:I think Master Necro made this thread for reference in simplifying code mechanics.
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. :lol:

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.
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. :lol:

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.
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.

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>
The good thing is that now the filter for card names supports both a string and a card as parameter: if you provide a card, it will get the name from the card automatically.
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 only changed the filter so that it searches for swamps (and added the QUERY_FLAG_UP_TO that is missing in Explosive Vegetation).

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?
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:
viewtopic.php?f=63&t=10951
< 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: Formal Request Thread

Postby Master Necro » 06 Jul 2013, 12:06

thefiremind wrote:
gorem2k wrote:I think Master Necro made this thread for reference in simplifying code mechanics.
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. :lol:
Actually you both got it right. :mrgreen:

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>
User avatar
Master Necro
 
Posts: 259
Joined: 24 Apr 2013, 18:25
Has thanked: 83 times
Been thanked: 21 times

Re: Formal Request Thread

Postby Xander9009 » 06 Jul 2013, 12:16

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>
It appears to be in the bottom section. It appears three times. Down in the resolution time actions.

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
User avatar
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

Postby Master Necro » 06 Jul 2013, 12:29

Xander9009 wrote:
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>
It appears to be in the bottom section. It appears three times. Down in the resolution time actions.

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>
:mrgreen: No. I put it there and asked should it look like that the original code is 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())
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    DredgeAbilityResolve(EffectController())
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    DredgeAbilityDraw(EffectController())
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
User avatar
Master Necro
 
Posts: 259
Joined: 24 Apr 2013, 18:25
Has thanked: 83 times
Been thanked: 21 times

Re: Formal Request Thread

Postby sumomole » 06 Jul 2013, 12:31

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:
Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text. :wink:
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Formal Request Thread

Postby Master Necro » 06 Jul 2013, 12:32

sumomole wrote:
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:
Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text. :wink:
That is waaaay cool. :) Thanks.
User avatar
Master Necro
 
Posts: 259
Joined: 24 Apr 2013, 18:25
Has thanked: 83 times
Been thanked: 21 times

Re: Formal Request Thread

Postby Xander9009 » 06 Jul 2013, 12:38

Master Necro wrote::mrgreen: No. I put it there and asked should it look like that the original code is this:
Somehow I managed to not catch that bit. My bad.



sumomole wrote:Dredge value is in the .lol file, all cards use the same code, just need to need to change localized text. :wink:
I agree with Master Necro, that's pretty neat.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
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

Postby 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.
User avatar
Master Necro
 
Posts: 259
Joined: 24 Apr 2013, 18:25
Has thanked: 83 times
Been thanked: 21 times

Re: Formal Request Thread

Postby 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
User avatar
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

Postby thefiremind » 06 Jul 2013, 13:58

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 think this is the best way:
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>
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().

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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Formal Request Thread

Postby 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.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
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

Postby Master Necro » 06 Jul 2013, 14:33

thefiremind wrote:
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 think this is the best way:
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>
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().
Thanks and I have added it to the first post. :)
User avatar
Master Necro
 
Posts: 259
Joined: 24 Apr 2013, 18:25
Has thanked: 83 times
Been thanked: 21 times

Re: Formal Request Thread

Postby RiiakShiNal » 06 Jul 2013, 14:41

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.
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.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Formal Request Thread

Postby 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.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

Re: Formal Request Thread

Postby 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:
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>
I suggest to forget the side effects for a while and test this code: if you can actually assign X damage divided as you choose, the hardest part is done.
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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 27 guests

cron

Who is online

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

Login Form