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)
2014




Formal Request Thread
Moderator: CCGHQ Admins
Re: Formal Request Thread
by Xander9009 » 16 Sep 2014, 01:09
So, I'm trying to code Gutter Grime. Unfortunately, I'm not exactly sure how to adhere to the rules. If there was only one Gutter Grime, I could just search for it by name and be done with it. However, there can be multiple Gutter Grimes out, meaning I need to code in the rule so that "each token remembers which Gutter Grime created it". I've been away from coding for too long to remember how to store a created token's card pointer (if I ever knew how). I imagine I'll need to use Riiak's ObjectDC, which shouldn't be too bad, but I need to get the Gutter Grime pointer from Gutter Grime to the token. Anyone know offhand how to do that, another way to manage it, or a card which does something similar which is already coded somewhere?
The only other way I can think of would work, but it would probably be way more complicated than necessary. When a Gutter Grime triggers, set an accessible variable to 1. When a slime token is created, it searches your battlefield for a Gutter Grime, and checks the variable. Either it's still 1, in which case it uses that Gutter Grime and sets its variable to 0, or it's already 0, in which case it continues searching. (well, it would increment, not set, but same idea).
The only other way I can think of would work, but it would probably be way more complicated than necessary. When a Gutter Grime triggers, set an accessible variable to 1. When a slime token is created, it searches your battlefield for a Gutter Grime, and checks the variable. Either it's still 1, in which case it uses that Gutter Grime and sets its variable to 0, or it's already 0, in which case it continues searching. (well, it would increment, not set, but same idea).
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by gorem2k » 16 Sep 2014, 01:20
This is a DotP 2013 Gutter Grime found in tfm's mod...
No idea what BindStarTokenChest does tho
Ok this is what his function does:
- Code: Select all
<TRIGGERED_ABILITY auto_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="objectyoucontrol" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_IN_PLAY">
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and TriggerObject():IsToken() == 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("SLIME"), 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local index = StarTokensManager().CreateNext()
EffectDC():Set_Int(0, index)
MTG():PutTokensIntoPlay( "TOKEN_OOZE_S_S_GG_19990128", 1, EffectController(), EffectDC():Make_Chest(1) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
BindStarTokenChest( EffectDC():Get_Chest(1), EffectDC():Get_Int(0) )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="TOKEN_OOZE_S_S_GG_19990128" />
No idea what BindStarTokenChest does tho

Ok this is what his function does:
- Code: Select all
BindStarTokenChest = function(chest, index)
-- Use this in a resolution time action on the card that creates the token(s), in order to store the index on the token(s)
if chest ~= nil then
local i = 0
local token = chest:Get_NthCardPtr(0)
while token ~= nil do
token:GetDataChest():Set_Int(COMPARTMENT_ID_STAR_TOKEN_INDEX, index)
i = i+1
token = chest:Get_NthCardPtr(i)
end
end
end
Last edited by gorem2k on 16 Sep 2014, 01:22, edited 1 time in total.
Re: Formal Request Thread
by RiiakShiNal » 16 Sep 2014, 01:21
When you create tokens via PutTokensOntoBattlefield() you can pass it a data chest as the fourth parameter and any tokens created will be stored there. Then you can iterate through the chest and use RSN_GetObjectDC( oToken, true ) to get and create (if necessary) the ObjectDC chest which you can then put a pointer to Gutter Grime in it (from within Gutter Grime's ability itself). Then once the pointer becomes nil (after it has been set) or the number of slime counters reaches 0 the P/T of the tokens should become 0/0 and they leave play. Until the pointer has been set though you may need to temporarily give the tokens 1 toughness so they will survive long enough for the pointer to actually be set). If you don't have to temporarily set the toughness to 1 to keep them from dying then that will be more rule compliant.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by NeoAnderson » 16 Sep 2014, 03:22
As Riiak says this is the solution and i already used something similar when i coded Tetravus, anyway i just coded the card for you and i also tested it works fine.
Each token is related to the source card, its power and toughness are immediately updated, so it isn't needed to set it to 1 at beginning.
Obviously you need Riiak ObjectDC function.
Each token is related to the source card, its power and toughness are immediately updated, so it isn't needed to set it to 1 at beginning.
Obviously you need Riiak ObjectDC function.
- Gutter Grime - Neo Tested | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="GUTTER_GRIME_234849" />
<CARDNAME text="GUTTER_GRIME" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gutter Grime]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Résidus d’égout]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mugre de la alcantarilla]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Gossenschmutz]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sporcizia delle Fogne]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[排水路の汚濁]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gutter Grime]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сточная Грязь]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Imundície da Sarjeta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[水沟污迹]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[水溝污跡]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="234849" />
<ARTID value="234849" />
<ARTIST name="Erica Yang" />
<CASTING_COST cost="{4}{G}" />
<TYPE metaname="Enchantment" />
<EXPANSION value="ISD" />
<RARITY metaname="R" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’une créature non-jeton que vous contrôlez meurt, mettez un marqueur « boue » sur les Résidus d’égout, puis mettez sur le champ de bataille un jeton de créature verte Limon avec « La force et l’endurance de cette créature sont chacune égales au nombre de marqueurs « boue » sur les Résidus d’égout ».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que una criatura que no sea ficha que controles muera, pon un contador de fango sobre la Mugre de la alcantarilla, luego pon en el campo de batalla una ficha de criatura Cieno verde con “Tanto la fuerza como la resistencia de esta criatura son iguales a la cantidad de contadores de fango sobre la Mugre de la alcantarilla”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn eine Nichtspielstein-Kreatur stirbt, die du kontrollierst, lege eine Schleimmarke auf den Gossenschmutz und bringe dann einen grünen Schlammwesen-Kreaturenspielstein mit „Stärke und Widerstandskraft dieser Kreatur sind gleich der Anzahl an Schleimmarken auf dem Gossenschmutz” ins Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta una creatura non pedina che controlli muore, metti un segnalino melma sulla Sporcizia delle Fogne, poi metti sul campo di battaglia una pedina creatura Melma verde con “La forza e la costituzione di questa creatura sono pari al numero di segnalini melma sulla Sporcizia delle Fogne”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがコントロールするトークンでないクリーチャーが1体死亡するたび、排水路の汚濁の上にスライム・カウンターを1個置き、その後、「このクリーチャーのパワーとタフネスは、それぞれ排水路の汚濁の上に置かれているスライム・カウンターの数に等しい」を持つ緑のウーズ・クリーチャー・トークンを1体戦場に出す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз когда не являющееся фишкой существо под вашим контролем умирает, положите один жетон слизи на Сточную Грязь, затем положите на поле битвы одну фишку зеленого существа-Тины со способностью «Сила и выносливость этого существа равны количеству жетонов слизи на Сточной Грязи».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que uma criatura que não seja ficha que você controla morrer, coloque um marcador de limo sobre Imundície da Sarjeta, depois coloque no campo de batalha uma ficha de criatura verde do tipo Lodo com ”O poder e a resistência desta criatura são ambos iguais ao número de marcadores de limo sobre Imundície da Sarjeta.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当一个非衍生物、且由你操控的生物死去时,在水沟污迹上放置一个黏菌指示物,然后将一个绿色流浆衍生生物放进战场,且具有「此生物之力量与防御力各等同于水沟污迹上的黏菌指示物数量。」]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當一個非衍生物、且由你操控的生物死去時,在水溝污跡上放置一個黏菌指示物,然後將一個綠色流漿衍生生物放進戰場,且具有「此生物之力量與防禦力各等同於水溝污跡上的黏菌指示物數量。」]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="objectyoucontrol" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIED">
return (TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) == true) and (TriggerObject():IsToken() == false)
</TRIGGER>
<COUNTER_REGISTRATION name="Slime" proliferate="11" />
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("Slime"), 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():PutTokensOntoBattlefield( "NEO_ALA_TOKEN_008_OOZE_X_X_G_575975008", 1, EffectController(), EffectDC():Make_Chest(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local tokenDC = EffectDC():Get_Chest(0)
local count_so_far = 0
local chest = RSN_GetObjectDC( Object(), false )
if chest == nil then
chest = RSN_ObjectDC()
end
for i=0,tokenDC:Count()-1 do
local target_card = tokenDC:Get_CardPtr(i)
if target_card ~= nil then
count_so_far = chest:Get_Int(0)
chest:Set_CardPtr(1 + count_so_far, target_card)
chest:Protect_CardPtr(1 + count_so_far)
chest:Set_Int(0, count_so_far + 1)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY>
<COUNTER_REGISTRATION name="Slime" proliferate="11" />
<FILTER filter_id="0">
MTG():ClearFilterMark()
local filter = ClearFilter()
local chest = RSN_GetObjectDC( Object(), false )
if chest ~= nil then
local count_so_far = chest:Get_Int(0)
for i = 1, (count_so_far) do
local target = chest:Get_CardPtr(i)
if target ~= nil then
target:MarkForFilter()
end
end
end
filter:SetMarkedObjectsOnly()
</FILTER>
<CONTINUOUS_ACTION layer="7B" filter_id="0">
if FilteredCard() ~= nil then
local counters = EffectSource():CountCounters(MTG():GetCountersType("Slime"))
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Set(counters)
characteristics:Toughness_Set(counters)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="NEO_ALA_TOKEN_008_OOZE_X_X_G_575975008" />
</CARD_V2>
- Attachments
-
Gutter Crime.rar
- Gutter Crime - card XML, TDX, Token
- (217.02 KiB) Downloaded 279 times
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by Xander9009 » 16 Sep 2014, 12:02
Thanks for the tip. Obviously I didn't end up needing it, thanks to Neo. Believe it or not, I did in fact search for Gutter Grime. But I only thought to search 2014. I tend to forget modding of these games existed before that lol.gorem2k wrote:This is a DotP 2013 Gutter Grime found in tfm's mod...hope that helps
- | Open
Should be similar in DotP 2014.
- Code: Select all
<TRIGGERED_ABILITY auto_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="objectyoucontrol" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_IN_PLAY">
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and TriggerObject():IsToken() == 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("SLIME"), 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local index = StarTokensManager().CreateNext()
EffectDC():Set_Int(0, index)
MTG():PutTokensIntoPlay( "TOKEN_OOZE_S_S_GG_19990128", 1, EffectController(), EffectDC():Make_Chest(1) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
BindStarTokenChest( EffectDC():Get_Chest(1), EffectDC():Get_Int(0) )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="TOKEN_OOZE_S_S_GG_19990128" />
No idea what BindStarTokenChest does tho
Ok this is what his function does:
- Code: Select all
BindStarTokenChest = function(chest, index)
-- Use this in a resolution time action on the card that creates the token(s), in order to store the index on the token(s)
if chest ~= nil then
local i = 0
local token = chest:Get_NthCardPtr(0)
while token ~= nil do
token:GetDataChest():Set_Int(COMPARTMENT_ID_STAR_TOKEN_INDEX, index)
i = i+1
token = chest:Get_NthCardPtr(i)
end
end
end
I want to say I'll definitely have to keep this in mind, but at the same time, this is a really rare thing to have to do. Nonetheless, now I'll know where to look to figure it out haha. As for the dead on arrival, I was planning to create a PT token with the current number of counters, then have its ability take over and set its PT as needed.RiiakShiNal wrote:When you create tokens via PutTokensOntoBattlefield() you can pass it a data chest as the fourth parameter and any tokens created will be stored there. Then you can iterate through the chest and use RSN_GetObjectDC( oToken, true ) to get and create (if necessary) the ObjectDC chest which you can then put a pointer to Gutter Grime in it (from within Gutter Grime's ability itself). Then once the pointer becomes nil (after it has been set) or the number of slime counters reaches 0 the P/T of the tokens should become 0/0 and they leave play. Until the pointer has been set though you may need to temporarily give the tokens 1 toughness so they will survive long enough for the pointer to actually be set). If you don't have to temporarily set the toughness to 1 to keep them from dying then that will be more rule compliant.
Thank you. I've actually already got the artwork and the token (I just got done making 232 of the total 252 possible tokens, so I'm definitely good there haha). Also, I saw Tetravus in the Deck Builder, but I didn't realize it had this same rule. I thought for that card it didn't matter where the tokens came from, so I didn't think to check that it.NeoAnderson wrote:As Riiak says this is the solution and i already used something similar when i coded Tetravus, anyway i just coded the card for you and i also tested it works fine.
Each token is related to the source card, its power and toughness are immediately updated, so it isn't needed to set it to 1 at beginning.
Obviously you need Riiak ObjectDC function.If you need i also find the Hq artwork and made the TDX, i also add the ooze token.
- Gutter Grime - Neo Tested | Open
- Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="GUTTER_GRIME_234849" />
<CARDNAME text="GUTTER_GRIME" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gutter Grime]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Résidus d’égout]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Mugre de la alcantarilla]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Gossenschmutz]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sporcizia delle Fogne]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[排水路の汚濁]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gutter Grime]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сточная Грязь]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Imundície da Sarjeta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[水沟污迹]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[水溝污跡]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="234849" />
<ARTID value="234849" />
<ARTIST name="Erica Yang" />
<CASTING_COST cost="{4}{G}" />
<TYPE metaname="Enchantment" />
<EXPANSION value="ISD" />
<RARITY metaname="R" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’une créature non-jeton que vous contrôlez meurt, mettez un marqueur « boue » sur les Résidus d’égout, puis mettez sur le champ de bataille un jeton de créature verte Limon avec « La force et l’endurance de cette créature sont chacune égales au nombre de marqueurs « boue » sur les Résidus d’égout ».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que una criatura que no sea ficha que controles muera, pon un contador de fango sobre la Mugre de la alcantarilla, luego pon en el campo de batalla una ficha de criatura Cieno verde con “Tanto la fuerza como la resistencia de esta criatura son iguales a la cantidad de contadores de fango sobre la Mugre de la alcantarilla”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn eine Nichtspielstein-Kreatur stirbt, die du kontrollierst, lege eine Schleimmarke auf den Gossenschmutz und bringe dann einen grünen Schlammwesen-Kreaturenspielstein mit „Stärke und Widerstandskraft dieser Kreatur sind gleich der Anzahl an Schleimmarken auf dem Gossenschmutz” ins Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta una creatura non pedina che controlli muore, metti un segnalino melma sulla Sporcizia delle Fogne, poi metti sul campo di battaglia una pedina creatura Melma verde con “La forza e la costituzione di questa creatura sono pari al numero di segnalini melma sulla Sporcizia delle Fogne”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがコントロールするトークンでないクリーチャーが1体死亡するたび、排水路の汚濁の上にスライム・カウンターを1個置き、その後、「このクリーチャーのパワーとタフネスは、それぞれ排水路の汚濁の上に置かれているスライム・カウンターの数に等しい」を持つ緑のウーズ・クリーチャー・トークンを1体戦場に出す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever a nontoken creature you control dies, put a slime counter on Gutter Grime, then put a green Ooze creature token onto the battlefield with “This creature’s power and toughness are each equal to the number of slime counters on Gutter Grime.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз когда не являющееся фишкой существо под вашим контролем умирает, положите один жетон слизи на Сточную Грязь, затем положите на поле битвы одну фишку зеленого существа-Тины со способностью «Сила и выносливость этого существа равны количеству жетонов слизи на Сточной Грязи».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que uma criatura que não seja ficha que você controla morrer, coloque um marcador de limo sobre Imundície da Sarjeta, depois coloque no campo de batalha uma ficha de criatura verde do tipo Lodo com ”O poder e a resistência desta criatura são ambos iguais ao número de marcadores de limo sobre Imundície da Sarjeta.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当一个非衍生物、且由你操控的生物死去时,在水沟污迹上放置一个黏菌指示物,然后将一个绿色流浆衍生生物放进战场,且具有「此生物之力量与防御力各等同于水沟污迹上的黏菌指示物数量。」]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[每當一個非衍生物、且由你操控的生物死去時,在水溝污跡上放置一個黏菌指示物,然後將一個綠色流漿衍生生物放進戰場,且具有「此生物之力量與防禦力各等同於水溝污跡上的黏菌指示物數量。」]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="objectyoucontrol" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIED">
return (TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) == true) and (TriggerObject():IsToken() == false)
</TRIGGER>
<COUNTER_REGISTRATION name="Slime" proliferate="11" />
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("Slime"), 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
MTG():PutTokensOntoBattlefield( "NEO_ALA_TOKEN_008_OOZE_X_X_G_575975008", 1, EffectController(), EffectDC():Make_Chest(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local tokenDC = EffectDC():Get_Chest(0)
local count_so_far = 0
local chest = RSN_GetObjectDC( Object(), false )
if chest == nil then
chest = RSN_ObjectDC()
end
for i=0,tokenDC:Count()-1 do
local target_card = tokenDC:Get_CardPtr(i)
if target_card ~= nil then
count_so_far = chest:Get_Int(0)
chest:Set_CardPtr(1 + count_so_far, target_card)
chest:Protect_CardPtr(1 + count_so_far)
chest:Set_Int(0, count_so_far + 1)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY>
<COUNTER_REGISTRATION name="Slime" proliferate="11" />
<FILTER filter_id="0">
MTG():ClearFilterMark()
local filter = ClearFilter()
local chest = RSN_GetObjectDC( Object(), false )
if chest ~= nil then
local count_so_far = chest:Get_Int(0)
for i = 1, (count_so_far) do
local target = chest:Get_CardPtr(i)
if target ~= nil then
target:MarkForFilter()
end
end
end
filter:SetMarkedObjectsOnly()
</FILTER>
<CONTINUOUS_ACTION layer="7B" filter_id="0">
if FilteredCard() ~= nil then
local counters = EffectSource():CountCounters(MTG():GetCountersType("Slime"))
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Set(counters)
characteristics:Toughness_Set(counters)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TOKEN_REGISTRATION reservation="1" type="NEO_ALA_TOKEN_008_OOZE_X_X_G_575975008" />
</CARD_V2>
EDIT: Sorry, I didn't think about it, but the image for the token is actually also something I needed. I had the code for the token, and I had the image for the nontoken. So, the token image is also very useful

_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by NeoAnderson » 16 Sep 2014, 12:49
You're welcome my friend, i am glad to be useful, i would ask to you, if you can test my last implementation of MORPH ability, it is really close to a 100% of rules compliance.Xander9009 wrote:Thank you. I've actually already got the artwork and the token (I just got done making 232 of the total 252 possible tokens, so I'm definitely good there haha). Also, I saw Tetravus in the Deck Builder, but I didn't realize it had this same rule. I thought for that card it didn't matter where the tokens came from, so I didn't think to check that it.
EDIT: Sorry, I didn't think about it, but the image for the token is actually also something I needed. I had the code for the token, and I had the image for the nontoken. So, the token image is also very useful
You can find the topic here, also if i already made other modify to them, but i will upload another version later, start to try that one., and let me know what you think.
Morph cards made by NEO
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by Xander9009 » 17 Sep 2014, 05:45
This is a terrible place for my response, but this is where the original code was, so I'm keeping the discussion here for now.NeoAnderson wrote:I made the card Xenograft, with my idea of "Name a creature type", with my implementation you type the creature_type, it is still a working progress idea, but the basic functions are working.
There are some limitations :
1. Are supported only the follow languages : English, French, Spanish, German, Italian.
2. When you type the creature type, each special character(expecially for French, Spanish and German) must be turned into basic type ( Example: ALLIÉ must be typed as ALLIE. Example : ÜBERTRÄGER must be typed as UBERTRAGER. Example : TEJÓN must be typed as TEJON). I could fix this issue but the screens with types would be increased too much. I think is a fair compromise.
Positive aspects :
1. You don't have to look the kinds into decks just type one valid kind.
2. Are simultaneously supported 5 languages, so you can type the card into your preferred language also if it is different from playing language. Sometimes the words are shorter into another language so can be easy to type Example : "Bat" : English "Pipistrello" : Italian, you can type "Bat" also if you are playing into Italian language.
3. Only valid kind are accepted otherwise the function restart.
4. On the Button "Ok" you can see what you have already typed (it changes, after each typing)
Out of curiosity, did you end up polishing this? I'm asking because if you're using it or still planning to use it, it would be nice if it tracked how many results there are for the current string and operate based on that. It would increase complexity, but it would be much easier to use while in-game. Explanation:
Goal: Dreadnaught
- "D" - "D" - 15 results
- "R" - "DR" - 6 results
- "E" - "DRE" - 1 result
Also, SOLDNAR and BETE still have their accents.
Finally, I don't know if it's possible to parse a string, but if not, it would be possible to do this with a lookup table. I'm a bit obsessive compulsive, so when I decided to test the possibility of that, I ended up making the whole table. There are 4217 different combinations of characters starting from the left. That can be split into 20 tables based on length. The table has a list of each valid combination of characters, the number of results for the combination, and if the number is less than 5, then a list of cards returned by the combination.
So, for instance
A - 65
...
J - 3 - JABALI - JELLYFISH - JUGGERNAUT
...
AD - 4 - ADALID - ADDETTO AL MONTAGGIO - ADLER - ADVISOR
...
ADA - 1 - ADALID
Trimming this down so only English is shown would make it more streamlined, and I imagine the best way to do it would be to make a set of functions which are identical but are based on the various languages, then a user can install whichever they need. With only English, the number of combinations would drop from 4217 by a lot. If you want to try and incorporate it, let me know and I'll upload it. I just think it would be great if the player could just click "Next - J - Juggernaught" instead of spelling the whole thing out.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by NeoAnderson » 17 Sep 2014, 06:09
Hi Xander, this function was just an idea i got some month ago, i never finished to implement, right now i am coding the morph cards, but we could discuss to work togheter on it when if finished the code morph cards, anyway you can feel free to make modify to it if you want to start right now.Xander9009 wrote:
- NeoAnderson OLD POST | Open
NeoAnderson wrote:I made the card Xenograft, with my idea of "Name a creature type", with my implementation you type the creature_type, it is still a working progress idea, but the basic functions are working.
There are some limitations :
1. Are supported only the follow languages : English, French, Spanish, German, Italian.
2. When you type the creature type, each special character(expecially for French, Spanish and German) must be turned into basic type ( Example: ALLIÉ must be typed as ALLIE. Example : ÜBERTRÄGER must be typed as UBERTRAGER. Example : TEJÓN must be typed as TEJON). I could fix this issue but the screens with types would be increased too much. I think is a fair compromise.
Positive aspects :
1. You don't have to look the kinds into decks just type one valid kind.
2. Are simultaneously supported 5 languages, so you can type the card into your preferred language also if it is different from playing language. Sometimes the words are shorter into another language so can be easy to type Example : "Bat" : English "Pipistrello" : Italian, you can type "Bat" also if you are playing into Italian language.
3. Only valid kind are accepted otherwise the function restart.
4. On the Button "Ok" you can see what you have already typed (it changes, after each typing)
- Xander9009 wrote: | Open
- This is a terrible place for my response, but this is where the original code was, so I'm keeping the discussion here for now.
Out of curiosity, did you end up polishing this? I'm asking because if you're using it or still planning to use it, it would be nice if it tracked how many results there are for the current string and operate based on that. It would increase complexity, but it would be much easier to use while in-game. Explanation:
Goal: DreadnaughtIf there are only 5, show those five on the buttons, along with an "Restart" button. Once there is only one result, show that result (in this case, "Dreadnaught") on the OK button. This would be a LOT more user friendly if long names were shortened. Of course, you wouldn't actually need to track how many results there are in total. Just count to 6. If there are 6 or more, you can ignore the rest and continue as normal.
- "D" - "D" - 15 results
- "R" - "DR" - 6 results
- "E" - "DRE" - 1 result
Also, SOLDNAR and BETE still have their accents.
Finally, I don't know if it's possible to parse a string, but if not, it would be possible to do this with a lookup table. I'm a bit obsessive compulsive, so when I decided to test the possibility of that, I ended up making the whole table. There are 4217 different combinations of characters starting from the left. That can be split into 20 tables based on length. The table has a list of each valid combination of characters, the number of results for the combination, and if the number is less than 5, then a list of cards returned by the combination.
So, for instance
A - 65
...
J - 3 - JABALI - JELLYFISH - JUGGERNAUT
...
AD - 4 - ADALID - ADDETTO AL MONTAGGIO - ADLER - ADVISOR
...
ADA - 1 - ADALID
Trimming this down so only English is shown would make it more streamlined, and I imagine the best way to do it would be to make a set of functions which are identical but are based on the various languages, then a user can install whichever they need. With only English, the number of combinations would drop from 4217 by a lot. If you want to try and incorporate it, let me know and I'll upload it. I just think it would be great if the player could just click "Next - J - Juggernaught" instead of spelling the whole thing out.
Just one thing i think is not possible to install different version of the function based on language used, because the final wad will be different for each language and the multiplayer game will not work.
You should find if there is a function to retrieve the actual language.
About the predictive is a good idea but it will increase the code complexity considering you are typing through a multiple choice functions, is not so easy to manage everything, anyway i think could be doable, as everything but the real question is if the work is justified by a large number of cards that use this function..
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by Xander9009 » 17 Sep 2014, 13:34
I didn't think about multiplayer. I never play multiplayer, so I very rarely remember some people do haha. Even so, having it predict would be very nice whether it's a single language or not. I may look into doing this. I was busy making sure all of the tokens were coded, but I finished up the 17 of the remaining 20, and the last 3 aren't possible, so I'm done with that. I'll look into it and let you know what I come up with. Although, if I end up having trouble instead of a working result, I'll probably post a new thread for it.NeoAnderson wrote:Hi Xander, this function was just an idea i got some month ago, i never finished to implement, right now i am coding the morph cards, but we could discuss to work togheter on it when if finished the code morph cards, anyway you can feel free to make modify to it if you want to start right now.
Just one thing i think is not possible to install different version of the function based on language used, because the final wad will be different for each language and the multiplayer game will not work.
You should find if there is a function to retrieve the actual language.
About the predictive is a good idea but it will increase the code complexity considering you are typing through a multiple choice functions, is not so easy to manage everything, anyway i think could be doable, as everything but the real question is if the work is justified by a large number of cards that use this function..
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by migookman » 17 Sep 2014, 17:36
- | Open
- <TRIGGER value="OBJECT_TAKES_DAMAGE" damage_type="all">
if EffectSource() ~= nil then
return TriggerObject() == EffectSource():GetParent()
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local damage = Damage():GetAmount()
if damage ~= 0 then
local controller = TriggerObjectLKI():GetPlayer()
EffectSourceLKI():DealDamageTo( Damage():GetAmount(), Player() )
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
I was wondering if anyone could guide me in the right direction of what I'm doing wrong trying to code Binding Agony. I've been stuck on this card for the past few days trying many things without success.
Re: Formal Request Thread
by sumomole » 17 Sep 2014, 17:48
migookman wrote:
- | Open
- <TRIGGER value="OBJECT_TAKES_DAMAGE" damage_type="all">
if EffectSource() ~= nil then
return TriggerObject() == EffectSource():GetParent()
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local damage = Damage():GetAmount()
if damage ~= 0 then
local controller = TriggerObjectLKI():GetPlayer()
EffectSourceLKI():DealDamageTo( damage, controller )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
I was wondering if anyone could guide me in the right direction of what I'm doing wrong trying to code Binding Agony. I've been stuck on this card for the past few days trying many things without success.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by Xander9009 » 17 Sep 2014, 17:51
migookman wrote:I was wondering if anyone could guide me in the right direction of what I'm doing wrong trying to code Binding Agony. I've been stuck on this card for the past few days trying many things without success.
- Stick code instide [ code ] & [/ code ] tags to make it easier to read.
- You were setting the variables, but not using them. (Probably just from testing, I know. Not a mistake, just unnecessary.)
- Last, the one I think was the issue, you didn't end the if in the resolution. I haven't tested it, though.
- | Open
- Code: Select all
<TRIGGER value="OBJECT_TAKES_DAMAGE" damage_type="all">
return EffectSource() ~= nil && TriggerObject() == EffectSource():GetParent()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectSourceLKI():DealDamageTo( Damage():GetAmount(), EffectSource():GetParent():EffectController() )
</RESOLUTION_TIME_ACTION>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by thefiremind » 17 Sep 2014, 21:42
Lua does short-circuit, but the syntax is wrong: you need to write "and", not "&&".Xander9009 wrote:(This might have messed up the trigger. I put it on one line because I think it looks a lot cleaner, but I don't remember for sure if && will short-circuit or not.)
< 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: Formal Request Thread
by migookman » 17 Sep 2014, 21:43
Thanks a lot guys for the help.
Xander, I tried your method but the card stopped showing up in the test deck. I did an XML Validation and it came up with:
return EffectSource() ~= nil &"error"& TriggerObject() == EffectSource():GetParent()
with the error: The entity name must immediately follow the '&' in the entity reference.
Xander, I tried your method but the card stopped showing up in the test deck. I did an XML Validation and it came up with:
return EffectSource() ~= nil &"error"& TriggerObject() == EffectSource():GetParent()
with the error: The entity name must immediately follow the '&' in the entity reference.
Re: Formal Request Thread
by Xander9009 » 17 Sep 2014, 22:21
Yeah, TFM just pointed that out as well. My bad. To be fair, I DID admit I might have messed that up haha.migookman wrote:Thanks a lot guys for the help.
Xander, I tried your method but the card stopped showing up in the test deck. I did an XML Validation and it came up with:
return EffectSource() ~= nil &"error"& TriggerObject() == EffectSource():GetParent()
with the error: The entity name must immediately follow the '&' in the entity reference.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Who is online
Users browsing this forum: No registered users and 6 guests