It is currently 23 Jun 2025, 02:30
   
Text Size

Enchanted Evening (couple of bugs)

Moderator: CCGHQ Admins

Enchanted Evening (couple of bugs)

Postby Vervandi » 22 Nov 2012, 19:32

I'm working on a new deck based around Enchanted Evening. My code is working pretty good with a couple of issues:

1. The card type text is replaced with COMPOUND_BASIC_TYPE_LAND(Creature/Artifact)_ENCHANTMENT. I'd rather it say something like "Land Enchantment" etc.

2. If I click on any creature, the game freezes. I can hit escape, exit from the menu, but I cannot continue the game. Here is the code I am using:

Code: Select all
<FILTER>
    return (FilteredCard() ~= nil and
    FilteredCard():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 or
   FilteredCard():GetCardType():Test( CARD_TYPE_LAND ) ~= 0 or
    FilteredCard():GetCardType():Test( CARD_TYPE_ARTIFACT ) ~= 0) and
   (filteredCard ~= Object())
    </FILTER>
    <CONTINUOUS_ACTION layer="7C">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       if characteristics ~= nil then
        characteristics:CardType_GetWritable(FilteredCard()):Add( CARD_TYPE_ENCHANTMENT, FilteredCard() )
       end
    end
    </CONTINUOUS_ACTION>
Any suggestions? Am I pushing the game beyond it's limits?
Vervandi
 
Posts: 12
Joined: 18 Nov 2012, 04:52
Has thanked: 10 times
Been thanked: 0 time

Re: Enchanted Evening (couple of bugs)

Postby thefiremind » 22 Nov 2012, 19:49

The layer for type changes isn't "7C" but "3". Try to change that first, but I don't think it will solve the problem. Kevlahnota had problems with Opalescence because enchantments with other types aren't officially supported, this is more or less the same thing.

About issue #1 you would just have to define the various COMPOUND_[...]_ENCHANTMENT in the TEXT_PERMANENT directory. You can find the already defined type sets inside CARD_UI_TEXT0000.XML in the core WAD. But it's useless if issue #2 can't be solved.
< 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: Enchanted Evening (couple of bugs)

Postby Vervandi » 22 Nov 2012, 21:26

I've got a plan, but it is going to have to wait until after I eat some turkey. It's terribly inelegant:

I am going to modify the spell to only change lands and artifacts, which seems to work fine. Then, I am going to create a new creature type "Enchantment". Modify the spell to add that creature type to all creatures. Finally, any spell interactions with enchantments I will add an or statement to look for creatures with the type "Enchantment" in addition to actual enchantments. Only a few spells do this in the core game I think, so it shouldn't be too hard to hunt them down.
Vervandi
 
Posts: 12
Joined: 18 Nov 2012, 04:52
Has thanked: 10 times
Been thanked: 0 time

Re: Enchanted Evening (couple of bugs)

Postby Vervandi » 23 Nov 2012, 00:03

Hmm, struggling with adding a creature type to all creatures in play. Pretty sure I am missing something simple. Here is the code:

Code: Select all
   <STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
   <FILTER>
   local filteredCard = FilteredCard()
    return ((filteredCard ~= nil) and 
    (filteredCard:GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0) and
    (filteredCard:GetZone() ~= (ZONE_IN_PLAY)) and
    (filteredCard ~= Object()))
    </FILTER>
    <CONTINUOUS_ACTION layer="4">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       if characteristics ~= nil then
      characteristics:CardType_GetWritable(FilteredCard()):Add( CREATURE_TYPE_ENCHANTMENT, FilteredCard() )
       end
    end
  </CONTINUOUS_ACTION>
</STATIC_ABILITY>
Other information...

I've added a line in Creature_Types: "Enchantment"

I used Rise From the Dead as an example, since it adds zombie to the creature type.

Pretty sure I am missing something obvious here, any help is greatly appreciated!
Vervandi
 
Posts: 12
Joined: 18 Nov 2012, 04:52
Has thanked: 10 times
Been thanked: 0 time

Re: Enchanted Evening (couple of bugs)

Postby Vervandi » 23 Nov 2012, 05:17

Holy cow, what a mess this was. I didn't realize so much went into creating a new creature type.

Final working code:

Code: Select all
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
   <FILTER>
    local filteredCard = FilteredCard()
    return ((filteredCard ~= nil) and 
    (filteredCard:GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0) and
    (filteredCard:GetZone() == (ZONE_IN_PLAY)) and
    (filteredCard ~= Object()))
    </FILTER>
    <CONTINUOUS_ACTION layer="4">
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       if characteristics ~= nil then
        characteristics:SubType_GetWritable(FilteredCard()):Add( CREATURE_TYPE_ENCHANTMENT , FilteredCard() )
       end
    end
Then I downloaded RiiakShiNal's functions related to creating creature constants, and the text file. I added a new type and then created an row in the XML. It works great. The next step is to alter spells that target enchantments to target enchantments and creatures of type enchantment.
Vervandi
 
Posts: 12
Joined: 18 Nov 2012, 04:52
Has thanked: 10 times
Been thanked: 0 time


Return to 2013

Who is online

Users browsing this forum: No registered users and 321 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form