It is currently 20 Jul 2025, 13:46
   
Text Size

Formal Request Thread

Moderator: CCGHQ Admins

Re: Formal Request Thread

Postby thefiremind » 05 Nov 2013, 10:41

drleg3nd wrote:hey guys, can someone chk out this code,thx
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. :wink: I would also not give an <AUTO_SKIP always="1" /> since your opponent will probably want to respond (if possible) before the Sphinx gains hexproof. Finally, the best AI_AVAILABILITY would be a response_source one, since most of the times you'll give hexproof in order to save the Sphinx from a targetting spell or ability.
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>
The triggered ability is OK.
< 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: Formal Request Thread

Postby 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
NEO_CheckOne | Open
Code: Select all
NEO_CheckOne = function(oValue)
-- returns true if oValue is 1
   return oValue == 1
end
The function works i have tested on simple code with DisplayMessage.

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

Postby 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).
< 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: Formal Request Thread

Postby 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 :
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 )
4. I also tried to filter AddMultipleChoiceAnswer with a condition before to add it but i receive a strange result. In this case i have all 7 answer without the right custom text, all answer are "player" and all enabled.
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

Postby sumomole » 05 Nov 2013, 18:27

As far as I know, in 2014 the max "AddMultipleChoiceAnswer" is 6.
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Formal Request Thread

Postby 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.
DrakkenMT
 
Posts: 14
Joined: 04 Oct 2013, 14:34
Has thanked: 2 times
Been thanked: 0 time

Re: Formal Request Thread

Postby thefiremind » 10 Nov 2013, 01:02

DrakkenMT wrote:Firemind the one you posted seems to crash the game upon loading. not sure whats causing it.
Let me have a guess...
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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby DrakkenMT » 10 Nov 2013, 03:03

ok, will check the format of the xml then. sorry should have looked into that first :)
DrakkenMT
 
Posts: 14
Joined: 04 Oct 2013, 14:34
Has thanked: 2 times
Been thanked: 0 time

Re: Formal Request Thread

Postby DrakkenMT » 10 Nov 2013, 03:08

ok, I checked it and the format is still UTF-8, and all the special characters appear proper
DrakkenMT
 
Posts: 14
Joined: 04 Oct 2013, 14:34
Has thanked: 2 times
Been thanked: 0 time

Re: Formal Request Thread

Postby thefiremind » 10 Nov 2013, 09:29

DrakkenMT wrote:ok, I checked it and the format is still UTF-8, and all the special characters appear proper
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?
< 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: Formal Request Thread

Postby 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>
drleg3nd
 
Posts: 528
Joined: 14 May 2012, 20:05
Has thanked: 5 times
Been thanked: 30 times

Re: Formal Request Thread

Postby thefiremind » 10 Nov 2013, 15:54

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
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:
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>
I don't know if asking to target more than 1 card in a graveyard automatically restricts it to only one graveyard (and I don't want to test it now), so I added a player selection just to be sure. The last time I tried to use a non-targetting target it didn't work, so don't trust this code too much. :lol:
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...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Formal Request Thread

Postby sumomole » 10 Nov 2013, 16:17

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
I have another version, and I have tested we don't have to specify a player first. :mrgreen:
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>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Formal Request Thread

Postby DrakkenMT » 10 Nov 2013, 17:57

I'll check and see if I can find my crash problem. thanks for looking into it Firemind
DrakkenMT
 
Posts: 14
Joined: 04 Oct 2013, 14:34
Has thanked: 2 times
Been thanked: 0 time

Re: Formal Request Thread

Postby 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?
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 9 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 9 guests

Login Form