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 thefiremind » 05 Nov 2013, 10:41
An activated ability doesn't bring any TriggerObject value, and even if it did, your code would tap the Sphinx continuously for the whole turn, which isn't really good.drleg3nd wrote:hey guys, can someone chk out this code,thx

- Prognostic Sphinx activated ability (untested) | Open
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Discard a card: Prognostic Sphinx gains hexproof until end of turn. Tap it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Défaussez-vous d’une carte : Le Sphinx des auspices acquiert la défense talismanique jusqu’à la fin du tour. Engagez-le.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Descartar una carta: La Esfinge adivina gana la habilidad de antimaleficio hasta el final del turno. Gírala.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wirf eine Karte aus deiner Hand ab: Die Prophezeiende Sphinx erhält Fluchsicherheit bis zum Ende des Zuges. Tappe sie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Scarta una carta: La Sfinge Profetica ha anti-malocchio fino alla fine del turno. TAPpala.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[カードを1枚捨てる:予知するスフィンクスはターン終了時まで呪禁を得る。これをタップする。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[카드 한 장을 버린다: 선견지명 스핑크스는 턴종료까지 방호 능력을 얻는다. 선견지명 스핑크스를 탭한다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Сбросьте карту: Сфинкс-Провидец получает Порчеустойчивость до конца хода. Поверните его.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Descarte um card: Esfinge Prognóstica ganha resistência a magia até o final do turno. Vire-a.]]></LOCALISED_TEXT>
<COST type="Discard" definition="0" compartment="1" query_tag="CARD_QUERY_CHOOSE_CARD_TO_DISCARD" item_count="1" />
<COST_DEFINITION id="0">
local filter = ClearFilter()
filter:SetZone( ZONE_HAND, EffectController() )
</COST_DEFINITION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():Tap()
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6">
if EffectSource() ~= nil then
EffectSource():GetCurrentCharacteristics():Bool_Set(CHARACTERISTIC_HEXPROOF, 1)
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AUTO_SKIP no_effect_source="1" />
<AI_AVAILABILITY type="in_response" response_source="1" />
</ACTIVATED_ABILITY>
< 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 NeoAnderson » 05 Nov 2013, 11:59
TO: RIIAK, FIREMIND, SUMOMOLE, KIERAN or someone else who can help!!!
Hey guys please help me, I think i am going to be crazy.
I have stored a value with LinkedDC and now when this value is "1" i have to enable the corresponding answer into a multiple choice.
I have defined a simple function :
Folder = \DATA_DLC_DECK_BUILDER_CUSTOM\DATA_ALL_PLATFORMS\FUNCTIONS
Fileaname = D14_560_GENERAL_FUNCTIONS.LOL
Function code
When i use this function inside the multiple choice the game freeze!
Hey guys please help me, I think i am going to be crazy.
I have stored a value with LinkedDC and now when this value is "1" i have to enable the corresponding answer into a multiple choice.
I have defined a simple function :
Folder = \DATA_DLC_DECK_BUILDER_CUSTOM\DATA_ALL_PLATFORMS\FUNCTIONS
Fileaname = D14_560_GENERAL_FUNCTIONS.LOL
Function code
- NEO_CheckOne | Open
- Code: Select all
NEO_CheckOne = function(oValue)
-- returns true if oValue is 1
return oValue == 1
end
When i use this function inside the multiple choice the game freeze!
- Code: Select all
<PLAY_TIME_ACTION>
local oPlayer = EffectController()
local oCard = EffectSource()
local oFly = LinkedDC():Int_Get( 0 )
local oFirstStrike = LinkedDC():Int_Get( 1 )
local oTrample = LinkedDC():Int_Get( 2 )
local oHaste = LinkedDC():Int_Get( 3 )
local oVigilance = LinkedDC():Int_Get( 4 )
local oLifelink = LinkedDC():Int_Get( 5 )
local oDeathTouch = LinkedDC():Int_Get( 6 )
if (oPlayer ~= nil) then
oPlayer:BeginNewMultipleChoice()
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", NEO_CheckOne(oFly) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FIRST_STIRKE", NEO_CheckOne(oFirstStrike) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_TRAMPLE", NEO_CheckOne(oTrample) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_HASTE", NEO_CheckOne(oHaste) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_VIGILANCE", NEO_CheckOne(oVigilance) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_LIFELINK", NEO_CheckOne(oLifelink) )
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_DEATHTOUCH", NEO_CheckOne(oDeathTouch) )
oPlayer:AskMultipleChoiceQuestion( "MODE_CHOOSE_ONE", oCard )
end
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local oAbility = EffectController():GetMultipleChoiceResult()
LinkedDC():Int_Set( oAbility, 2 )
</RESOLUTION_TIME_ACTION>
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by thefiremind » 05 Nov 2013, 12:09
A stupid question: did you remember to add linked_ability_group="1" to all abilities using LinkedDC? (I still forget it myself sometimes, don't feel bad if you forgot it)
Something else to try: have you tried to use a RESOLUTION_TIME_ACTION rather than a PLAY_TIME_ACTION? I don't know exactly what you are trying to achieve here, but the scenarios where you need a PLAY_TIME_ACTION are really rare, and maybe LinkedDC gives problems on such actions (even if I doubt it).
Something else to try: have you tried to use a RESOLUTION_TIME_ACTION rather than a PLAY_TIME_ACTION? I don't know exactly what you are trying to achieve here, but the scenarios where you need a PLAY_TIME_ACTION are really rare, and maybe LinkedDC gives problems on such actions (even if I doubt it).
< 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 NeoAnderson » 05 Nov 2013, 13:47
Thanks Firemind for your time to reply, i would inform you thi is just the last trial i have tried anything.
I try to describe to you the whole situation :
1. LinkedDC works properly because if i check the variables are correctly passed, and if i remove the boolean check from the multiple choice it works.
2. I tried both PLAY_TIME_ACTION and RESOLUTION_ACTION, the first one freeze with the card magnified in foreground, the second one freeze with the card on the battelfied. Both solution doesn't show any choice box!
3. Before to make this dump function, i thought to pass directly a boolean variable, so i used all my imagination to pass many different syntax, examples :
the code was something like this :
I try to describe to you the whole situation :
1. LinkedDC works properly because if i check the variables are correctly passed, and if i remove the boolean check from the multiple choice it works.
2. I tried both PLAY_TIME_ACTION and RESOLUTION_ACTION, the first one freeze with the card magnified in foreground, the second one freeze with the card on the battelfied. Both solution doesn't show any choice box!
3. Before to make this dump function, i thought to pass directly a boolean variable, so i used all my imagination to pass many different syntax, examples :
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
if oFly == 1 then
local bFly = true
else
local bFly = false
end
......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", bFly )
......
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 ) == 1
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", oFly )
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", oFly == 1 )
- Code: Select all
local oFly = LinkedDC():Int_Get( 0 )
.......
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING", return oFly == 1 )
the code was something like this :
- Code: Select all
...........
oPlayer:BeginNewMultipleChoice()
local oFly = LinkedDC():Int_Get( 0 )
if oFly == 1 then
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FLYING" )
end
if oFirstStrike == 1 then
oPlayer:AddMultipleChoiceAnswer( "CARD_QUERY_ANDROMEDA_FIRST_STRIKE" )
end
............
- NeoAnderson
- Posts: 914
- Joined: 10 Sep 2013, 07:49
- Has thanked: 18 times
- Been thanked: 139 times
Re: Formal Request Thread
by sumomole » 05 Nov 2013, 18:27
As far as I know, in 2014 the max "AddMultipleChoiceAnswer" is 6.
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by DrakkenMT » 10 Nov 2013, 00:49
about the elderscale wurm I requested a while back. sorry been busy so wasn't able to get on for a while. Firemind the one you posted seems to crash the game upon loading. not sure whats causing it.
Re: Formal Request Thread
by thefiremind » 10 Nov 2013, 01:02
Let me have a guess...DrakkenMT wrote:Firemind the one you posted seems to crash the game upon loading. not sure whats causing it.
thefiremind wrote:All cards must be saved in UTF-8 encoding, not ANSI (which is the default for Notepad if you start from a blank new file). You can easily discover if you saved in ANSI because if you reopen the card XML, the special characters won't be readable (for example, Japanese text will be a series of "??????????..." on Notepad).
thefiremind wrote:When you save with a new name on Notepad, look at the box to the left of the "Save" button, there will be a selection where you can choose ANSI, Unicode, Big-endian Unicode, UTF-8. That's where you choose UTF-8. If you accidentally save with ANSI, you can't return to UTF-8 just by saving again: the special characters get corrupted and you have to get the original ones somewhere else [...].
< 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 DrakkenMT » 10 Nov 2013, 03:03
ok, will check the format of the xml then. sorry should have looked into that first 

Re: Formal Request Thread
by DrakkenMT » 10 Nov 2013, 03:08
ok, I checked it and the format is still UTF-8, and all the special characters appear proper
Re: Formal Request Thread
by thefiremind » 10 Nov 2013, 09:29
Then I have no clue, I added the card to a test deck yesterday and I had no crashes upon loading. Could it be that you added a different card that's causing problems when you tested the Wurm?DrakkenMT wrote:ok, I checked it and the format is still UTF-8, and all the special characters appear proper
< 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 drleg3nd » 10 Nov 2013, 15:03
can someone help me with this card, i think bring a card from graveyard to library but i couldnt find a reference for spell going back into hand also
- serene remembrance | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shuffle Serene Remembrance and up to three target cards from a single graveyard into their owners’ libraries.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mélangez la Remembrance sereine et jusqu’à trois cartes ciblées d’un cimetière unique dans les bibliothèques de leurs propriétaires.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Baraja la Reminiscencia serena y hasta tres cartas objetivo de un mismo cementerio en las bibliotecas de sus propietarios.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mische die Ruhige Erinnerung und bis zu drei Karten deiner Wahl aus genau einem Friedhof in die Bibliothek ihrer Besitzer.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Rimescola il Ricordo Sereno e fino a tre carte bersaglio da un unico cimitero nei grimori dei rispettivi proprietari.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[単一の墓地にあるカードを最大3枚まで対象とし、静寂なる想起とそれらをオーナーのライブラリーに加えて切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[한 무덤에 있는 카드를 최대 세 장까지 목표로 정한다. 고요한 추모와 그 카드들을 각각 소유자의 서고에 넣고 섞는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Втасуйте Ясные Воспоминания и не более трех целевых карт из одного кладбища в библиотеки их владельцев.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Embaralhe Lembrança Serena e até três cards alvo de um único cemitério nos grimórios de seus donos.]]></LOCALISED_TEXT>
</SPELL_ABILITY>
</CARD_V2>
Re: Formal Request Thread
by thefiremind » 10 Nov 2013, 15:54
I can't understand what you're talking about (Serene Remembrance doesn't mention hands at all), anyway here's how I would code Serene Remembrance:drleg3nd wrote:can someone help me with this card, i think bring a card from graveyard to library but i couldnt find a reference for spell going back into hand also
- Serene Remembrance ability (untested) | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shuffle Serene Remembrance and up to three target cards from a single graveyard into their owners’ libraries.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Mélangez la Remembrance sereine et jusqu’à trois cartes ciblées d’un cimetière unique dans les bibliothèques de leurs propriétaires.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Baraja la Reminiscencia serena y hasta tres cartas objetivo de un mismo cementerio en las bibliotecas de sus propietarios.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mische die Ruhige Erinnerung und bis zu drei Karten deiner Wahl aus genau einem Friedhof in die Bibliothek ihrer Besitzer.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Rimescola il Ricordo Sereno e fino a tre carte bersaglio da un unico cimitero nei grimori dei rispettivi proprietari.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[単一の墓地にあるカードを最大3枚まで対象とし、静寂なる想起とそれらをオーナーのライブラリーに加えて切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[한 무덤에 있는 카드를 최대 세 장까지 목표로 정한다. 고요한 추모와 그 카드들을 각각 소유자의 서고에 넣고 섞는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Втасуйте Ясные Воспоминания и не более трех целевых карт из одного кладбища в библиотеки их владельцев.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Embaralhe Lembrança Serena e até três cards alvo de um único cemitério nos grimórios de seus donos.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_WHICH_PLAYERS_GRAVEYARD" definition="1" compartment="1" count="1" dependency="1" not_targeted="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
</TARGET_DEFINITION>
<TARGET tag="CARD_QUERY_CHOOSE_CARD_TO_SHUFFLE" definition="0" compartment="0" count="3" up_to="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD, EffectDC():Get_Targets(1):Get_PlayerPtr(0) )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local targetDC = EffectDC():Get_Targets(0)
if targetDC ~= nil then
for i=0,2 do
local target = targetDC:Get_CardPtr(i)
if target ~= nil then
target:PutOnBottomOfLibrary()
end
end
end
if EffectSource() ~= nil then
EffectDC():Protect_CardPtr( COMPARTMENT_ID_EFFECT_SOURCE )
EffectSource():PutOnBottomOfLibrary()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local targets_owner = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
if targets_owner ~= nil then
targets_owner:ShuffleLibrary()
end
local source_owner = EffectSource():GetOwner()
if source_owner ~= targets_owner then
source_owner:ShuffleLibrary()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>

The last action is meant to make the minimum number of shuffling: if Serene Remembrance and the three targets belong to the same player, his library should be shuffled only once.
CARD_QUERY_CHOOSE_CARD_TO_SHUFFLE needs localised text (the official TEXT_PERMANENT only contains CARD_QUERY_CHOOSE_PERMANENT_TO_SHUFFLE, which is a good template by the way).
< 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 sumomole » 10 Nov 2013, 16:17
I have another version, and I have tested we don't have to specify a player first.drleg3nd wrote:can someone help me with this card, i think bring a card from graveyard to library but i couldnt find a reference for spell going back into hand also

- Serene Remembrance | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shuffle Serene Remembrance and up to three target cards from a single graveyard into their owners’ libraries.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_CARD" definition="0" compartment="0" count="3" up_to="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
for i = 0,(3-1) do
local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
if target ~= nil then
EffectDC():Set_PlayerPtr(1, target:GetOwner())
target:PutOnBottomOfLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectDC():Protect_CardPtr( COMPARTMENT_ID_EFFECT_SOURCE )
EffectSource():PutOnBottomOfLibrary()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil and EffectSource():GetZone() == ZONE_LIBRARY then
local source_owner = EffectSource():GetOwner()
local owner = EffectDC():Get_PlayerPtr(1)
if source_owner ~= owner then
source_owner:ShuffleLibrary()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local owner = EffectDC():Get_PlayerPtr(1)
if owner ~= nil then
owner:ShuffleLibrary()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Formal Request Thread
by DrakkenMT » 10 Nov 2013, 17:57
I'll check and see if I can find my crash problem. thanks for looking into it Firemind
Re: Formal Request Thread
by xxd34thx » 10 Nov 2013, 18:36
Is there a way to get coding for black Lotis with like basic lands or something as opposed to just adding it pool for a single turn?
-
xxd34thx - Posts: 17
- Joined: 08 Nov 2013, 18:41
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: Google [Bot] and 8 guests