Barak's conversion script

From PCGen Wiki
Revision as of 22:59, 21 October 2010 by Barak (talk | contribs) (Created page with "[http://pcgen.svn.sourceforge.net/viewvc/pcgen/Trunk/utilities/convert%20514/?view=tar Barak's 5.12 -> 5.14 Conversion Script] Barak's conversion script automates much of the p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Barak's 5.12 -> 5.14 Conversion Script


Barak's conversion script automates much of the process of upgrading data files from 5.12 to 5.14. However, there are some things that cannot be converted. The script creates a log file and will note any of these items (and the file and line # within that file) in that log, as well as the recommended action to deal with them.

Below are the docs for the script.

FUNCTION: Update PCGen data files (.lst) from version 5.12 to 5.14

INSTALLATION:

  A) Get Perl if you don't already have it... any standard distribution with version 5.8 and over should work.  
  B) Once Perl is installed on your computer, put the script in the directory of your choice. 
  C) To run the script all you have to do is type "perl convert_514.pl" with the proper parameters to make it work.

COMMAND LINE PARAMETERS:

  -S --> Create generic shieldprof file (Optional)
  -I="<directory>" --> input directory (Required)
  -O="<directory>" --> output directory (Required)
      directory names must be in double quotes if they contains spaces

NOTES:

1) If you specify the same output directory as input directory your files will be overwritten, so make sure to backup your files in another location if you choose to do this. NOTE: This is *NOT* the recommended method

2) The script will remove CHOICE tags that do not have targets that are schools, subschools or descriptors. It will log these occurrences.

3) Any CHOOSE tag with only one choice (like the old "CHOOSE:+3 HP" for the Toughness feat) will be converted to CHOOSE:NOCHOICE

4) Any CHOOSE tag that does not have a first parameter that matches one of the documented ones will be converted to CHOOSE:STRING (in a non-equipmod file) or CHOOSE:STRING|...|TITLE=yyy in an equipmod file (the title will be the text between the colon and the first pipe)

5) Any tags that need to be manually updated will be passed through as is and noted in the log file (line numbers given reference *input files*)

6) Recommended usage is in two steps:

A) Point the script at your existing gamemode directory and direct output to the 5.14 gamemode directory B) Point the script at your existing data directory and direct output to the 5.14 data directory


TAG CONVERSIONS/ADDITIONS:

SA -> SAB (Logs those that need manual conversion - basically SA:.CLEAR)

PROFICIENCY -> PROFICIENCY:<subtoken>|<prof>

AUTO:ARMORPROF|TYPE -> AUTO:ARMORPROF|ARMORTYPE=

AUTO:SHIELDPROF|TYPE -> AUTO:SHIELDPROF|SHIELDTYPE=

FEATAUTO -> AUTO:FEAT

REPEATLEVEL -> <level #>:REPEATLEVEL

PREDEITY -> PREDEITY:x,y,y

PRETEMPLATE -> PRETEMPLATE:x,y,y

PRERACE:y -> PRERACE:x,y,y

PRELEVEL: -> PRELEVEL:MIN=#

PRELEVELMAX -> PRELEVEL:MAX=#

CONTAINS:-1 -> CONTAINS:UNLIM

MOVECLONE:w,x,y,z -> MOVECLONE:x,y,z (Logs those that need manual conversion)

PRETYPE: -> PRETYPE:x,y,y

ADD:SA -> ADD:SAB

KNOWNSPELLS:.CLEAR<stuff> -> KNOWNSPELLS:.CLEAR|<stuff>

PREHD:#-# -> PREHD:MIN=x,MAX=y

CHOICE -> CHOICE:SCHOOL

CHOICE -> CHOICE:SUBSCHOOL

CHOICE -> CHOICE:DESCRIPTOR

FAVCLASS -> FAVCLASS:<class>.<subclass>

FAVOREDCLASS -> FAVOREDCLASS:<class>.<subclass>

Create Armorprof file from armor.lst files

PRECLASS -> PRECLASS:#,y,y conversion

PREMOVE -> PREMOVE:#,y,y conversion

PREWIELD -> PREWIELD:#,y,y conversion

PREWEAPONPROF -> PREWEAPONPROF:#,y,y conversion

PRESPELLSCHOOL:Abjuration,1,5 -> PRESPELLSCHOOL:1,Abjuration=5

PRESPELLSCHOOLSUB:Healing,1,5 -> PRESPELLSCHOOLSUB:1,Healing=5

PRESPELLDESCRIPTOR:Evil,1,5 -> PRESPELLDESCRIPTOR:1,Evil=5

CHOOSE:Language(<type>) -> CHOOSE:LANGUAGE|<type>

CHOOSE:SKILLSNAMED|...|# -> CHOOSE:SKILLSNAMED|...<tab> SELECT:#

SPELLS:<spellbook>|TIMES:-1 to SPELLS:<spellbook>|TIMES:ATWILL

NUMCHOICES=1 not allowed in CHOOSE:SPELLLEVEL

CHOOSE: in EqMod with Title as first argument is deprecated -> CHOOSE:<subtoken>|<args>|TITLE=<title>

REMOVE:FEAT(<feat1>,<feat2>)# -> REMOVE:FEAT|<feat1>,<feat2>|#

CHOOSE:<blah text1>|<blah text2> -> CHOOSE:STRING|<blah text1>|<blah text2>

CHOOSE:CCSKILLLIST|x,x -> CHOOSE:SKILLSNAMED|CROSSCLASS

CHOOSE:NONCLASSSKILLLIST|x -> CHOOSE:SKILLSNAMED|CROSSCLASS|EXCLUSIVE

CHOOSE:SKILLIST|x,x -> CHOOSE:SKILLSNAMED|x|x

CHOOSE:SKILLIST|LIST -> CHOOSE:SKILLSNAMED|ALL

CHOOSE:Martial -> CHOOSE:PROFICIENCY|WEAPON|UNIQUE|TYPE.Martial

CHOOSE:Exotic -> CHOOSE:PROFICIENCY|WEAPON|UNIQUE|TYPE.Exotic

CHOOSE:SPELLLEVEL arguments may not contain ,

LIST in some CHOOSEs no longer used

ADD:FEAT(blah,blah1)# -> ADD:FEAT|#|blah,blah1

ADD:CLASSSKILLS(blah,blah1)# -> ADD:CLASSSKILLS|#|blah,blah

ADD:SPELLCASTER(blah,blah1)# -> ADD:SPELLCASTER|#|blah,blah

PRESPELLTYPE:Arcane,1,5 -> PRESPELLTYPE:1,Arcane=5

RESIZABLEEQUIPTYPE -> Add default to miscinfo.lst

WEAPONREACH -> Add default to miscinfo.lst

FOLLOWERALIGN -> PREALIGN

PREVIEWDIR:d20/fantasy -> added to miscinfo.lst as a commented out example

PREVIEWSHEET:preview.html -> added to miscinfo.lst as a commented out example

VISION:Low-light,Darkvision -> VISION:Low-light|Darkvision

CLASSES:Sorcerer=1[PRExxx] -> CLASSES:Sorcerer=1<tab>PRExxx

PRESA:Wild Empathy -> PRESAB:Wild Empathy

WT:- -> <tab>

ADD:Language -> ADD:LANGUAGE

BONUSFEATS:1 -> BONUS:FEAT|POOL|1

PREEQUIP:<equipment> -> PREEQUIP:#,<equipment>