Page 1 of 1

Help with coding Footsteps of the Goryo and a question

PostPosted: 06 May 2013, 18:24
by spakattack
I been trying to code Footsteps of the Goryo and have run into some problems. The flavor text seems to be too long and will not show up in the game with the 2 effects. Secondly, the "Sacrifice that creature at the beginning of the next end step." doesn't work at all. I used code from Zombify and Ball Lightning. I assume it's not working because ball lightning's effect is a creature effect. Are there any cards that I can copy paste the "Sacrifice that creature at the beginning of the next end step." effect, and is there a limit on how many characters can be used in a flavor text/whole card itself?

The other problem I'm having is I would like to have multiple alternate art for a Legendary creature I'm making. I have been able to do this, however the legendary clause is not working because the <MULTIVERSEID value=, <FILENAME text=, and actual file name, are all different on each xml. Which have to be the same in order to have multiple art for the same card, and still have the legendary rule work.

Re: Help with coding Footsteps of the Goryo and a question

PostPosted: 06 May 2013, 19:59
by sumomole
spakattack wrote:I been trying to code Footsteps of the Goryo and have run into some problems.
You can request any card in here.
Code: Select all
  <SPELL_ABILITY filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Return target creature card from your graveyard to the battlefield. Sacrifice that creature at the beginning of the next end step.]]></LOCALISED_TEXT>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetPlayer( EffectController() )
    filter:SetZone( ZONE_GRAVEYARD )
    filter:SetHint( HINT_ALLIED, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
      local delayDC = EffectDC():Make_Chest(1)
      delayDC:Set_CardPtr(1, target)
      MTG():CreateDelayedTrigger(1, delayDC)
       target:PutIntoPlay( EffectController() )
    end
    </RESOLUTION_TIME_ACTION>
  </SPELL_ABILITY>
  <TRIGGERED_ABILITY resource_id="1">
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return ( MTG():GetStep() == STEP_END_OF_TURN )
    </TRIGGER>
    <CLEANUP fire_once="1" />
    <RESOLUTION_TIME_ACTION>
    local creature = EffectDC():Get_CardPtr(1)
    if creature ~= nil then
      creature:Sacrifice(EffectController())
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>

Re: Help with coding Footsteps of the Goryo and a question

PostPosted: 06 May 2013, 20:38
by spakattack
You can request any card in here.
Thanks for the code. Well I really didn't want to bother anyone with it, I wanted to try to do it myself, even though i really have no idea what I'm doing. I felt that I asked for too many cards to be coded lately, even though only 2 or 3, I just don't want to give the impression that I'm using anyone.

Do you know anything about using more than one ARTID with separate xmls with a legendary creature(or any card), but still counts as the same card?

Re: Help with coding Footsteps of the Goryo and a question

PostPosted: 06 May 2013, 22:37
by thefiremind
Shouldn't the Footsteps of the Goryo code also need a
Code: Select all
delayDC:Protect_CardPtr(1)
since you are moving the card to the battlefield?

spakattack wrote:Do you know anything about using more than one ARTID with separate xmls with a legendary creature(or any card), but still counts as the same card?
sumomole was exactly the one who discovered this problem for first: the DotP engine applies the legendary rule on the IDs rather than on the card names. You could add a special trigger that applies the legendary rule correctly:
Code: Select all
  <TRIGGERED_ABILITY internal="1">
    <TRIGGER value="STATE_BASED_EFFECTS" />
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardName( Object():GetCardName() )
    filter:AddSupertype( SUPERTYPE_LEGENDARY )
    local filter_count = filter:EvaluateObjects()
    if filter_count &gt; 1 then
       for i=0,filter_count-1 do
          local legend = filter:GetNthEvaluatedObject(i)
          if legend ~= nil then
             legend:PutInGraveyard()
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
It counts the legendary permanents with the same name as the object itself (counting the object itself too), and if they are more than 1, it puts them all into the graveyard.
If I didn't make any mistake in the code, putting this ability on just one of the versions of the legendary card should be enough (STATE_BASED_EFFECTS triggers should be used as less as possible because they basically trigger after anything that happens during the duel).

Too bad we can't exploit this engine bug to code Brothers Yamazaki... it would work as long as the 2 different versions are in play, but if only 1 is in play and it gets cloned, it would fail. :(

Re: Help with coding Footsteps of the Goryo and a question

PostPosted: 06 May 2013, 23:38
by spakattack
thefiremind wrote: sumomole was exactly the one who discovered this problem for first: the DotP engine applies the legendary rule on the IDs rather than on the card names. You could add a special trigger that applies the legendary rule correctly:
Thank you so much Firemind and Sumomole, i haven't tested this out yet, but o man it's gonna be awesome if it works. You guys are gonna love this deck I'm making. It's gonna be pretty sick, I can't wait to finish testing for bugs, that's all I can say for right now. Thanks for your help.

EDIT: I can't get the legendary code to work in game (when the same named alternate art Legendary Creature with different <MULTIVERSEID, <ARTID, <FILENAME text=(not the name of the card was changed just the number), and the xmls file number (not the name of the card just the number). enters the battlefield nothing happens), am I opposed to put it at the beginning right after the toughness line, or should I put it at the end before SFX text? I have tried putting it as the end before SFX text on just 1 card, then on all 4 cards and it won't work. I'm going to try putting it at the beginning now on one card, then on all 4 and see if it works.