It is currently 13 Jun 2025, 11:38
   
Text Size

Duels of the Planeswalkers 2013

New decks and cards for Stainless Games' release

Moderator: CCGHQ Admins

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 06 Jul 2012, 11:06

Well, you are making a creature enter the battlefield, so you are probably triggering Soul Warden and other similar effects.
< 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby sadlyblue » 06 Jul 2012, 11:58

thefiremind wrote:Well, you are making a creature enter the battlefield, so you are probably triggering Soul Warden and other similar effects.
I have to agree. Unless you find a way to not trigger comes-into-play abilities i would rather have a creature coded with the abilities for both sides, and then enable and disable then depending on what side (and change all other characteristics). The only things we can't change is image (we can live with that) and mana cost (this could be troublessome when interacting with Ratchet Bomb for example).

Btw, whats MTG():ObjectDataChest_NoJIT()? Only 2 cards use it, and it's used on zonechange transition.
sadlyblue
 
Posts: 175
Joined: 06 Feb 2012, 13:18
Has thanked: 18 times
Been thanked: 16 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 06 Jul 2012, 12:23

sadlyblue wrote:Btw, whats MTG():ObjectDataChest_NoJIT()? Only 2 cards use it, and it's used on zonechange transition.
Good question. "JIT" usually stands for "Just-In-Time", but I don't know what it means in this context.

Something that should be worth trying is to make a special copy of the Clone card that somehow gives us feedback about what's inside the data chest that has been used to store the copiable values. Maybe we can write inside it manually.
EDIT: I actually tried it, but it doesn't contain integers nor card pointers. That chest is probably filled with something of lower level that we cannot access.
< 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby Aiodren » 06 Jul 2012, 14:41

You two are probably right... I reduced the problem a bit by adding the creature types after the transformation so cards like Champion of the Parish don't trigger, but that's still no solution. I could swear there was something like a "doesn't trigger comes into play abilities" in dotp 2012 but i could be very wrong and you most likely know better then me.
However i will try to improve the concept further until it's working better or someone implements a better solution in a mod.
Aiodren
 
Posts: 45
Joined: 27 Jun 2012, 07:02
Has thanked: 5 times
Been thanked: 4 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 06 Jul 2012, 15:10

Aiodren wrote:I reduced the problem a bit by adding the creature types after the transformation so cards like Champion of the Parish don't trigger, but that's still no solution.
You know what? You could be on your way to a great solution. Try to remove the card type from the token and add that after the transformation, too. A token without types is invisible (that's the trick for making invisible tokens, in case someone didn't know it yet), but if it's in play, I think that it can be copied.
< 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby Aiodren » 06 Jul 2012, 17:11

thefiremind wrote:You know what? You could be on your way to a great solution. Try to remove the card type from the token and add that after the transformation, too. A token without types is invisible (that's the trick for making invisible tokens, in case someone didn't know it yet), but if it's in play, I think that it can be copied.
I actually tried that, but i couldn't target it (naturally) because it's invisible and didn't think about it again. But now that you mention it, i could try to target it with a filter, instead of targetting it manually. I will try that, thanks for the pointer :D
Aiodren
 
Posts: 45
Joined: 27 Jun 2012, 07:02
Has thanked: 5 times
Been thanked: 4 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 06 Jul 2012, 23:35

Aiodren wrote:I actually tried that, but i couldn't target it (naturally) because it's invisible and didn't think about it again. But now that you mention it, i could try to target it with a filter, instead of targetting it manually. I will try that, thanks for the pointer :D
Can't you just get the token and put it into play using:
Code: Select all
local oNewToken = MTG():ObtainToken("[Token Name]", EffectController())
oNewToken:PutIntoPlay(EffectController())
Then once it is in play get the copiable values? If you do it that way then I don't think you'll need to target it at all because you'll have a local variable pointing to it.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 06 Jul 2012, 23:49

RiiakShiNal wrote:
Aiodren wrote:I actually tried that, but i couldn't target it (naturally) because it's invisible and didn't think about it again. But now that you mention it, i could try to target it with a filter, instead of targetting it manually. I will try that, thanks for the pointer :D
Can't you just get the token and put it into play using:
Code: Select all
local oNewToken = MTG():ObtainToken("[Token Name]", EffectController())
oNewToken:PutIntoPlay(EffectController())
Then once it is in play get the copiable values? If you do it that way then I don't think you'll need to target it at all because you'll have a local variable pointing to it.
Yes, just make sure you put the token into play in an action, and you read the copiable values in another action. DotP2013 gets pretty upset if you don't let it check state-based effects between a zone change and a reading of what changed zone. :lol:
< 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 07 Jul 2012, 00:35

thefiremind wrote:Yes, just make sure you put the token into play in an action, and you read the copiable values in another action. DotP2013 gets pretty upset if you don't let it check state-based effects between a zone change and a reading of what changed zone. :lol:
Which of course is not difficult, you just copy the pointer into the EffectDC() using either Set_CardPtr(Index, Object) or Set_ProtectedCardPtr(Index, Object). Then read it in the next action using Get_CardPtr(Index) or Get_ProtectedCardPtr(Index).
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby Aiodren » 07 Jul 2012, 06:27

Guys you are absolutely amazing! :D With your suggestions i could do it! The game does not crash, trigger effects do not trigger (because the token is not a creature) and the transformation works!

Here is the code of my Delver and the token for reference:
Code: Select all
<?xml version='1.0'?>
<CARD_V2 custom="true">
  <FILENAME text="DELVER_OF_SECRETS_888819897" />
  <CARDNAME text="DELVER_OF_SECRETS" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Delver Of Secrets]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Geheimnisstöberer]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Delver Of Secrets]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Delver Of Secrets]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Delver Of Secrets]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Delver Of Secrets]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="888819897" />
  <ARTID value="DELVER OF SECRETS" />
  <FRAMECOLOUR name="U" />
  <COLOUR value="U" />
  <ARTIST name="Nils Hamm" />
  <CASTING_COST cost="{U}" />
  <TYPE metaname="Creature" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
  <SUB_TYPE metaname="Human" order_de-DE="0" order_es-ES="1" order_fr-FR="0" order_it-IT="1" order_jp-JA="0" />
  <SUB_TYPE metaname="Wizard" order_de-DE="1" order_es-ES="0" order_fr-FR="1" order_it-IT="0" order_jp-JA="1" />
  <EXPANSION value="ISD" />
  <RARITY metaname="C" />
  <POWER value="1" />
  <TOUGHNESS value="1" />
  <TOKEN_REGISTRATION reservation="5" type="INSECTILE_ABERRATION_888819898" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery is revealed this way, transform Delver of Secrets.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery is revealed this way, transform Delver of Secrets.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Schaue dir zu Beginn deines Versorgungssegments die oberste Karte deiner Bibliothek an. Du kannst diese Karte offen vorzeigen. Falls auf diese Weise eine Spontanzauber- oder Hexerei-Karte vorgezeigt wird, transformiere den Geheimnisstöberer.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery is revealed this way, transform Delver of Secrets.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery is revealed this way, transform Delver of Secrets.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[At the beginning of your upkeep, look at the top card of your library. You may reveal that card. If an instant or sorcery is revealed this way, transform Delver of Secrets.]]></LOCALISED_TEXT>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY" active_zone="ZONE_TRANSITION">
    <TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    local oNewToken = MTG():ObtainToken("INSECTILE_ABERRATION_888819898", EffectController())
     oNewToken:PutIntoPlay(EffectController())
     ObjectDC():Set_ProtectedCardPtr(53, oNewToken)
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY filter_zone="ZONE_IN_PLAY" active_zone="ZONE_IN_PLAY">
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    local target_creature = ObjectDC():Get_ProtectedCardPtr(53)
    if ( target_creature ~= nil ) then   
       target_creature:StoreCopiableValues(ObjectDC():Make_Chest(1))   -- this grabs the copiable values from the target and puts them into a datachest
       EffectSource():UseCopiableValues(ObjectDC():Get_Chest(1))      -- this needs to be here to refire any other transition triggers (e.g. devour)
       ObjectDC():Protect_CardPtr( COMPARTMENT_ID_EFFECT_SOURCE )      -- this stops the effect from being wiped when we complete the zonechange
    end
    if ObjectDC():Get_Chest(1) ~= nil then
        target_creature:RemoveFromGame()
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil and ObjectDC():Get_Chest(1) ~= nil then
       MTG():ObjectDataChest():Int_Set( 52, 1 )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
    <CONTINUOUS_ACTION layer="1">
    local characteristics = Object():GetCurrentCharacteristics()
    if MTG():ObjectDataChest():Int_Get( 52 ) == 1 then
       EffectSource():UseCopiableValues(ObjectDC():Get_ProtectedCardPtr( COMPARTMENT_ID_EFFECT_SOURCE ))
      characteristics:GrantAbility(1)
    end
    if MTG():ObjectDataChest():Int_Get( 52 ) == 2 then
        EffectSource():UseCopiableValues(ObjectDC():Get_Chest(1))
        characteristics:CardType_GetWritable( EffectSource() ):Add( CARD_TYPE_CREATURE , EffectSource() )
        characteristics:SubType_GetWritable( EffectSource() ):Add( CREATURE_TYPE_HUMAN , EffectSource() )
        characteristics:SubType_GetWritable( EffectSource() ):Add( CREATURE_TYPE_INSECT , EffectSource() )
    end
    if MTG():ObjectDataChest():Int_Get( 52 ) ~= 1 and MTG():ObjectDataChest():Int_Get( 1 ) ~= 2 then     
        return
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <TRIGGERED_ABILITY resource_id="1" filter_zone="ZONE_IN_PLAY">
    <TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
    return (MTG():GetStep() == STEP_UPKEEP and EffectController():MyTurn() ~= 0 and TriggeredForMe())
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
      local card = EffectController():Library_GetNth(0)
        if card ~= nil and (card:GetCardType():Test(CARD_TYPE_INSTANT) == 1 or card:GetCardType():Test(CARD_TYPE_SORCERY) == 1) then
         card:GuidedReveal( ZONE_LIBRARY, ZONE_LIBRARY )
         card:PutInLibrary(0)
                  MTG():ObjectDataChest():Int_Set( 52, 2 )
        else
                  card:PutInLibrary(0)
        end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
</CARD_V2>
Code: Select all
<?xml version='1.0'?>
<CARD_V2 custom="true">
  <FILENAME text="INSECTILE_ABERRATION_888819898" />
  <CARDNAME text="INSECTILE_ABERRATION" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Insectile Aberration]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Insekten-Scheußlichkeit]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Insectile Aberration]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Insectile Aberration]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Insectile Aberration]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Insectile Aberration]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="888819898" />
  <ARTID value="INSECTILE ABERRATION" />
  <FRAMECOLOUR name="U" />
  <COLOUR value="U" />
  <ARTIST name="Nils Hamm" />
  <CASTING_COST cost="" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA["Unfortunately, all my test animals have died or escaped, so I shall be the final subject. I feel no fear. This is a momentous night." —Laboratory notes, final entry]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Leider sind alle meine Versuchstiere gestorben oder entflohen, daher bin ich selber das letzte Testobjekt. Ich habe keine Angst. Dies ist eine bedeutsame Nacht." —Versuchsnotizen, letzter Eintrag]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA["Unfortunately, all my test animals have died or escaped, so I shall be the final subject. I feel no fear. This is a momentous night." —Laboratory notes, final entry]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA["Unfortunately, all my test animals have died or escaped, so I shall be the final subject. I feel no fear. This is a momentous night." —Laboratory notes, final entry]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA["Unfortunately, all my test animals have died or escaped, so I shall be the final subject. I feel no fear. This is a momentous night." —Laboratory notes, final entry]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA["Unfortunately, all my test animals have died or escaped, so I shall be the final subject. I feel no fear. This is a momentous night." —Laboratory notes, final entry]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
  <SUB_TYPE metaname="" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
  <EXPANSION value="ISD" />
  <RARITY metaname="C" />
  <POWER value="3" />
  <TOUGHNESS value="2" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    characteristics:Characteristic_Set( CHARACTERISTIC_FLYING, 1 )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
</CARD_V2>
Aiodren
 
Posts: 45
Joined: 27 Jun 2012, 07:02
Has thanked: 5 times
Been thanked: 4 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 07 Jul 2012, 09:54

Aiodren wrote:Guys you are absolutely amazing! :D
You are the one who's amazing... the idea of ripping off types from the token is yours. :D

I'll probably make some tweaks to the code, so that all transform cards are compatible with Immerwolf and Moonmist (which isn't obvious) and maybe I'll make some preconstructed functions that will make the code shorter. But the big step ahead has been already made. =D>
< 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby Aiodren » 07 Jul 2012, 10:17

thefiremind wrote:
Aiodren wrote:Guys you are absolutely amazing! :D
You are the one who's amazing... the idea of ripping off types from the token is yours. :D

I'll probably make some tweaks to the code, so that all transform cards are compatible with Immerwolf and Moonmist (which isn't obvious) and maybe I'll make some preconstructed functions that will make the code shorter. But the big step ahead has been already made. =D>
Feel free to improve the code in any way you want :)
Aiodren
 
Posts: 45
Joined: 27 Jun 2012, 07:02
Has thanked: 5 times
Been thanked: 4 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 07 Jul 2012, 19:22

I still have to make tests with Werewolves, that go back and forth between transformations, and with Moonmist, anyway here's the result of my latest improvements.

Transform2013.zip
Delver of Secrets / Insectile Aberration, illustrations, and handy functions (Version 2)
(223.98 KiB) Downloaded 425 times

The code has been reduced, and there are functions that make transform easier inside TRANSFORM_MECHANIC.LOL. Most of them just do the usual things, but I added a level of customization inside the LOL file. As you may already know, the card sub-types have "order" tags, one for each language, that decide in which order the sub-types should be displayed on the card according to the game language. With very few exceptions, the order follows the same rules on each card: reversed for Italian and Spanish, and normal for the other languages. This ordering wouldn't be possible if we add the sub-types from inside a function... but I defined a constant called IT_ES_ORDER inside the LOL file. If you set the constant to 1, the function ApplyTransformation will apply the sub-types in reversed order!
Look at the code for Delver of Secrets and you'll understand how to use those functions.

P.S.: I also made the two cards completely localised, and changed the Multiverse IDs to the official ones.
Last edited by thefiremind on 08 Jul 2012, 09:13, 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: 722 times

Re: Duels of the Planeswalkers 2013

Postby RiiakShiNal » 07 Jul 2012, 20:01

thefiremind wrote:I have good news! I tried to make a test creature with the following ability:
Code: Select all
  <STATIC_ABILITY>
    <CONTINUOUS_ACTION>
    local characteristics = Object():GetCurrentCharacteristics()
    for i=53,100 do
       characteristics:Characteristic_Set( i, 1 )
    end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
And no badge popped out on it! That means that characteristics aren't circular as the badges in DotP2012, so we won't have limits on inventing new characteristics!
We probably won't be able to associate new characteristics to new badges, though... unless someone discovers how to do it... :P
I know I'm resurrecting an old post in this topic, but I have some new information on this, which is a mixed bag.

First, while setting characteristics works only a handful of them can actually be detected. I found this out by putting the below (with different values for nRange) on a creature and checking the results (RSN_AddCharacteristic() and RSN_HasCharacteristic() are a couple of helper functions I created to make things a bit easier and I have included them in a separate code block so they can be examined).
Code: Select all
<CONTINUOUS_ACTION>
   local nRange = 60
   local i = nRange
   while (i &lt; (nRange + 10))do
      RSN_AddCharacteristic( Object(), i )
      i = i + 1
   end
</CONTINUOUS_ACTION>
<CONTINUOUS_ACTION layer="7C">
   local nRange = 60
   local i = nRange
   local nNum = 0
   while (i &lt; (nRange + 10))do
      if (RSN_HasCharacteristic( Object(), i )) then
         nNum = nNum + 2^(i - nRange)
      end
      i = i + 1
   end
   RSN_AddPowerAndToughness( Object(), nNum, 0 )
</CONTINUOUS_ACTION>
Code: Select all
RSN_AddCharacteristic = function( oSubject, nCharacteristic )
   if (oSubject ~= nil) then
      local oCharacteristics = oSubject:GetCurrentCharacteristics()
      if (oCharacteristics ~= nil) then
         oCharacteristics:Characteristic_Set( nCharacteristic, 1 )
      end
   end
end

RSN_HasCharacteristic = function( oSubject, nCharacteristic )
   if (oSubject ~= nil) then
      local oCharacteristics = oSubject:GetCurrentCharacteristics()
      if (oCharacteristics ~= nil) then
         return oCharacteristics:Characteristic_Get( nCharacteristic ) ~= 0
      else
         return false
      end
   else
      return false
   end
end
The results I got (testing through characteristic 299) are as follows:
Can be set and detected: 53, 55, 57, 61-69, 75-79, 99, 100, 107, 108, 111-113, 115-117, 125, 126, 129-131, 133-135, 140, 141, 147-149, 151-154, 161, 162, 165-167, 169-171, 181, 184, 185, 187, 204, 207, 211, 215, 225, 230, 236, 283, 285, 293.

All others can be set, but can not be detected.

I also sporadically tested higher ranges with the same mixed bag, some ranges work fine while others can't be detected. Characteristics seem to be using a 24-bit unsigned integer (if you try nRange = 16777210 game will crash) so 16777215 seems to be the last possible characteristic value. So anyone making their own characteristics will need to be careful and double check that if they need to detect their characteristic that it actually can be detected. While testing I noticed no wrap-around to the lower characteristics.

I still have not been able to associate/create new badges.

Edit: Another quick note which people may or may not have already known ObjectDC() and Object():GetDataChest() both refer to the same object so it should be possible to access other cards Object Data Chest from a different card.

Edit 2: When testing the negative case (not setting the characteristic then trying to detect it) I discovered that it gives the same results which means we have NO free characteristics to work with. :cry:
Last edited by RiiakShiNal on 08 Jul 2012, 11:31, edited 1 time in total.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Duels of the Planeswalkers 2013

Postby thefiremind » 08 Jul 2012, 08:33

RiiakShiNal wrote:Edit: Another quick note which people may or may not have already known ObjectDC() and Object():GetDataChest() both refer to the same object so it should be possible to access other cards Object Data Chest from a different card.
Yes, I know that: I used that feature in the transform mechanic.

About the transform mechanic, there's a thing I was forgetting: the interaction with cloning! The right behaviour would be that the clone copies the current state of the transform card and won't be able to transform into the other. With the code I made, I'm afraid that 2 bad things will happen:
1) Cloning a non-transformed card will allow the clone to transform itself, too.
2) Cloning a transformed card will end in a disaster, because the clone will probably ignore the added types.
The problem #1 should be easily solved by making the comes-into-play trigger a delayed one, that will be created on ZONECHANGE_BEGIN, so that the clone won't be able to trigger it. The problem #2 would be very annoying, and I have a couple of possible solutions in mind but I'm not sure about them. I'll make more tests.

EDIT: It seems I was worried for nothing... none of the 2 problems actually exist. That's strange... the game is smarter than I thought. :lol:
Anyway, I made some small tweaks that should make the code cleaner.
I also made Delver of Secrets more "test-friendly": if you want to test the transformation, it's annoying to include instants or sorceries in the test deck... so comment the associations of type1 and type2 to instant and sorcery, and uncomment the associations to creature and land. With a deck full of lands and Delver of Secrets, you'll be able to transform it 100% of the times. :lol:

EDIT 2: If you want to be a perfectionist (like me :lol:), you can make it so that a clone will spawn no tokens at all:
Code: Select all
  <TRIGGERED_ABILITY internal="1" active_zone="ZONE_ANY">
    <TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    MTG():CreateDelayedTrigger(10, nil)
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TOKEN_REGISTRATION reservation="1" type="INSECTILE_ABERRATION_226755" />
  <TRIGGERED_ABILITY resource_id="10" forced_skip="1" filter_zone="ZONE_IN_PLAY">
    <CLEANUP fire_once="1" />
    <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
    <RESOLUTION_TIME_ACTION>
    GetTransformData_Step1("INSECTILE_ABERRATION_226755")
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    GetTransformData_Step2()
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Since ZONECHANGE_BEGIN happens before ZONECHANGE_TRANSITION, the clones will never fire the delayed trigger, and won't even set their register to IS_NOT_TRANSFORMED (so you can check if a card is actually a transform card: it's not necessary for now, but who knows... :wink:).
< 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: 722 times

PreviousNext

Return to Magic: The Gathering - Duels of the Planeswalkers

Who is online

Users browsing this forum: No registered users and 8 guests


Who is online

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

Login Form