It is currently 23 Apr 2024, 13:58
   
Text Size

Discard Deck and Lim-Dul's Vault

Moderator: CCGHQ Admins

Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 28 May 2013, 14:49

Just a Discard Deck. It doesn't contains any text permanent AND it has the DIMIR image. You need the DLC with DIMIR.


PS I need to implement Lim-Duls Vault. But i have a lot of problem because i'm not very skilled on card implementation. If somebody can help me i will be grateful
Attachments
DECK_Discard01_102.zip
(9.93 MiB) Downloaded 433 times
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time

Re: Discard Deck and Lim-Dul's Vault

Postby thefiremind » 28 May 2013, 14:59

Whoa, Lim-Dûl's Vault is one hell of a card to make... don't feel frustrated if you can't code it. It will probably give some problems to me as well, but I should be able to get it done with some patience.
< 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: 721 times

Re: Discard Deck and Lim-Dul's Vault

Postby sumomole » 28 May 2013, 15:24

This's my code, but AI doesn't seem to like to use it, I really expect a version that AI like. :lol:
Code: Select all
    <RESOLUTION_TIME_ACTION repeating="1">
    local n = MTG():GetActionRepCount()
    local targetindex = n/3
    local parity = n % 3
    local filter = Object():GetFilter()
    local player = EffectController()   
    local card = player:Library_GetTop()
    local target_array = {}
    if card ~= nil and Object():GetMultipleChoiceResult() == 0 then
      if parity == 0 then
        filter:Clear()
        filter:NotTargetted()
        filter:SetZone( ZONE_LIBRARY )
        filter:SetPlayer( player )   
        filter:SetPortion( 5 )     
        player:SetTargetCount( 5 )
        player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_FIRST_TOP_CARD" )
        player:SetTargetPrompt( 1, "CARD_QUERY_CHOOSE_SECOND_TOP_CARD" )
        player:SetTargetPrompt( 2, "CARD_QUERY_CHOOSE_THIRD_TOP_CARD" )
        player:SetTargetPrompt( 3, "CARD_QUERY_CHOOSE_FOURTH_TOP_CARD" )
        player:SetTargetPrompt( 4, "CARD_QUERY_CHOOSE_FIFTH_TOP_CARD" )
        player:ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(targetindex) )
      elseif parity == 1 then
        player:BeginNewMultipleChoice() 
         if player:GetLifeTotal() &gt; 0 and CountCardsInLibrary( player ) &gt; 5 then
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ON_BOTTOM_LIBRARY" ) 
         else
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ON_BOTTOM_LIBRARY", false )
         end
         player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ONTO_LIBRARY" )
        player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_MODE" )
      else
        if EffectDC():Get_Targets(targetindex) ~= nil then
          for i=0,4 do   
             target_array[i] = EffectDC():Get_Targets(targetindex):Get_CardPtr(i)
          end   
          for i=0,4 do   
             if target_array[i] ~= nil then
                target_array[i]:PutOnBottomOfLibrary()
             end
           end
        end
         player:LoseLife( 1 )
      end
      return true
    else
      if EffectDC():Get_Targets(targetindex) ~= nil then
        player:ShuffleLibrary()
        for i=0,4 do   
           target_array[i] = EffectDC():Get_Targets(targetindex):Get_CardPtr(i)
        end
        for i=4,0,-1 do   
           if target_array[i] ~= nil then
              target_array[i]:PutOnTopOfLibrary()
           end
         end
      end
      return false
    end     
    </RESOLUTION_TIME_ACTION>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: Discard Deck and Lim-Dul's Vault

Postby thefiremind » 28 May 2013, 15:59

I have put my version here (so we can always find all the requested cards in one topic, otherwise it's a big mess) but it suffers the same problem.
< 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: 721 times

Re: Discard Deck and Lim-Dul's Vault

Postby East Bay » 28 May 2013, 17:15

sumomole wrote:This's my code, but AI doesn't seem to like to use it, I really expect a version that AI like. :lol:
Code: Select all
    <RESOLUTION_TIME_ACTION repeating="1">
    local n = MTG():GetActionRepCount()
    local targetindex = n/3
    local parity = n % 3
    local filter = Object():GetFilter()
    local player = EffectController()   
    local card = player:Library_GetTop()
    local target_array = {}
    if card ~= nil and Object():GetMultipleChoiceResult() == 0 then
      if parity == 0 then
        filter:Clear()
        filter:NotTargetted()
        filter:SetZone( ZONE_LIBRARY )
        filter:SetPlayer( player )   
        filter:SetPortion( 5 )     
        player:SetTargetCount( 5 )
        player:SetTargetPrompt( 0, "CARD_QUERY_CHOOSE_FIRST_TOP_CARD" )
        player:SetTargetPrompt( 1, "CARD_QUERY_CHOOSE_SECOND_TOP_CARD" )
        player:SetTargetPrompt( 2, "CARD_QUERY_CHOOSE_THIRD_TOP_CARD" )
        player:SetTargetPrompt( 3, "CARD_QUERY_CHOOSE_FOURTH_TOP_CARD" )
        player:SetTargetPrompt( 4, "CARD_QUERY_CHOOSE_FIFTH_TOP_CARD" )
        player:ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(targetindex) )
      elseif parity == 1 then
        player:BeginNewMultipleChoice() 
         if player:GetLifeTotal() &gt; 0 and CountCardsInLibrary( player ) &gt; 5 then
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ON_BOTTOM_LIBRARY" ) 
         else
            player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ON_BOTTOM_LIBRARY", false )
         end
         player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PUT_ONTO_LIBRARY" )
        player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_MODE" )
      else
        if EffectDC():Get_Targets(targetindex) ~= nil then
          for i=0,4 do   
             target_array[i] = EffectDC():Get_Targets(targetindex):Get_CardPtr(i)
          end   
          for i=0,4 do   
             if target_array[i] ~= nil then
                target_array[i]:PutOnBottomOfLibrary()
             end
           end
        end
         player:LoseLife( 1 )
      end
      return true
    else
      if EffectDC():Get_Targets(targetindex) ~= nil then
        player:ShuffleLibrary()
        for i=0,4 do   
           target_array[i] = EffectDC():Get_Targets(targetindex):Get_CardPtr(i)
        end
        for i=4,0,-1 do   
           if target_array[i] ~= nil then
              target_array[i]:PutOnTopOfLibrary()
           end
         end
      end
      return false
    end     
    </RESOLUTION_TIME_ACTION>
AI can't use combo cards what do you think they will get with Lim-Dûl's Vault? Couple basics or some Underground Sea :lol:
User avatar
East Bay
 
Posts: 85
Joined: 17 Mar 2013, 02:05
Has thanked: 33 times
Been thanked: 30 times

Re: Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 29 May 2013, 12:25

Thank you.
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time

Re: Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 29 May 2013, 15:15

About TEXT_PERMANENT.
I need to know some information. If i include in my DECK a folder named TEXT_PERMANENT and inside it i put my texts permanent XML files, it should work fine, because so happens in most of decks of other modders i studied.

But when i try to do that, my decks still don't have Name and my text permanent about DECK is not read at all.
Viceversa, some TEXT permanent as the one firemind put in the Lim Duls Vault , works really fine.

I seen the TEXT PERMANENT for a DECK NAME. It seems to me that the only job to do is to copy another TEXT permanent and adds rows with the name of the deck in the various languages.
There are some other links that i don't see??
The name of the TEXT PERMANENT FILE should be particular?

I beg your pardon for the noise i'm adding to you.
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time

Re: Discard Deck and Lim-Dul's Vault

Postby RiiakShiNal » 29 May 2013, 15:41

The name of the directory TEXT_PERMANENT must be TEXT_PERMANENT, but the names of the files inside it don't matter. The contents of the files do matter especially due to the namespaces that the file references.

For example this is a pretty minimal Text Permanent file:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author>DotP 2013 Deck Builder</Author>
    <Created>2013-05-24T11:05:29Z</Created>
    <Company>
    </Company>
  </DocumentProperties>
  <Worksheet ss:Name="Sheet4">
    <Table>
      <Row>
        <Cell><Data ss:Type="String">Ident</Data></Cell>
        <Cell><Data ss:Type="String">Comment</Data></Cell>
        <Cell><Data ss:Type="String">Master Text</Data></Cell>
        <Cell><Data ss:Type="String">French</Data></Cell>
        <Cell><Data ss:Type="String">Spanish</Data></Cell>
        <Cell><Data ss:Type="String">German</Data></Cell>
        <Cell><Data ss:Type="String">Italian</Data></Cell>
        <Cell ss:Index="9"><Data ss:Type="String">Japanese</Data></Cell>
        <Cell><Data ss:Type="String">Korean</Data></Cell>
        <Cell><Data ss:Type="String">Russian</Data></Cell>
        <Cell><Data ss:Type="String">Portuguese (Brazil)</Data></Cell>
      </Row>
      <Row>
        <Cell><Data ss:Type="String">DECK_100045_NEW_DECK</Data></Cell>
        <Cell ss:Index="3"><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell ss:Index="9"><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
        <Cell><Data ss:Type="String">New Deck</Data></Cell>
      </Row>
    </Table>
  </Worksheet>
</Workbook>
It has an XML Declaration, an XML Program Directive (saying it is an Excel Spreadsheet), defines a Workbook, Document Properties (the properties may not be needed), a single Worksheet (with the name "Sheet4" since all of the official ones use "Sheet4"), with a table, a header row (to identify the columns), and defines a single string "DECK_100045_NEW_DECK" as "New Deck" in all the languages.

It should also be noted that XML is CaSe SeNsItIvE, so "cell" != "Cell", "WorkBook" != "Workbook", etc.... Also the ss:Name, ss:Index, and ss:Type attributes are more than likely required as they are defined as required by the namespaces. Same with the xmlns attributes to define the namespaces.

The data in the first cell of each row (other than the header row) is the string defined for that row. It must be the same as the string you are trying to define (in uppercase). So if your Deck's filename is "D13_1234_My_New_Deck.xml" then the data in the first cell of the row should be "D13_1234_My_New_Deck". If you see a string in the game with [] around it it is because that string is not defined (or not defined properly).

Edited because apparently it doesn't uppercase deck names for the string look up.
Last edited by RiiakShiNal on 29 May 2013, 16:41, edited 1 time in total.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 29 May 2013, 16:18

So, my deck name is DECK_FammiGiocareUB_108 (the name of the XML DECK file)

I used your code like this.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author>DotP 2013 Deck Builder</Author>
    <Created>2013-05-24T11:05:29Z</Created>
    <Company>
    </Company>
  </DocumentProperties>
  <Worksheet ss:Name="Sheet4">
    <Table>
      <Row>
        <Cell><Data ss:Type="String">Ident</Data></Cell>
        <Cell><Data ss:Type="String">Comment</Data></Cell>
        <Cell><Data ss:Type="String">Master Text</Data></Cell>
        <Cell><Data ss:Type="String">French</Data></Cell>
        <Cell><Data ss:Type="String">Spanish</Data></Cell>
        <Cell><Data ss:Type="String">German</Data></Cell>
        <Cell><Data ss:Type="String">Italian</Data></Cell>
        <Cell ss:Index="9"><Data ss:Type="String">Japanese</Data></Cell>
        <Cell><Data ss:Type="String">Korean</Data></Cell>
        <Cell><Data ss:Type="String">Russian</Data></Cell>
        <Cell><Data ss:Type="String">Portuguese (Brazil)</Data></Cell>
      </Row>
     
     <Row>
      <Cell><Data ss:Type="String">DECK_FAMMIGIOCAREUB_108</Data></Cell>
      <Cell ss:Index="3"><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">Mancanza di tempo</Data></Cell>
      <Cell ss:Index="9"><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
     </Row>
    </Table>
  </Worksheet>
</Workbook>
It is in a XML File in TEXT_PERMANENT folder. But i still have the deck name between square brackets [DECK_FammiGiocareUB_108]

There's some link i miss, maybe some OTHER file that have to refers to this Text Permanent file??
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time

Re: Discard Deck and Lim-Dul's Vault

Postby RiiakShiNal » 29 May 2013, 16:39

libertyfighter wrote:So, my deck name is DECK_FammiGiocareUB_108 (the name of the XML DECK file)

I used your code like this.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author>DotP 2013 Deck Builder</Author>
    <Created>2013-05-24T11:05:29Z</Created>
    <Company>
    </Company>
  </DocumentProperties>
  <Worksheet ss:Name="Sheet4">
    <Table>
      <Row>
        <Cell><Data ss:Type="String">Ident</Data></Cell>
        <Cell><Data ss:Type="String">Comment</Data></Cell>
        <Cell><Data ss:Type="String">Master Text</Data></Cell>
        <Cell><Data ss:Type="String">French</Data></Cell>
        <Cell><Data ss:Type="String">Spanish</Data></Cell>
        <Cell><Data ss:Type="String">German</Data></Cell>
        <Cell><Data ss:Type="String">Italian</Data></Cell>
        <Cell ss:Index="9"><Data ss:Type="String">Japanese</Data></Cell>
        <Cell><Data ss:Type="String">Korean</Data></Cell>
        <Cell><Data ss:Type="String">Russian</Data></Cell>
        <Cell><Data ss:Type="String">Portuguese (Brazil)</Data></Cell>
      </Row>
     
     <Row>
      <Cell><Data ss:Type="String">DECK_FAMMIGIOCAREUB_108</Data></Cell>
      <Cell ss:Index="3"><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">Mancanza di tempo</Data></Cell>
      <Cell ss:Index="9"><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
      <Cell><Data ss:Type="String">No more Time</Data></Cell>
     </Row>
    </Table>
  </Worksheet>
</Workbook>
It is in a XML File in TEXT_PERMANENT folder. But i still have the deck name between square brackets [DECK_FammiGiocareUB_108]

There's some link i miss, maybe some OTHER file that have to refers to this Text Permanent file??
This:
Code: Select all
[DECK_FammiGiocareUB_108]
tells me that it is looking for "DECK_FammiGiocareUB_108" which means it actually does string look ups using the exact name of the deck instead of the uppercase name of the deck. So in your text permanent file it should be:
Code: Select all
<Cell><Data ss:Type="String">DECK_FammiGiocareUB_108</Data></Cell>
Most modders make all their files UPPERCASE so they don't run into problems like this.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 29 May 2013, 17:46

That is exactly what i done before opening this topic. Because nor in that way the text works.
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time

Re: Discard Deck and Lim-Dul's Vault

Postby RiiakShiNal » 29 May 2013, 18:33

That could mean there is an issue where the game won't load it unless it is in all caps then. Have you tried making it all caps in the text permanent file AND making the deck filename all caps?
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Discard Deck and Lim-Dul's Vault

Postby libertyfighter » 29 May 2013, 22:59

Finally get rid of that.
So the name must be in uppercase AND the name of the TEXT PERMANENT file with the deck must have the same name of the deck xml file, except for DECK_ and TEXT_

That is at least what it seems
libertyfighter
 
Posts: 16
Joined: 17 May 2013, 10:12
Has thanked: 0 time
Been thanked: 0 time


Return to 2013

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

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

Login Form