Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
2013




Enchanted Evening (couple of bugs)
Moderator: CCGHQ Admins
5 posts
• Page 1 of 1
Enchanted Evening (couple of bugs)
by 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:
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>
Re: Enchanted Evening (couple of bugs)
by 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.
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...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Enchanted Evening (couple of bugs)
by 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.
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.
Re: Enchanted Evening (couple of bugs)
by 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:
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!
- 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>
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!
Re: Enchanted Evening (couple of bugs)
by 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:
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
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 321 guests