It is currently 17 Oct 2018, 11:28
   
Text Size

Is there a detailed list of Static and Triggered abilities?

User-made mods in DLC (Downloadable Content) form.
Get MTG cards here for your DotP that aren't available anywhere else!

Moderators: Xander9009, CCGHQ Admins

Is there a detailed list of Static and Triggered abilities?

Postby Kieran » 25 Mar 2013, 23:02

Assassin HD.jpg
Praetor's Counsel.jpg
The reason I'm asking is because I need help coding the RTR Assassin token and Praetor's Counsel. I recently started getting all the general XML information concerning cards using thefiremind's excellent DotP2013 (web) generator found here http://www.slightlymagic.net/forum/viewtopic.php?f=99&t=9780 and after downloading the appropriate XMLs I now need to attach their abilities through copy and paste. Speaking of which, you (thefiremind) may want to add that topic to your signatures as well since it's prompted me to start creating cards. We can never have enough card makers.

Assassin1_1B.png
For the Assassin token, to implement her [Whenever this creature deals combat damage to a player, that player loses the game] triggered ability I was looking @ the Felidar Sovereign and Phage the Untouchable codes provided by this community to get an idea of how to assign the effects but I'm sure the coders and programmers here can provide me with a quicker and more suitable way to attach her ability to achieve the desired result.

praetors-counsel.jpg
As for the Praetor's Counsel I can easily copy and paste the Reliquary Tower code to get the [You have no maximum hand size] static ability but I'm really unsure how to implement the entire card text [Return all cards from your graveyard to your hand. Exile Praetor's Counsel. You have no maximum hand size for the rest of the game] effect as one code. Especially since this card is a Sorcery spell that becomes exiled after it resolves. Will I have to change it's type to an Artifact or Enchantment to make the [You have no maximum hand size for the rest of the game] result be continuous?
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby thefiremind » 25 Mar 2013, 23:49

Kieran wrote:Speaking of which, you (thefiremind) may want to add that topic to your signatures as well since it's prompted me to start creating cards. We can never have enough card makers.
I wanted to do that, but it seems that the signature has a character limit.

Kieran wrote:For the Assassin token, to implement her [Whenever this creature deals combat damage to a player, that player loses the game] triggered ability I was looking @ the Felidar Sovereign and Phage the Untouchable codes provided by this community to get an idea of how to assign the effects but I'm sure the coders and programmers here can provide me with a quicker and more suitable way to attach her ability to achieve the desired result.
If you read the text carefully, you see that the last of Phage's abilities is identical to the Assassin token's ability... so there's no quicker way than copying it from there. :D

Kieran wrote:As for the Praetor's Counsel I can easily copy and paste the Reliquary Tower code to get the [You have no maximum hand size] static ability but I'm really unsure how to implement the entire card text [Return all cards from your graveyard to your hand. Exile Praetor's Counsel. You have no maximum hand size for the rest of the game] effect as one code. Especially since this card is a Sorcery spell that becomes exiled after it resolves. Will I have to change it's type to an Artifact or Enchantment to make the [You have no maximum hand size for the rest of the game] result be continuous?
This code should be what you need:
Code: Select all
    <RESOLUTION_TIME_ACTION>
    EffectController():MoveLocalZone( ZONE_GRAVEYARD, ZONE_HAND )
    Object():SetResolutionZone( ZONE_REMOVED_FROM_GAME )
    </RESOLUTION_TIME_ACTION>
    <CONTINUOUS_ACTION layer="8">
    EffectController():GetCurrentCharacteristics():Bool_Set( PLAYER_CHARACTERISTIC_NO_HAND_LIMIT, 1 )
    </CONTINUOUS_ACTION>
    <DURATION>
    return EffectController() == nil
    </DURATION>
A card doesn't have to be a permanent to set continuous effects that last for a long time, you just have to choose an appropriate DURATION check. This effect is bound to its controller, so it has no reason to exist after its controller left the game. If you want to make an effect that lasts for the entire duel no matter what, you can write:
Code: Select all
    <DURATION>
    return false
    </DURATION>
which of course makes the duration check always fail.

About the topic title, no, there's no list and there's no valid reason to make one, because coding all the possible abilities wouldn't be much different from coding all the possible cards... both tasks would require an amount of time that a human cannot (and should not) dedicate to a game. :lol:
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 716 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 26 Mar 2013, 00:10

Lol! Thank you so much! And that's a pity you can't add additional topics to your signatures because of an enforced character limit. Your tutorials and insight have been invaluable to my modding experience. I'll give the codes a try right now and see how it goes.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 26 Mar 2013, 01:51

Okay. I tried the above-mentioned code you provided but when I cast the spell in the game none of the cards in my graveyard returned to my hand, the card didn't exile itself (it went to the graveyard), and my maximum hand size was still 7 because I had to discard cards out of my hand until I was back down to seven. Here are some screenshots from the card in the Deck Manager and also the XML showing how and where I copied and pasted your code. I'm still very new to this so I've most likely implemented it wrong.

Lastly, I also couldn't generate the Assassin token XML when searching using your web-based generator (I suspected that would happen) and I can't seem to find a Multiverse ID number for it after so much searching. Should I copy the Vraska the Unseen code from your Card Generator? Or should I just use an already-created token XML such as the BEAST token as my base for the Assassin and edit it accordingly? And if so, what would the MultiID be?
Attachments
img_009.png
img_005.png
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby RiiakShiNal » 26 Mar 2013, 02:59

You have to put the RESOLUTION_TIME_ACTION, CONTINUOUS_ACTION, and DURATION blocks inside the SPELL_ABILITY block otherwise they will not function.

When creating a token for which you can't find a multiverse id for it is always best to start from another token to use as a basis then edit as necessary. You can omit this multiverse id block and the filename does not need a multiverse id (just make sure your filename is unique). Also note that the localized text for a token needs to be all UPPERCASE or the text will not appear properly (in my experience lowercase characters appear as "M" regardless of what the lowercase character is).

You should never start from code generated for a Planeswalker as Planeswalkers are not implemented in the engine and it is just a headache to change everything to make sure it works especially when you can start from some other known good code.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2098
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 462 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 26 Mar 2013, 03:21

Awesome RiiakShiNal! I'll add the code into the Spell Ability block as per your suggestion. I'm learning more and more about modding everyday thanks to helpful people like you and the other members of this community. Also, I find it strange that the game is entitled [Magic The Gathering: Duels Of The Planeswalkers] yet their not included in the engine. Admittedly, I noticed that someone created a [Student Of Warfare] level-up card that worked as it was planned according to my limited use of it. Now, my mind is really racing! I wonder would it be possible to create Planeswalker-like cards using the code found there? Well, either way, thanks for the help and I apologize if I'm asking so many questions. I'm just too eager to learn I suppose. Kudos!
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby RiiakShiNal » 26 Mar 2013, 12:26

Leveling cards like Student of Warfare can be coded assuming all their abilities can be coded. Student of Warfare is pretty easy, Joraga Treespeaker requires mana tokens to be coded, Venerated Teacher can be coded if and only if all cards with the "level up" ability are coded in such a way as to allow another card to figure out they have that ability.

I agree that it is strange, but then again according to the story the player is a Planeswalker and is dueling another Planeswalker so that may be why. Or it could be due to historical reasons, the first Duels of the Planeswalkers was an expansion pack for the original Magic the Gathering PC game that came out in 1997 which is before Planeswalkers even existed as cards.

Planeswalkers can't be properly coded at this time due to several issues:
  • If a card is given the Planeswalker type then it does not appear during the duel.
  • If the card is given another type then all cards that refer to Planeswalkers will have to also refer to that type and all other cards that refer to the other type used will have to be re-written to exclude the fake Planeswalkers.
    • For example if you use Artifact for fake Planeswalkers then all cards with "Affinity for Artifacts", "Target Artifact", "Artifacts are", "Each Artifact", etc... will have to be changed.
  • There is currently no way to specify whether you would be attacking a player or that player's "fake" Planeswalkers.
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2098
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 462 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 26 Mar 2013, 16:50

Wow! That would be a lot of writing and re-writing. Your explanation is very detailed and goes to the heart of why attempting to code a Planeswalker card that way would be daunting. But on the bright side, your advice about adding the code into the Spell Ability block worked like a Boros charm! (I'm sure you already knew it would) After such, I decided to really look into a few codes to make Assassin's Strike and Dark Impostor.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby thefiremind » 26 Mar 2013, 17:18

You can't make Dark Impostor (or Havengul Lich, or Experiment Kraj, or Necrotic Ooze) because you can't pick whatever ability and grant it to some other creature: an ability needs to be made so that it can be granted, together with another ability that grants it.
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 716 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 26 Mar 2013, 18:50

Indeed. I was just editing my post to say I don't think it would be possible. Well, on to the next one.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 27 Mar 2013, 20:31

Okay. Here is the problem I'm having with the following cards.

Desecrated Earth.jpeg

Desecrated Earth

Here is the code I'm trying to assign to Desecrated Earth but only the first effect will trigger even if I switch their order around. The land destruction I copied from Craterize works perfectly but I can't make my opponent discard a card.

Code: Select all
<TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_DISCARD_2", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    if player ~= nil then
       local filter = Object():GetFilter()
       filter:Clear()
       filter:SetZone( ZONE_HAND )
       filter:SetPlayer( player )
       filter:NotTargetted()
       player:SetTargetCount( 2 )
       for i=0,2-1 do
          player:SetTargetPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD_2" )
       end
       player:ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(1) )
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    if player ~= nil then
       for i = 0,(2-1) do
          local target_card = EffectDC():Get_Targets(1):Get_CardPtr(i)
          if target_card ~= nil  then
             target_card:Discard()
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="TARGET_PESTS_PLAY" />
<TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetZone( ZONE_IN_PLAY )
    filter:AddCardType( CARD_TYPE_LAND )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ANY_LAND_TO_DESTROY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then   
       target:Destroy() 
    end
    </RESOLUTION_TIME_ACTION>
   <SFX text="GLOBAL_DAMNATION_PLAY" />
Assassin's Strike.jpeg

Assassin's Strike

And here is the code I'm trying to assign to Assassin's Strike but it's not working correctly regardless of which order I put this code in also. For example, when I copied the code from Murder [Destroy target creature] it triggered fine but afterwards when it tried to trigger the code copied from Mind Rot [Target player discards two cards] I can't choose the player but I can choose any card on the battlefield and click on said card to end the option. Needless to say, the player doesn't discard any cards. Oh, and I'll be changing that 'two cards' to 'one card' to maintain the official card text. I was just trying to see if the effect would trigger. Can someone take a look @ this code and tell me why?
Code: Select all
<TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY", 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_Int(1, target:GetCurrentPower())
   delayDC:Set_Int(2, target:GetCurrentToughness())
   delayDC:Set_ProtectedCardPtr(0, target)
   MTG():CreateDelayedTrigger(1, delayDC)
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       target:Destroy()
    end
    </RESOLUTION_TIME_ACTION>
    <AI_AVAILABILITY type="in_response" />
    <AI_AVAILABILITY step="begin_combat" turn="their_turn" />
    <AI_AVAILABILITY step="main_1" turn="my_turn" />
    <AI_AVAILABILITY step="declare_attackers" turn="their_turn" />
    <AI_AVAILABILITY step="declare_blockers" />
    <AI_AVAILABILITY step="end_of_turn" />
    <SFX text="TARGET_FANG_PLAY" />
<TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PLAYER_DISCARD_1", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    Discard_ResolutionTimeAction1( EffectDC():Get_Targets(0):Get_PlayerPtr(0), 1 )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    Discard_ResolutionTimeAction2( EffectDC():Get_Targets(0):Get_PlayerPtr(0), 1 )
    </RESOLUTION_TIME_ACTION>
Order of Yawgmoth.jpeg
Abyssal Specter.jpeg

With Order of Yawgmoth I simply copied the Triggered Ability of Abyssal Specter and it's working fine. I used the same method to merge the codes for the two cards above but their obviously having problems. I was going to try to make a Mindslicer card for my twin brother's deck but now I'm hesitant.
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby thefiremind » 27 Mar 2013, 22:24

Starting from the easiest things: Mindslicer actually needs less code than all the other cards because there's a specific function to discard a whole hand. Copy the code from Dragon Mage, then remove the PlayerDrawCards line and change the combat damage trigger into a "dies" trigger (copy the TRIGGER block from Abyssal Gatekeeper or any other card with a similar trigger).

For Desecrated Earth and Assassin's Strike, the first thing you need to understand is that you already have a reference to the player who will discard a card, so no need to add TARGET_DEFINITIONs, TARGET_DETERMINATIONs and PLAY_TIME_ACTIONs. You need to save the controller of what you are about to destroy before destroying it (otherwise you'll lose the target pointer because of the zone change), then make that controller discard a card.
Code: Select all
    <TARGET_DEFINITION id="0">
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_IN_PLAY )
    filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
    return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY", EffectDC():Make_Targets(0) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       EffectDC():Set_PlayerPtr( 1, target:GetController() )
       target:Destroy()
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    Discard_ResolutionTimeAction1( EffectDC():Get_PlayerPtr(1), 1 )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    Discard_ResolutionTimeAction2( EffectDC():Get_PlayerPtr(1), 1 )
    </RESOLUTION_TIME_ACTION>
This is Assassin's Strike. For Desecrated Earth, just change the target card type and the query message.

Note that Discard_ResolutionTimeAction1 (and 2) are functions that I invented, so they are defined in one of my LOL files: you'll need to always have my mod installed in order to make this card work. The good thing is that discarding 1 card, 2 cards, any number of cards with those functions is easy and bug-free (DiscardNCards, function provided by the game itself, sometimes fails).
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 716 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby Kieran » 28 Mar 2013, 00:18

Perfect! And I keep your mods and many others installed @ all times so I shouldn't run into any problems using these codes unless I find a way to screw it up again. Now then, you say that I already have a reference to the player who will discard a card so there's no need for me to add the TARGET_DEFINITIONs, TARGET_DETERMINATIONs and PLAY_TIME_ACTIONs. Does that mean that I was switching the zone before the effect could begin to take place? Also, when you say to change the target card type for Desecrated Earth I follow you 100% but I'm not familiar with changing query messages.

Moving on to the Mindslicer code.

Are you saying to change this part of the code:
Code: Select all
<TRIGGER value="CREATURE_DEALS_COMBAT_DAMAGE_TO_PLAYER" simple_qualifier="self" />
into this code:
Code: Select all
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_IN_PLAY" />
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times

Re: Is there a detailed list of Static and Triggered abiliti

Postby thefiremind » 28 Mar 2013, 09:43

Kieran wrote:Now then, you say that I already have a reference to the player who will discard a card so there's no need for me to add the TARGET_DEFINITIONs, TARGET_DETERMINATIONs and PLAY_TIME_ACTIONs. Does that mean that I was switching the zone before the effect could begin to take place?
No, it means that you didn't use the reference to the player you already had, but you asked the controller to choose a player. That's not how those cards work.

Kieran wrote:Also, when you say to change the target card type for Desecrated Earth I follow you 100% but I'm not familiar with changing query messages.
I was just saying that you need to change "CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY" to "CARD_QUERY_CHOOSE_LAND_TO_DESTROY".

Kieran wrote:Are you saying to change this part of the code:
Code: Select all
<TRIGGER value="CREATURE_DEALS_COMBAT_DAMAGE_TO_PLAYER" simple_qualifier="self" />
into this code:
Code: Select all
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_IN_PLAY" />
Yes, that's right.
< Former DotP 2012/2013/2014 modder >
Currently busy with life. Don't expect answers to PMs.
User avatar
thefiremind
Programmer
 
Posts: 3513
Joined: 07 Nov 2011, 10:55
Has thanked: 117 times
Been thanked: 716 times


Return to New MTG Cards and Decks

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 2 guests

Login Form