Page 56 of 102

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 10:06
by Scion of Darkness
Sumomole you are sugesting to change the first line of code with te second? i didn't get it =) hehehe

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 10:19
by sumomole
Scion of Darkness wrote:Sumomole you are sugesting to change the first line of code with te second? i didn't get it =) hehehe
No, you have used both, but should only use one of them, I suggest you only use the first, because that's the official code, of course you also need to modify the associated code. :)

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 10:45
by Scion of Darkness
Can someone test this please i've rewriten the card but i can't test it right now i'm at work hehehe


Thanks

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 11:02
by sumomole
Scion of Darkness wrote:Can someone test this please i've rewriten the card but i can't test it right now i'm at work hehehe
1. Use the following code instead of your code:
Code: Select all
    <PLAY_TIME_ACTION>
    if EffectDC():Get_Int(2) == 1 then
       EffectController():ChooseTarget( 1, "CARD_QUERY_CHOOSE_CREATURE_DEAL_2_DAMAGE", EffectDC():Make_Targets(0) )
    end
    </PLAY_TIME_ACTION>
2. DiscardNCards often has bug, you can use the following code:
Code: Select all
    <RESOLUTION_TIME_ACTION>
     local decision = EffectDC():Get_Int(2)
    if decision == 2 then
      local filter = Object():GetFilter()
       filter:Clear()
       filter:NotTargetted()
       filter:SetPlayer( EffectController() )
       filter:SetZone( ZONE_HAND )
       filter:SetHint( HINT_ENEMY, EffectController() )
       EffectController():SetTargetCount(2)
       for i=0,1 do
          EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
       end
       EffectController():ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local decision = EffectDC():Get_Int(2)
    if decision == 2 then
       local targetDC = EffectDC():Get_Targets(1)             
       if targetDC ~= nil then
          for i=0,1 do
             local target_card = targetDC:Get_CardPtr(i)
             if target_card ~= nil then
                target_card:Discard()
             end
          end
       end   
    end   
    </RESOLUTION_TIME_ACTION>

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 12:53
by Scion of Darkness
Thanks just made the changes, now just need to go home and test it hehehe ;) you're a life saver, do somebody here have a giant token ;)

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 23:01
by Master Necro
Could someone check this for me, it just doesn't seem to work right:

P.S. I do have the function LOL for it if anyone asks.

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 23:22
by East Bay
Does any one have (or know of) a list of all counters supported by the engine? Just finished Vampire Hexmage but the .xml is huge so I want to remove the ones that aren't used.

I used all these counters so far:
Code: Select all
Age, Quest, Fade, Arrow, Feather, Ki, Blood, Devotion, Death, Bounty, Omen, Shred, Luck, Polyp, Poison, Mire, Depletion, Verse, Intervention, Wish, Spore, Scream, Elixir, Wind, Mining, Bribery, Tower, Hoofprint, Ice, Trasure, Divinity, Fate, Plague, Fuse, Charge, Fate, Plague, Matrix, Petal, Magnet, Winch, Study, Flood, Shell, Corpse, Soot, Fungus, Hourglass, Tide, Currency, Hatchling, Sleep, Chip, Funk, Eon, Training, Blaze, Mannequin, and Sleight.

Re: Card Creation Request Thread

PostPosted: 17 May 2013, 23:46
by East Bay
Master Necro wrote:Could someone check this for me, it just doesn't seem to work right:

P.S. I do have the function LOL for it if anyone asks.
http://www.slightlymagic.net/forum/viewtopic.php?f=63&t=7655&p=94245&hilit=signet#p94245

Your Signet:
Code: Select all
    <COST type="Mana" cost="{1}" />
   <COST type="TapSelf" />
    <PRODUCES amount="{B}{G}" />
nabeshin's Signet:
Code: Select all
      <COST type="Mana" cost="{1}"/>
      <COST type="TapSelf" />
      <RESOLUTION_TIME_ACTION>
      ProduceMana("U",1)
      ProduceMana("R",1)
      </RESOLUTION_TIME_ACTION>
2 for 1 needs mana tokens just change the letters of the colors from U/R to G/B

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 00:29
by sumomole
East Bay wrote:Just finished Vampire Hexmage but the .xml is huge so I want to remove the ones that aren't used.
If you want, you can find all counters type in my functions, but firemind has invented a better way to get the counter type, I highly recommend it. :wink:
Vampire Hexmage is easy to code, doesn't need to know any counter type. :lol:
Code: Select all
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
      for i=0,1 do
        local counter_type = target:GetBestOrWorstCounterType(i)
        while counter_type ~= 0 do
           local amount = target:CountCounters( counter_type )
           target:RemoveCounters( counter_type, amount )
            counter_type = target:GetBestOrWorstCounterType(i)
          end
       end
    end
    </RESOLUTION_TIME_ACTION>

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 04:23
by Scion of Darkness
I guess i'll need some more help the izzet charm isn't working yet, but now instead of force closing the DOTP the game just freeze but not totally, i can still concede or restart without problem =( this card is beating the crap out of me hehehe


I need professional help here

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 05:33
by sumomole
Scion of Darkness wrote:I guess i'll need some more help the izzet charm isn't working yet, but now instead of force closing the DOTP the game just freeze but not totally, i can still concede or restart without problem
Your code is ok, but there are a lot of basic errors, you should carefully check the structure of the code. :)
Izzet Charm | Open
Code: Select all
  <SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose One - Counter target noncreature spell unless its controller pays {2}; or Izzet Charm deals 2 damage to target creature; or draw two cards, then discard two cards.]]></LOCALISED_TEXT>
    <PLAY_TIME_ACTION>
    local player = EffectController()
    if player ~= nil then
       local has_first = AtLeastOneTargetFromDefinition(0)
       local has_second = AtLeastOneTargetFromDefinition(1)
      player:BeginNewMultipleChoice() 
       if has_first == 1 then
          player:AddMultipleChoiceAnswer( "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" ) 
       else
          player:AddMultipleChoiceAnswer( "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", false )
       end
       if has_second == 1 then
          player:AddMultipleChoiceAnswer( "CARD_QUERY_CHOOSE_CREATURE_DEAL_2_DAMAGE" ) 
       else
          player:AddMultipleChoiceAnswer( "CARD_QUERY_CHOOSE_CREATURE_DEAL_2_DAMAGE", false )
       end
       player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_DRAW_AND_DISCARD_TWO_CARDS" )
      player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_MODE" )
    end
    </PLAY_TIME_ACTION>
     <PLAY_TIME_ACTION>
    EffectDC():Set_Int( 2, Object():GetMultipleChoiceResult() )
    </PLAY_TIME_ACTION>
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddExtra( FILTER_EXTRA_FLIP_CARD_TYPES )
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_STACK )
    filter:SetStackObjectType( STACK_OBJECT_CARD )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DEFINITION id="1">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <PLAY_TIME_ACTION target_choosing="1">
    if EffectDC():Get_Int(2) == 0 then
       EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
    end
    </PLAY_TIME_ACTION>
    <PLAY_TIME_ACTION target_choosing="1">
    if EffectDC():Get_Int(2) == 1 then
       EffectController():ChooseTarget( 1, "CARD_QUERY_CHOOSE_CREATURE_DEAL_2_DAMAGE", EffectDC():Make_Targets(0) )
    end
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local decision = EffectDC():Get_Int(2)
    if decision == 0 then
      local target_spell = EffectDC():Get_Targets(0):Get_CardPtr(0)
      local player = target_spell:GetPlayer()
      if player ~= nil then
         if player:CanAfford("{2}") == 1 then
            player:BeginNewMultipleChoice()   
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PAY_2_MANA" )   
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_IS_COUNTERED" )   
            player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_SPELL_PIERCE" )
        end
      end        
     end   
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION >
    local decision = EffectDC():Get_Int(2)
    if decision == 0 then
      local target_spell = EffectDC():Get_Targets(0):Get_CardPtr(0)
      local player = target_spell:GetPlayer()
      local chosen = Object():GetMultipleChoiceResult()
      if player ~= nil then
        if player:CanAfford("{2}") == 1 then
          if chosen ~= 1 then
            player:TapLand("{2}")
          else
             target_spell:CounterSpell()
          end
        else
          target_spell:CounterSpell()
        end
      end
    end 
    </RESOLUTION_TIME_ACTION>
     <RESOLUTION_TIME_ACTION >
    local decision = EffectDC():Get_Int(2)
    if decision == 1 then
      local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if target_creature ~= nil then   
         target_creature:DealDamage( 2, Object() )
        end
    end
    </RESOLUTION_TIME_ACTION>
     <RESOLUTION_TIME_ACTION >
    local decision = EffectDC():Get_Int(2)
    if decision == 2 then
      local NumCards = 2
      while (NumCards &gt; 0) do
        NumCards = NumCards - 1
        EffectController():DrawCard()
       end 
     end
    </RESOLUTION_TIME_ACTION>
     <RESOLUTION_TIME_ACTION>
    local decision = EffectDC():Get_Int(2)
    if decision == 2 then
      local filter = Object():GetFilter()
      filter:Clear()
      filter:NotTargetted()
      filter:SetPlayer( EffectController() )
      filter:SetZone( ZONE_HAND )
      filter:SetHint( HINT_ENEMY, EffectController() )
      EffectController():SetTargetCount(2)
      for i=0,1 do
        EffectController():SetTargetPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
      end
      EffectController():ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local decision = EffectDC():Get_Int(2)
    if decision == 2 then
      local targetDC = EffectDC():Get_Targets(1)             
      if targetDC ~= nil then
        for i=0,1 do
          local target_card = targetDC:Get_CardPtr(i)
          if target_card ~= nil then
            target_card:Discard()
          end
        end
      end   
    end   
    </RESOLUTION_TIME_ACTION>      
    <SFX text="TARGET_LIGHTNING_PLAY" />
  </SPELL_ABILITY>

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 05:51
by Scion of Darkness
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

Edit:Just to future reference and maybe spare you some head aches can you teach me how to read the error string? Theme might be a reference to search in the card code where the error is

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 06:16
by sumomole
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.

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 08:15
by sumomole
I would like to request these cards. :mrgreen: :mrgreen: :mrgreen:

ImageImage
ImageImage

Re: Card Creation Request Thread

PostPosted: 18 May 2013, 09:37
by thefiremind
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?

sumomole wrote:I would like to request these cards. :mrgreen: :mrgreen: :mrgreen:
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.
Molten Birth could mean that they implemented coin flipping... it's possible to emulate coin flipping through random numbers in DotP2013, but calling head or tail and seeing the coin would definitely be cool. :lol: