It is currently 18 May 2013, 21:07
   
Text Size

Why doesn't this work?

Moderator: CCGHQ Admins

Why doesn't this work?

Postby Eglin » 06 Mar 2012, 04:15

Hi guys,

I'm still struggling to wrap my mind around the card programming paradigm. I'm hoping that you can help me figure out why my code for Gilt-Leaf Palace isn't working. Here's what I've got:
Code: Select all
  <TRIGGERED_ABILITY internal="1" pre_trigger="1">
     <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Gilt-Leaf Palace enters the battlefield, you may reveal an Elf card from your hand. If you don't, Gilt-Leaf Palace enters the battlefield tapped.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
    <TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
    <TARGET_DETERMINATION>
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddCardType( CARD_TYPE_CREATURE )
    filter:AddSubType( CREATURE_TYPE_ELF )
    filter:SetPlayer( Object():GetPlayer() )
    filter:SetZone( ZONE_HAND )
    filter:NotTargetted()
    filter:May()
    return TargetGoodF()
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
    ChooseTarget( "CARD_QUERY_CHOOSE_CARD_TO_REVEAL" )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local player = Object():GetPlayer()
    local target = Object():GetTargetCard()
    if player ~= nil and target ~= nil then
         target:GuidedReveal(ZONE_HAND, ZONE_HAND)
         player:GainLife( cmc )
    else
      if TriggerObject() ~= nil then
        TriggerObject():ComesIntoPlayTapped()
      end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
At present, the card comes into play tapped, shimmers briefly in blue, and that's it. It doesn't matter whether an elf is held in hand or not.

I'm also trying to implement the changeling keyword, as used in Crib Swap, Chameleon Colossus, et al. Here's what I'm working with:
Code: Select all
  <STATIC_ABILITY layer="4">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|Changeling|]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
   local shapeshifter_subtypes = Object():GetCurrentCharacteristics():SubType_GetWritable(Object())
   for i=CREATURE_TYPE_HUMAN,CREATURE_TYPE_PRAETOR do
       shapeshifter_subtypes:Add( i, Object() )
   end
    </CONTINUOUS_ACTION>
    <FILTER>
    return (FilteredCard() ~= nil and FilteredCard() == Object() )
    </FILTER>
  </STATIC_ABILITY>
This works fine once the card hits play, but I can't seem to figure out how to make it work for cards still in the hand or library. Adding zone/active_zone="any" just causes the game to crash when loading the deck up. Is there some way to do this short of adding /all/ the static identifiers to the card's XML? I'd guess that the static_ability method is better for the MTG's mechanics, but I don't see how to make it work.

Thanks in advance!
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby thefiremind » 06 Mar 2012, 09:39

About Gilt-Leaf Palace, it says "As [it] enters the battlefield", so the first thing to do is to look at how another similar mechanic is coded. A good example is devour, so if you look at Voracious Dragon code, you see that the trigger has the following characteristics:
Code: Select all
<TRIGGERED_ABILITY auto_skip="1" active_zone="any">
and
Code: Select all
<TRIGGER value="COMING_INTO_PLAY" simple_qualifier="self" />
Just for a start, try using the same tags on your card.

About the changeling, you already had a very good idea that makes it work in play, I have never thought about it. But I'm afraid the game can't let it work in other places. One thing you can change for sure: the <FILTER> is useless since you don't mention FilteredCard in the action. I don't think it will make the code work, but try removing it.
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1630
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 357 times

Re: Why doesn't this work?

Postby Persee » 06 Mar 2012, 10:05

For Gilt-Leaf Palace, tribal elf card like Eyeblight's Ending can be reveal.
User avatar
Persee
 
Posts: 151
Joined: 02 Jun 2011, 08:33
Has thanked: 35 times
Been thanked: 23 times

Re: Why doesn't this work?

Postby Eglin » 06 Mar 2012, 15:41

Thanks for chiming in, guys. I always appreciate that you point out similar card mechanics, but unfortunately I'm still too confused on too many points to be able to translate. Learning a programming language by trial and error is an awful way to learn! I need to learn things like: <resolution_time_action> must always appear before <play_time_action> - what things can you do in one that you can't do in the other? I notice that there are about four ways to choose a target - <target determination> blocks, <filters>, prompting a player, etc - I haven't learned why some are more appropriate than others in any given instance. It's all a bit overwhelming - although I feel like I'm probably making progress, it is very slow and painful.

Anyway, I did manage to get the two cards in question to work. As it happens, the changeling keyword was already working. I introduced the game-crashing bug while fiddling with Fertile Ground, and mistakenly assumed the blame fell w/ the changeling code. You were right, FireMind, about the filter block being unnecessary - for some reason I had it in mind that it would determine who to apply the continuous block to. Setting zone="any" also appears to work - I can grab either with a Treefolk Harbinger, and the Chameleon Colossus properly responds to a Timber Protector while in play. I /think/ that the game treats them as valid reveals for Murmuring Bosk as well, although I'm not positive that I tested this. I haven't checked whether it works in the graveyard at all, but I'm guessing it will work just fine.

For any interested parties, this is what my current changeling code looks like:
Code: Select all
  <STATIC_ABILITY layer="4" zone="any">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[|Changeling|]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
   local shapeshifter_subtypes = Object():GetCurrentCharacteristics():SubType_GetWritable(Object())
   for i=CREATURE_TYPE_HUMAN,CREATURE_TYPE_PRAETOR do
       shapeshifter_subtypes:Add( i, Object() )
   end
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
If additional creature sub-types are added to the game, they'd have to be included here as well.

Here is what my current Murmering Bosk looks like:
Code: Select all
  <TRIGGERED_ABILITY forced_skip="1">
     <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Murmuring Bosk enters the battlefield, you may reveal a Treefolk card from your hand. If you don't, Murmuring Bosk enters the battlefield tapped.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
     <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
    <TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
   <PLAY_TIME_ACTION>
   -- count the number of elves caster has in hand
    local filter = Object():GetFilter()
    filter:Clear()
    filter:AddSubType( CREATURE_TYPE_TREEFOLK )
    filter:SetPlayer( Object():GetPlayer() )
    filter:SetZone( ZONE_HAND )
   local num_folk = filter:Count()
   
   -- ask whether or not to reveal one
    local player = Object():GetPlayer()
   if num_folk ~= 0 then
        player:BeginNewMultipleChoice()
        player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_YES" )
        player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_NO" )
       --todo fix string
        player:AskMultipleChoiceQuestion( "CARD_QUERY_REVEAL_TREEFOLK" )
   end
    MTG():ObjectDataChest():Set_Int(1, num_folk)
    </PLAY_TIME_ACTION>
    <PLAY_TIME_ACTION>
   local num_folk = MTG():ObjectDataChest():Get_Int(1)
   local chosen_reveal = 0
   if num_folk ~= 0 then
        if Object():GetMultipleChoiceResult() == 0 then
          chosen_reveal = 1
        end
   end
    MTG():ObjectDataChest():Set_Int(2, chosen_reveal)
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
     local filter = Object():GetFilter()
     local player = Object():GetPlayer()
     local chosen_reveal = MTG():ObjectDataChest():Get_Int(2)
    if chosen_reveal ~= 0 then
         filter:Clear()
         filter:NotTargetted()
        filter:SetPlayer( player )
        filter:AddSubType( CREATURE_TYPE_ELF )
                     filter:SetZone( ZONE_HAND )
        player:SetTargetCount(1)
        player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_CARD_TO_REVEAL")
       player:ChooseTargets()
   end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
     local chosen_reveal = MTG():ObjectDataChest():Get_Int(2)
    local num_folk = MTG():ObjectDataChest():Get_Int(1)
    if chosen_reveal ~= 0 and num_folk ~= 0 then
      for i=0, (Object():GetNumberOfTargets() - 1) do
         local card = Object():GetNthTargetCard(i)
         if card ~= nil then
            card:GuidedReveal( ZONE_HAND, ZONE_HAND )
         end
      end
    else
       if TriggerObject() ~= nil then
           TriggerObject():Tap()
        end
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Persee wrote:For Gilt-Leaf Palace, tribal elf card like Eyeblight's Ending can be reveal.
Yeah - it's even more interesting when you have cards like Crib Swap that are tribal changelings. They can answer to Gilt-Leaf Palace /and/ Murmuring Bosk. I didn't realize until I looked up Eyeblight's Ending, however, that tribal is not a supertype, but an additional card type. For the most part, the distinction is unimportant, but it would make a difference for things like Tarmogoyf.

Thanks again, guys.

(edit: hours later, reworked logic a tad and added force_skip flag to prevent tapping the land for mana before it comes into play tapped!)
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby thefiremind » 06 Mar 2012, 23:52

I'm glad you made Changeling work! Now you could also add to the same CONTINUOUS_ACTION:
Code: Select all
Object():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CHANGELING, 1 )
it will have no effect at all (I tried it!)... but since the keyword exists, you have the chance to use it. I can't remember a card that cares if another card has changeling (if it actually exists), but it could open a way for custom cards. :wink:
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1630
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 357 times

Re: Why doesn't this work?

Postby Eglin » 07 Mar 2012, 18:28

thefiremind wrote:I'm glad you made Changeling work! Now you could also add to the same CONTINUOUS_ACTION:
Code: Select all
Object():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CHANGELING, 1 )
it will have no effect at all (I tried it!)... but since the keyword exists, you have the chance to use it. I can't remember a card that cares if another card has changeling (if it actually exists), but it could open a way for custom cards. :wink:
Hey, that's a fantastic idea! I will need to create a functions.lol or something to define the value, yes? Could I even go so far as to create a corresponding badge and set/remove the changeling characteristic and badge on the fly?
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby thefiremind » 07 Mar 2012, 21:26

Eglin wrote:
thefiremind wrote:I'm glad you made Changeling work! Now you could also add to the same CONTINUOUS_ACTION:
Code: Select all
Object():GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_CHANGELING, 1 )
it will have no effect at all (I tried it!)... but since the keyword exists, you have the chance to use it. I can't remember a card that cares if another card has changeling (if it actually exists), but it could open a way for custom cards. :wink:
Hey, that's a fantastic idea! I will need to create a functions.lol or something to define the value, yes? Could I even go so far as to create a corresponding badge and set/remove the changeling characteristic and badge on the fly?
No, the constant is already inside the LOL files, that's why I suggested to use it. You just have to add the code I wrote and that's all. The badge can't be done because as I said in another topic, there's only 1 free space left for an additional badge, and nobody figured out how to add a badge illustration anyway.
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1630
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 357 times

Re: Why doesn't this work?

Postby Eglin » 07 Mar 2012, 22:08

I didn't realize there "was only space" for one more badge. I thought you could add anything you want as a badge, but only a handful had corresponding images. For the other bit, I didn't word it very well. Is it possible to adapt my changeling code such that any card that declares itself as having the changeling characteristic will be endowed w/ some property that I've coded? That would be a pretty elegant solution for changeling and quite a few other mechanics.
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby nabeshin » 08 Mar 2012, 00:58

Eglin wrote:I didn't realize there "was only space" for one more badge. I thought you could add anything you want as a badge, but only a handful had corresponding images. For the other bit, I didn't word it very well. Is it possible to adapt my changeling code such that any card that declares itself as having the changeling characteristic will be endowed w/ some property that I've coded? That would be a pretty elegant solution for changeling and quite a few other mechanics.
plz show me screen.jpg with changeling card in play.
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 29 times

Re: Why doesn't this work?

Postby Eglin » 08 Mar 2012, 01:29

nabeshin wrote:plz show me screen.jpg with changeling card in play.


It just says "Shapeshifter" for the type. When I was trying to get it to work, it would often go blank, but now it doesn't seem to change at all. If you'd like a screenshot, I'd be happy to oblige, but please explain at what point you'd like me to take it - card in play, card in hand, card found searching library, etc. Or you could just try the card out yourself in the decks I posted earlier today, if it pleases you.
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby thefiremind » 08 Mar 2012, 10:06

Eglin wrote:I didn't realize there "was only space" for one more badge. I thought you could add anything you want as a badge, but only a handful had corresponding images. For the other bit, I didn't word it very well.
Only badge #31 is left unused, while badge #32 has the same effect as badge #0, badge #33 as badge #1, and so on. The coders probably used only 5 bits for the badges (2^5 = 32, from 0 to 31) and that's the result.
Eglin wrote:Is it possible to adapt my changeling code such that any card that declares itself as having the changeling characteristic will be endowed w/ some property that I've coded? That would be a pretty elegant solution for changeling and quite a few other mechanics.
There's no way to do what you are thinking about, the best you can do is to declare a function in a LOL file in the FUNCTIONS directory, call it Changeling() for example, and insert your changeling code there, so on the cards you just have to write Changeling() inside the continuous action and that's all. This leads to a good and a bad thing:
Good: you write code only once, and if something goes wrong or needs to be improved, you change only the functions' file instead of a bunch of cards.
Bad: everytime someone asks you to show a card that uses that function, you'll need to paste the function code, too, otherwise that poor guy won't understand a thing. :lol:
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1630
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 357 times

Re: Why doesn't this work?

Postby Eglin » 08 Mar 2012, 12:02

Haha. You're awesome. Thanks for all the instruction.
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times

Re: Why doesn't this work?

Postby nabeshin » 08 Mar 2012, 23:33

thefiremind wrote:Only badge #31 is left unused, while badge #32 has the same effect as badge #0, badge #33 as badge #1, and so on. The coders probably used only 5 bits for the badges (2^5 = 32, from 0 to 31) and that's the result.
don't fool Eglin's brain, here indexation of loopback type.
User avatar
nabeshin
 
Posts: 207
Joined: 27 Jun 2011, 20:07
Has thanked: 5 times
Been thanked: 29 times

Re: Why doesn't this work?

Postby thefiremind » 17 Mar 2012, 20:17

Eglin wrote:It just says "Shapeshifter" for the type. When I was trying to get it to work, it would often go blank, but now it doesn't seem to change at all.
I tried to code Mirror Entity:
Code: Select all
<?xml version='1.0'?>
<CARD_V2 custom="true">
  <FILENAME text="MIRROR_ENTITY_19991529" />
  <CARDNAME text="MIRROR_ENTITY" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Mirror Entity]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="19991529" />
  <ARTID value="19991529" />
  <FRAMECOLOUR name="W" />
  <COLOUR value="W" />
  <ARTIST name="Zoltan Boros &amp; Gabor Szikszai" />
  <CASTING_COST cost="{2}{W}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Unaware of Lorwyn’s diversity, it sees only itself, reflected a thousand times over.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <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="Shapeshifter" order_de-DE="0" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
  <EXPANSION value="LOR" />
  <RARITY metaname="R" />
  <POWER value="1" />
  <TOUGHNESS value="1" />
  <STATIC_ABILITY layer="4" zone="any">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Changeling]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
    <CONTINUOUS_ACTION>
    Changeling( Object() )
    </CONTINUOUS_ACTION>
  </STATIC_ABILITY>
  <ACTIVATED_ABILITY layer="7B">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{X}: Creatures you control become X/X and gain all creature types until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[]]></LOCALISED_TEXT>
    <COST type="mana" cost="{X}" />
    <FILTER>
    return CreaturesYouControl()
    </FILTER>
    <CONTINUOUS_ACTION>
    local characteristics = FilteredCard():GetCurrentCharacteristics()
    characteristics:Power_Set( Object():GetManaX() )
    characteristics:Toughness_Set( Object():GetManaX() )
    Changeling( FilteredCard() )
    </CONTINUOUS_ACTION>
    <DURATION>
    return (MTG():GetStep() == STEP_CLEANUP)
    </DURATION>
    <AI_AVAILABILITY behaviour="InResponseOrDuringCombat" />
  </ACTIVATED_ABILITY>
  <SFX text="COMBAT_WHITE_MAGIC_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_WHITE_MAGIC_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
where the Changeling function is just your code, with the addition of the Bool_Set I suggested:
Code: Select all
Changeling = function(object)
-- makes the object a changeling
   local characteristics = object:GetCurrentCharacteristics()
   local shapeshifter_subtypes = characteristics:SubType_GetWritable( object )
   local last_creature = 220
   for i=1000,1000+last_creature do
      shapeshifter_subtypes:Add( i, object )
   end
   characteristics:Bool_Set( CHARACTERISTIC_CHANGELING, 1 )
end
and the creature types are written in numbers just to be shorter (I have 2 extra types: Germ and Werewolf, so the last one is +220 instead of +218).
I see just "Shapeshifter" as creature type when the card is in my hand, but in play and in graveyard, the types' space becomes apparently blank... when looking in detail, it's not really blank, there's a writing, so small that you can't read it. I think the game tries to fit all the types in that space but obviously fails. Aside from this "cosmetic" glitch, it works perfectly.

EDIT: I'm afraid I won't use Changeling again... it seems it bugs AI's decisions. I'm pretty sure it was the reason why the AI could tap my Myr for Myr Turbine.
< DotP2013 (and formerly 2012) modder >
WADs unrecognized by the game? Look here.
Need a basic modding tutorial? Try this.
Want to start coding cards? Try my web generator.
User avatar
thefiremind
Programmer
 
Posts: 1630
Joined: 07 Nov 2011, 10:55
Has thanked: 60 times
Been thanked: 357 times

Re: Why doesn't this work?

Postby Eglin » 18 Mar 2012, 19:43

thefiremind wrote:EDIT: I'm afraid I won't use Changeling again... it seems it bugs AI's decisions. I'm pretty sure it was the reason why the AI could tap my Myr for Myr Turbine.
This is fascinating. I've never noticed any problems with my own changelings. I wonder if the amount of space allocated for creature types is limited and you're somehow overwriting the allotted space. Can you duplicate the issue using my original changeling code? It makes sense that if the amount of space is hard-coded it might be just big enough to hold all the original creature-types.
User avatar
Eglin
Programmer
 
Posts: 185
Joined: 01 Mar 2012, 14:44
Has thanked: 35 times
Been thanked: 19 times


Return to Programming Talk

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 177 on 10 Oct 2011, 16:37

Users browsing this forum: No registered users and 2 guests

Login Form