LackeyCCG

LackeyCCG Forum => Plugins & Plugin Creation Forum => Topic started by: remyegusku on October 09, 2013, 11:40:11 PM

Title: Looking for some xml savvy
Post by: remyegusku on October 09, 2013, 11:40:11 PM
Hi,

I'm trying to develop some packs for my plugin.  I've currently got a set up similar to my example below (but with a greater quantity of cards), where there is a group of cards which will always occur in this pack (cards A - E), and then a smaller group of cards (random cards 1 - 2) of which there are 100 different possible arrangements which can occur.



<pack>
     <packtitle>Example Pack</packtitle>
     <packimage>Example.png</packimage>
     <packformat>normal</packformat>
     <packkind>60 Card Starter</packkind>
    <packdoubles>yes</packdoubles>
     <chance>
          <prob>1</prob>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card A</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card B</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card C</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card D</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card E</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Random Card 1</data></crit></kind>
        <kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Random Card 2</data></crit></kind>
     </chance>

etc...   

</pack>



I understand how to do all this, but what I'm wondering is whether there is some sort of shortcut I can use in xml to create a shorthand for cards A - E, instead of typing all that out for every iteration of random cards 1 - 2 that I have to type out. 

Any thoughts?
Title: Re: Looking for some xml savvy
Post by: Trevor on October 10, 2013, 03:36:36 AM
There currently isn't a shortcut. I should add some more options for things like that.
Title: Re: Looking for some xml savvy
Post by: Jerod_tb on October 11, 2013, 02:47:29 AM
Copy and paste each line then change the data in the lines to what you need to.
Title: Re: Looking for some xml savvy
Post by: lucsampaio on October 27, 2013, 09:08:18 AM
A little tip I use to do repetitive stuff like this is to actually set the text in a spreadsheet. The first column in your example would be

<kind><qty>1</qty><crit><field>Name</field><eval>IS</eval><data>Card

the second column would be the place where you would actually write different stuff, while the third column would be

</data></crit></kind>

Afterwards you can just copy/paste the cells in a .txt editor and then replace the tabulation via automated search and replace functions of the editor.