Page 57 of 102

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 10:03
by sumomole
thefiremind wrote:Savage Summoning is good news: some time ago I tried to imagine how to code Scout's Warning (which is similar) but I got stuck on something, can't remember exactly what.
I guess Savage Summoning will give all creature card flash until you cast a creature spell, but I want it to be coded by a new way

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 12:20
by NEMESiS
sumomole wrote:I would like to request these cards. :mrgreen: :mrgreen: :mrgreen:



Those look pretty awesome. :D

Anyways, here is the link to the spoilers:

http://mythicspoiler.com/newspoilers.html

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 15:29
by Scion of Darkness
thefiremind wrote:
sumomole wrote:
Scion of Darkness wrote:Somomole Thanks you have been a real help here just one problem missing =s still freeze the game

Code: Select all
[lua] [string "IZZET_CHARM_141806_TITLE (PLAY_TIME_ACTION) [1652]"]:10:
call parameter mismatch - too many or too few a parameter count declared, method AddMultipleChoiceAnswer in class __Player
sorry to bother this much
You use the code from here?
I have tested it and work fine, haven't seen such problem.

EDIT: You'd better ask firemind or ohters for that how to read the error string, I know very little.
The error means that at line 10 of a PLAY_TIME_ACTION (with the <PLAY_TIME_ACTION> line being line #1), AddMultipleChoiceAnswer has the wrong number of parameters.
Maybe I'm totally drifting away from the solution, but I just thought of something... Scion of Darkness, are you able to use signets from other mods with no errors?:
I dont have any signet here could i be missing a lol file or something? Even grixis charm does the same

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 16:01
by thefiremind
Scion of Darkness wrote:Even grixis charm does the same
OK this is starting to make sense... which version of the game are you using? (Original, Skidrow, Theta?)

I'll anticipate what I'm guessing: before the DLCs there were no charms in the game, so the game wasn't needing the second parameter for AddMultipleChoiceAnswer that can disable the choice. I think they added this capability to the executable after one of the updates. This means that if you are using Skidrow version, which comes with no updates at all, AddMultipleChoiceAnswer can't have 2 parameters according to your executable. Either you switch to Theta, or you can't get most charms to work properly.

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 16:32
by AriesKiki
Hi, I was testing Eladamri, Lord of Leaves (created by thefiremind) and noticed the problem that it gives shroud to itself. Any way to fix that?

Code: Select all
<STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Other Elves have shroud.]]></LOCALISED_TEXT>
    <FILTER>
    return FilteredCard() ~= nil and
    FilteredCard():GetZone() == ZONE_IN_PLAY and
    FilteredCard():GetSubType():Test( CREATURE_TYPE_ELF ) ~= 0
    </FILTER>
    <CONTINUOUS_ACTION layer="6">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       if characteristics ~= nil then
          characteristics:Characteristic_Set( CHARACTERISTIC_SHROUD, 1 )
       end
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 16:38
by thefiremind
AriesKiki wrote:Hi, I was testing Eladamri, Lord of Leaves (created by thefiremind) and noticed the problem that it gives shroud to itself. Any way to fix that?
I forgot to exclude himself from the filter:
Code: Select all
    <FILTER>
    return FilteredCard() ~= nil and
    FilteredCard() ~= Object() and -- this was missing
    FilteredCard():GetZone() == ZONE_IN_PLAY and
    FilteredCard():GetSubType():Test( CREATURE_TYPE_ELF ) ~= 0
    </FILTER>

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 17:32
by Scion of Darkness
Th is might sound stupid bit is there a way to make the :x update to theta or do i have to DL the game again? You were right fire the game is skidrow version :
(

Thanks buddy

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 18:00
by thefiremind
Scion of Darkness wrote:is there a way to make the :x update to theta or do i have to DL the game again?
Yes, you can apply a Theta update (v1.0dc120919 is the last one) on Skidrow and you'll end up with a Theta version. You can find more details about it from RiiakShiNal here:
viewtopic.php?f=102&t=9304&p=110637#p110637

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 18:27
by Master Necro
Just out of interest, is Overload possible to code?

P.S. I mean the Izzet ability not the card. :mrgreen:

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 19:04
by thefiremind
Master Necro wrote:Just out of interest, is Overload possible to code?

P.S. I mean the Izzet ability not the card. :mrgreen:
Personally, I haven't been able to find a satisfying way to code it. If you search for "overload" in this topic (I think) you'll find an attempt by sumomole. I don't know how much approximated it is, though: you'll have to try and/or ask him.

Re: Card Creation Request Thread

PostPosted: 19 May 2013, 01:13
by East Bay
Can anyone tell whats wrong with Shelldock Isle I made 2 but both are still wrong:
Code: Select all
    <AVAILABILITY>
    local player = Object():GetController()
    if player == nil or player:CanAfford("{G}{G}") == 0 then
       return false
    end

    -- NOTE: The ability could be activated even if the requirement isn't met, it would just do nothing. But it would be uncomfortable for the player.
    local spell = ObjectDC() and ObjectDC():Get_CardPtr(10)
    if spell ~= nil then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:SetZone( ZONE_LIBRARY )
       filter:SetController( player )
       local filter_count = filter:EvaluateObjects()
       if filter_count &gt; 0 then
          local Library_Count = 0
          for i=0,filter_count-1 do
             Library_Count = Library_Count + filter:GetNthEvaluatedObject(i):GetCurrentLibrary()
          end
          return Library_Count &gt; 19
       end
    end
    return false
    </AVAILABILITY>
    <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local spell = ObjectDC() and ObjectDC():Get_CardPtr(10)
       if spell ~= nil then
          local filter = Object():GetFilter()
          filter:Clear()
          filter:SetZone( ZONE_LIBRARY )
          filter:SetController( player )
          local filter_count = filter:EvaluateObjects()
          if filter_count &gt; 0 then
             local Library_Count = 0
             for i=0,filter_count-1 do
                Library_Count = Library_Count + filter:GetNthEvaluatedObject(i):GetCurrentLibrary()
             end
             if Library_Count &gt; 19 then
                spell:PlayFreeFromAnywhere( player )
                ObjectDC():Free_Compartment(10)
             end
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
Code: Select all
    <AVAILABILITY>
    local player = Object():GetController()
    if player == nil or player:CanAfford("{G}{G}") == 0 then
       return false
    end

    -- NOTE: The ability could be activated even if the requirement isn't met, it would just do nothing. But it would be uncomfortable for the player.
    local spell = ObjectDC() and ObjectDC():Get_CardPtr(10)
    if spell ~= nil then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:SetZone( ZONE_LIBRARY )
       filter:SetController( player )
       local filter_count = filter:EvaluateObjects()
       if filter_count &gt; 0 then
          local CountCardsInLibrary = 0
          for i=0,filter_count-1 do
             CountCardsInLibrary = CountCardsInLibrary + filter:GetNthEvaluatedObject(i):GetCurrentLibrary()
          end
          return CountCardsInLibrary &gt; 19
       end
    end
    return false
    </AVAILABILITY>
    <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local spell = ObjectDC() and ObjectDC():Get_CardPtr(10)
       if spell ~= nil then
          local filter = Object():GetFilter()
          filter:Clear()
          filter:SetZone( ZONE_LIBRARY )
          filter:SetController( player )
          local filter_count = filter:EvaluateObjects()
          if filter_count &gt; 0 then
             local CountCardsInLibrary = 0
             for i=0,filter_count-1 do
                CountCardsInLibrary = CountCardsInLibrary + filter:GetNthEvaluatedObject(i):GetCurrentLibrary()
             end
             if CountCardsInLibrary &gt; 19 then
                spell:PlayFreeFromAnywhere( player )
                ObjectDC():Free_Compartment(10)
             end
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
And can anyone port thefireminds Infernal Tutor from 2012? I tried already but I don't know how to the Reveal and GetCardName.
Thank You guys for the work hopefully I can understand more advanced code soon #-o

Re: Card Creation Request Thread

PostPosted: 19 May 2013, 03:34
by sumomole
East Bay wrote:Can anyone tell whats wrong with Shelldock Isle I made 2 but both are still wrong
I fixed your code:
fixed | Open
Code: Select all
    <AVAILABILITY>
    for i=0,MTG():GetNumberOfPlayers()-1 do
       local player = MTG():GetNthPlayer( i )
       if player ~= nil and CountCardsInLibrary( player ) &lt; 21 then
        return ObjectDC():Get_CardPtr(10) ~= nil and Object():GetController():CanAfford("{U}{U}") ~= 0
      end
    end
    return false
    </AVAILABILITY>
    <RESOLUTION_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local spell = ObjectDC() and ObjectDC():Get_CardPtr(10)
       if spell ~= nil and spell:CanBePlayed(player) then
          local threshold = 0
        for i=0,MTG():GetNumberOfPlayers()-1 do
           if MTG():GetNthPlayer( i ) ~= nil and CountCardsInLibrary( MTG():GetNthPlayer( i ) ) &lt; 21 then
              threshold = 1
          end
        end
          if threshold == 1 then
             spell:PlayFreeFromAnywhere( player )
             ObjectDC():Free_Compartment(10)
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
But I think Hideaway should be code like this, of course, AI may not know how to use this code, so it's just a reference:
Hideaway | Open
Code: Select all
    <AVAILABILITY>
    return ObjectDC():Get_CardPtr(10) ~= nil and Object():GetController():CanAfford("{U}{U}") ~= 0
    </AVAILABILITY>
    <RESOLUTION_TIME_ACTION>
    local threshold = 0
    local num_players = MTG():GetNumberOfPlayers()
    for i=0,(num_players-1) do
       local player = MTG():GetNthPlayer( i )
       if player ~= nil and CountCardsInLibrary( player ) &lt; 21 then
        threshold = 1
      end
    end
    EffectDC():Set_Int( 20, threshold )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local spell = ObjectDC():Get_CardPtr(10)
    local threshold = EffectDC():Get_Int(20)
    local player = EffectController()
    if spell ~= nil and player ~= nil then
      local browser = EffectDC():Make_Chest(0)
      browser:Set_CardPtr(0, spell )
       player:SetTargetCount( 1 )
      if threshold == 1 then
         player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_CARD_TO_PLAY" )
       else
         player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_CARD_TO_LOOK" )
      end
       player:ChooseTargetsFromDCWithFlags( NO_VALIDATION, browser, EffectDC():Make_Targets(1), QUERY_FLAG_CAN_BE_FINISHED_EARLY + QUERY_FLAG_CAN_BE_FINISHED_EARLY_FOR_AI_AS_WELL )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local spell = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
    local threshold = EffectDC():Get_Int(20)
    local player = EffectController()
    if spell ~= nil and player ~= nil then
      if spell:CanBePlayed(player) and threshold == 1 then
        spell:PlayFreeFromAnywhere( player )
      end
    end
    </RESOLUTION_TIME_ACTION>
East Bay wrote:And can anyone port thefireminds Infernal Tutor from 2012? I tried already but I don't know how to the Reveal and GetCardName.
Infernal Tutor | Open
Code: Select all
    <RESOLUTION_TIME_ACTION>
    local filter = Object():GetFilter()
    local player = EffectController()
    if CountCardsInHand(player) &gt; 0 then
       filter:Clear()   
       filter:SetPlayer( player )   
       filter:SetZone( ZONE_HAND )   
       filter:SetHint( HINT_ALLIED, player )   
       filter:NotTargetted()     
       player:SetTargetCount( 1 )   
       player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_REVRAL", EffectDC():Make_Targets(0))   
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_hand = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    local filter = Object():GetFilter()
    local player = EffectController()
    player:MarkSearchedLibrary()
    filter:Clear()
    filter:NotTargetted()
    if target_hand ~= nil then
       target_hand:GuidedReveal( ZONE_HAND, ZONE_HAND )
      filter:AddCardName( target_hand:GetCardName())
    end
    filter:May()
    filter:SetZone( ZONE_LIBRARY )
    filter:SetPlayer( player )
    player:SetTargetCount( 1 )
    player:ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CARD_TO_PUT_IN_HAND", EffectDC():Make_Targets(1))
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_hand = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    local target_search = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
    if target_search ~= nil then
      if target_hand ~= nil then
          target_search:GuidedReveal( ZONE_LIBRARY, ZONE_HAND )
       end
       target_search:PutInHand()
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    EffectController():ShuffleLibrary()
    </RESOLUTION_TIME_ACTION>

Re: Card Creation Request Thread

PostPosted: 19 May 2013, 05:24
by East Bay
I edit that from thefiremind's Windbrisk Heights so maybe he want to change the hideaway but thank you for all the cards now storm is complete.

Re: Card Creation Request Thread

PostPosted: 19 May 2013, 17:41
by East Bay
sumomole wrote:But I think Hideaway should be code like this, of course, AI may not know how to use this code, so it's just a reference:
I think Hideaway is wrong they say the spell is "Cast" here: http://forums.mtgsalvation.com/showthread.php?t=382272
Who can confirm do we get the triggered ability?
Edit-Oops nvm just test on Emakul trigger works!

Re: Card Creation Request Thread

PostPosted: 19 May 2013, 17:52
by NEMESiS
What am I doing wrong with Skull rend? It seems to also target me when discarding:

Code: Select all
    <FILTER>
    return (FilteredPlayer() ~= nil
    and FilteredPlayer():GetTeam() ~= Object():GetPlayer():GetTeam())
    </FILTER>
    <RESOLUTION_TIME_ACTION>
    if (FilteredPlayer() ~= nil) then
       FilteredPlayer():DealDamage(2, Object())
    elseif (FilteredCard() ~= nil) then
       FilteredCard():DealDamage(2, Object())
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    for i=0,MTG():GetNumberOfPlayers()-1 do
       local nthPlayer = MTG():GetNthPlayer(i)
       if (nthPlayer:GetTeam() ~= Object():GetPlayer():GetTeam()) ~= nil then
          local NumCards = 2
          while (NumCards &gt; 0) do
             NumCards = NumCards - 2
             nthPlayer:DiscardRandomCard()
          end
       end
    end
    </RESOLUTION_TIME_ACTION>