Following on from my earlier ramblings on advanced spawning of units would something like the following be helpful. If so are there any other feature that would improve it. In particular, as they are easy to add, other game data fields (like {WEALTH}) that may be useful.
function PrintHelp()
print "Create units with customized skills and items."
print ""
print "Usage: Spawn.lua CREATURE CASTE NAME X Y Z CIV extraconfig"
print "extraconfig can be one or more of the following in any order (if calling via autosyndrom command each is a seperate SYN_CLASS E.g. [SYN_CLASS:SKILL:MINING:0:0:5:1:10]"
print "SKILL:skillname:skilllevelDiceCount:skilllevelDiceSize:skilllevelDiceBonus:minlevel:maxlevel"
print " minlevel and maxlevel are optional"
print " E.g. SKILL:MINING:0:0:5:1:10 (grants mining at skill level 5)"
print " E.g. SKILL:MINING:1:6:2:1:10 (grants mining at skill level 3-8)"
print " E.g. SKILL:MINING:1:6:-2:2:10 (grants mining at skill level 2-4, and 2 happens half the time as value below at capped to 2)"
print ""
print "ITEM:chance:quantity:quality(1-5):wearlevel(1-5):typetoken:materialtoken"
print " E.g. ITEM:50:1:1:1:ITEM_HELM:ITEM_HELM_CAP:INORGANIC:STEEL (50% chance of 1 steel cap)"
print " Created items will be worn/wielded/placed in quivers as appropiate, other item will be place in the units inventory (E.g. could have 20% chance or a created adventurer invader carrying a treasure map to use in a special reaction)"
print " For now layer restriction are not checked (E.g. Wearing 10 breast plates) and it is also possible to over-encumber the unit so it can not move"
print ""
print "SYNDROME:chance:inorganic:immuneSyndromeClasses:immuneTokens"
print " inorganic = syndrome to be added. specified in an inorganic (VALID TOKENS: ANY INORGANIC)"
print " immuneSyndromeClasses = syndrome class that is immune, use NONE to skip this check (VALID TOKENS: ANY SYNDROME CLASS TOKENS {seperated by commas}, or NONE)"
print " immuneTokens = tokens that are forbidden, use NONE to skip this check (VALID TOKENS: ANY TOKENS FOUND IN 'tokens.txt' {seperated by commas}, or NONE)"
print " immune tokens should mainly be used to used to apply one of a group of syndromes (e.g. 5x20% syndromes all in the same class, will garantee not more than one is applied)"
print " attempts to apply syndromes will be done is the order they are specified in"
print ""
print "LOCATION:EDGE:LEVEL(SURFACE, UNDERGROUND, CAVERN1, CAVERN2, CAVERN3):edge(NORTH, EAST, SOUTH, WEST, RANDOM)"
print "or"
print "LOCATION:POINT:X:Y:Z"
print "or"
print "LOCATION:POINT:X,Y,Z"
print " E.g. LOCATION:EDGE:SURFACE:RANDOM or LOCATION:POINT:20:30:140"
print " Only the last location specified will be used."
print " Location will be ignored if X Y Z on the command line are >= 0"
print ""
print "All values where numbers can be specified can use mathmatical operators (+-()*/) and the following special tokens"
print " {POP} - Fortress population"
print " {AGE} - Fortress age in years"
print " {WEALTH} - Fortress total wealth (as per stocks screen)"
print " {EXPORTWEALTH} - Fortress exported wealth (as per stocks screen)"
print " {IMPORTWEALTH} - Fortress imported wealth (as per stocks screen)"
print ""
print "E.g. SKILL:FIGHTER:1:{AGE}:0:1:10 (skill between 1 and the fortress age, capped at 1-10)"
print "E.g. SKILL:FIGHTER:1:6:-5 + {POP}/10 + {WEALTH}/100000:1:15 (d6-5 + 1 for every 10 pop and 1000000 wealth, capped at 1-15)"
print "After the maths the value for a field is rounded down. SKILL:FIGHTER:{POP}/10 + {POP}/10: would roll 3 dice for 15 pop but SKILL:FIGHTER:1.9: would only roll 1 dice"
print "item wear level and quality are capped at 1-5, location is capped by the map bounds, and presently will case issues if you try to create units inside rock. In future will find the nearest floor to place unit on."
print ""
print "TODO: groups, named groups loaded from text file (E.g. GROUP:LOAD:AdventureSquad1.txt) and setting squad leader"
print "TODO: allow civ to support named race (e.g. goblin, human), will then random pick one civ of appropiate type (within trade range if any available) to create units as. Should then mean appropiate diplomat penalties for kill the civ members. "
print "TODO: built in ai (setting thief, ambush, seige, border siege, failing that working setting some/all dwarves as present kill/move targets)"
print "TODO: create unit on nearest valid location, if specified location is blocked (allow (partially) random locations to be used)"
print "TODO: impliment the create UNDERGROUND, CAVERN1, CAVERN2, CAVERN3"
print "TODO: let creation location prefer either EDGE or random location than can path to a dwarf/building/ construction etc."
print ""
print "TOINVESTIGATE: Proper dice parser for all number fields rahter than seperate entries for each dice part (e.g. :3d({POP}/10 + 2) + {AGE}/3) + 2d2:"
print "TOINVESTIGATE: additional math operators (e.g. max(), min(), avg() etc.) adding any lua function call required no work, BUT need to update the validator to ensure only safe lua code is executed."
print "TOINVESTIGATE: Adding splatter to items (e.g. poison)"
print "TOINVESTIGATE: Intergrate with DiggingInvader to have flag to mark a specific unit digging ability (E.g. Sapper unit)"
print "TOINVESTIGATE: Creating a proper invasion (show as SIEGE in ui, show in site history after fortress death)"
print "TOINVESTIGATE: Custom ai (hit and run snipers, assasinate targetd creature and then run etc)"
end