News:

A forum for users of LackeyCCG

Main Menu

Looking for some xml savvy

Started by remyegusku, October 09, 2013, 11:40:11 PM

Previous topic - Next topic

remyegusku

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?

Trevor

There currently isn't a shortcut. I should add some more options for things like that.

Jerod_tb

Copy and paste each line then change the data in the lines to what you need to.

lucsampaio

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.