I have done the same thing as Joel using excel. You just need to handle the Tab 
characters and quoatation marks specially. It is also easier if you make your 
counter definitions as simple as possible and add as many traits as possible 
using protototypes.

Here is a typical formulae cell I might use. I created one counter, copied the 
definition out of the buildfile, then replaced the Tabs with char(9) and the 
variable parts of the counter from columns in the spreadsheet. Just watch your 
quoation mark handling. It's clunky, but works and saves masses of time when 
adding 400 nearly identical counters!

="<VASSAL.build.widget.PieceSlot entryName=""General "&RC[-1]&""" width=""75"" 
height=""75"">+/null/prototype;Neutral"&CHAR(9)&"piece;;;gen-"&RC[-1]&".png;General
 "&RC[-1]&"/"&CHAR(9)&"null;132;161</VASSAL.build.widget.PieceSlot>"

The final step is to manually copy all of your images into the module.

Cheers,
Brent.




*********** REPLY SEPARATOR ***********

On 19/10/2006 at 8:51 PM Joel Uckelman wrote:
Thus spake "rolhelne":
> I have a data base of the piece i need to create in vassl !!
> 
> Does anyone alreasy made a script to import data from csv or xls etc... 
> in vassal module?
> 
> Does anyone alredy create a export in txt ?
> 
> is there a way to replace easily formated value in the built file by 
> vlues of a line or lines in a data file ? ( i am not sure of my 
> english, sorry !! )
> 
> is "Create manually " th e only way to create my 465 pieces ?

It's fairly easy to write a Perl script to generate token lines for a
build file. All you need to do is:

1. Create a token in your module and save it.
2. Unzip the module and get the line for the token out of the build file,
so you can use that line as a model.
3. Read your CSV data into your script and output it in the same format
as the line you took from the build file.

Maybe have a look at the script I wrote to generate tokens for The Longest
Day, here:

http://www.nomic.net/viewvc/games/tld/mod/tokens-split.pl?revision=72&view=markup

I'm building my token images as SVG at the same time I'm writing out the
build file lines. It's not well-commented, but there's nothing more complex
here than a while loop, some conditionals, and a few here documents. There's
more SVG in this script than there is Perl, really.

(BTW, in case anyone cares, you can see a rendered image of the tokens
here:

http://www.nomic.net/viewvc/games/tld/mod/tld-tokens.png?revision=10&view=markup

And there's other interesting TLD stuff in the repository as well, if you
poke around.)

-- 
J.

 
____________________________________________________________
Brent Easton                       
Analyst/Programmer                               
University of Western Sydney                                   
Email: [EMAIL PROTECTED]



[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vassalengine/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/vassalengine/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to