Opened 11 years ago

Last modified 11 years ago

#1757 new enhancement

Script to automatically change unit stats — at Initial Version

Reported by: alpha123 Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Non-game systems Keywords: patch
Cc: Patch:

Description

I wrote a command-line script to automatically bulk-adjust unit stats.

Synopsis:

./changestats.pl --key Armour/Pierce --change 1 Melee Cavalry

Options:

--key, -k: This is the XML element to modify. Can be arbitrarily deep, i.e. Cost/Resources/food works as expected.

--change, -c: How much to modify the key by. For negative numbers, you'll need an equals sign: ./changestats.pl --Key Cost/BuildTime -c=-10 Domestic

--mod, -m: The mod to use. Defaults to "public".

--print, -p: If this is specified, changestats will only print matching templates and not do any modification.

Warnings: USE WITH CAUTION! THIS THING IS EXPERIMENTAL AND HASN'T BEEN THOROUGHLY TESTED! You probably ought to double-check that it made all the modifications correctly. That said, it has worked quite well for me so far. It's also kind of slow. There's probably a much more efficient way to do what it does. Now, before you complain too much, it searches through hundreds of templates... anyway it is still much faster than adjusting stats by hand. I'm just warning you in case it seems like it's taking a while. That's normal.

Change History (0)

Note: See TracTickets for help on using tickets.