v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "User:Button/ModestMod"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(graphics scribblings)
Line 59: Line 59:
  
 
<pre>
 
<pre>
Graphics tags:
+
graphicsdict = [] # dict string:string, where the first string is the tag type formatted with pipes a la that section up there (but with $'s replaced), and the second string is the tag as it appears in the raws
OBJECT|CREATURE|CREATURE_TILE
+
milestones=["OBJECT","CREATURE","CASTE","PLANT","GROWTH","INORGANIC","BUILDING_WORKSHOP","BUILDING_FURNACE","ENTITY","ITEM_TOOL"]
OBJECT|CREATURE|COLOR
+
files = [] # dict string:list(string), where the first string is the raw file name, and the list is a list of
OBJECT|CREATURE|GLOWTILE
+
valid_tokens = [] # all the pipe-separated graphics tokens loaded into memory
OBJECT|CREATURE|GLOWCOLOR
 
OBJECT|CREATURE|ALTTILE
 
OBJECT|CREATURE|CASTE|CASTE_ALTTILE
 
OBJECT|CREATURE|CASTE|CASTE_COLOR
 
OBJECT|CREATURE|CASTE|CASTE_GLOWCOLOR
 
OBJECT|CREATURE|CASTE|CASTE_GLOWTILE
 
OBJECT|CREATURE|CASTE|CASTE_SOLDIER_ALTTILE
 
OBJECT|CREATURE|CASTE|CASTE_SOLDIER_TILE
 
OBJECT|CREATURE|CASTE|CASTE_TILE
 
OBJECT|CREATURE|CREATURE_SOLDIER_TILE
 
OBJECT|CREATURE|CASTE|REMAINS_COLOR
 
OBJECT|CREATURE|REMAINS_COLOR
 
OBJECT|CREATURE|SENSE_CREATURE_CLASS
 
OBJECT|CREATURE|CASTE|SENSE_CREATURE_CLASS
 
OBJECT|CREATURE|SOLDIER_ALTTILE
 
 
 
OBJECT|PLANT|GROWTH|GROWTH_PRINT
 
OBJECT|PLANT|TREE_TILE
 
OBJECT|PLANT|DEAD_TREE_TILE
 
OBJECT|PLANT|SAPLING_TILE
 
OBJECT|PLANT|DEAD_SAPLING_TILE
 
OBJECT|PLANT|TREE_COLOR
 
OBJECT|PLANT|DEAD_TREE_COLOR
 
OBJECT|PLANT|SAPLING_COLOR
 
OBJECT|PLANT|DEAD_SAPLING_COLOR
 
OBJECT|PLANT|PICKED_TILE
 
OBJECT|PLANT|DEAD_PICKED_TILE
 
OBJECT|PLANT|SHRUB_TILE
 
OBJECT|PLANT|DEAD_SHRUB_TILE
 
OBJECT|PLANT|PICKED_COLOR
 
OBJECT|PLANT|DEAD_PICKED_COLOR
 
OBJECT|PLANT|SHRUB_COLOR
 
OBJECT|PLANT|DEAD_SHRUB_COLOR
 
OBJECT|PLANT|GRASS_TILES
 
OBJECT|PLANT|ALT_GRASS_TILES
 
OBJECT|PLANT|GRASS_COLORS
 
OBJECT|PLANT|ALT_PERIOD
 
OBJECT|PLANT|SEED
 
 
 
milestones=["OBJECT","CREATURE","CASTE","PLANT","PLANT_GROWTH"]
 
  
 +
# Process graphicsified raws into a dict, or load from the save of a previously generated dict
 
def generate_graphics_dict(sourcedir, graphicsdict):
 
def generate_graphics_dict(sourcedir, graphicsdict):
 
for file in sourcedir:
 
for file in sourcedir:
Line 124: Line 85:
 
graphicsdict[graphics_tag(currentobj,tag)] = full_tag
 
graphicsdict[graphics_tag(currentobj,tag)] = full_tag
  
 +
# Apply graphics dict to the raws found in sourcedir, outputting in tardir .
 
def apply_graphics(sourcedir, tardir, graphicsdict):
 
def apply_graphics(sourcedir, tardir, graphicsdict):
 +
graphicsdictcopy = graphicsdict.copy() # This copies the object references of the dict item, not the reference to the dict nor the contents of the contents.
 
for file in sourcedir:
 
for file in sourcedir:
 
passedstones = []
 
passedstones = []
Line 138: Line 101:
 
currentobj[tag] = body_tokens(full_tag)
 
currentobj[tag] = body_tokens(full_tag)
 
else:
 
else:
if has_remaining_graphics_tags(graphicsdict,currentobj):
+
if has_remaining_graphics_tags(graphicsdictcopy,currentobj):
for graphicstag in pull_remaining_graphics_tags(graphicsdict,currentobj):
+
for graphicstag in pull_remaining_graphics_tags(graphicsdictcopy,currentobj):
 
moddedline += '\n'
 
moddedline += '\n'
 
moddedline += write_tag(graphicstag)
 
moddedline += write_tag(graphicstag)
graphicsdict.remove(graphics_tag(currentobj,tag))
+
graphicsdictcopy.remove(graphics_tag(currentobj,tag))
 
while passedstones contains tag:
 
while passedstones contains tag:
 
rollback = passedstones.pop()
 
rollback = passedstones.pop()
Line 149: Line 112:
 
currentobj[tag] = body_tokens(full_tag)
 
currentobj[tag] = body_tokens(full_tag)
 
elif is_graphics_tag(currentobj, tag):
 
elif is_graphics_tag(currentobj, tag):
moddedline.replace(full_tag, graphicsdict[graphics_tag(currentobj,tag)])
+
moddedline.replace(full_tag, graphicsdictcopy[graphics_tag(currentobj,tag)])
graphicsdict.remove(graphics_tag(currentobj,tag))
+
graphicsdictcopy.remove(graphics_tag(currentobj,tag))
 
tardir.write(moddedline + '\n')
 
tardir.write(moddedline + '\n')
 
close file in tardir
 
close file in tardir
 +
 +
# Load valid graphics token definitions from file
 +
def load_valid_graphics_tokens():
 +
filelocation = ..\blahblahblah\graphicstiles.txt
 +
for line in filelocation.open():
 +
if length(line.strip()) > 0:
 +
valid_tokens.append(line)
 +
filelocation.close()
 +
 +
# Write graphics dict to file
 +
def save_graphics_dict(tarfile, graphicsdict):
 +
graphicsdictcopy = graphicsdict.copy()
 +
tarfile.open(write)
 +
for rawformmated in to_raw_format(graphicsdictcopy):
 +
tarfile.write(rawformatted)
 +
tarfile.close()
 +
</pre>
 +
 +
== More well-formatted graphics token reference file ==
 +
 +
<pre>
 +
OBJECT:CREATURE|CREATURE:$|CREATURE_TILE:_
 +
OBJECT:CREATURE|CREATURE:$|COLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|GLOWTILE:_
 +
OBJECT:CREATURE|CREATURE:$|GLOWCOLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|ALTTILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_ALTTILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_COLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_GLOWCOLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_GLOWTILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_SOLDIER_ALTTILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_SOLDIER_TILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_TILE:_
 +
OBJECT:CREATURE|CREATURE:$|CREATURE_SOLDIER_TILE:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|REMAINS_COLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|REMAINS_COLOR:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|SENSE_CREATURE_CLASS:$:_:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|CASTE:$|SENSE_CREATURE_CLASS:$:_:_:_:_
 +
OBJECT:CREATURE|CREATURE:$|SOLDIER_ALTTILE:_
 +
 +
OBJECT:PLANT|PLANT:$|GROWTH|GROWTH_PRINT:_:_:_:_:_:$
 +
OBJECT:PLANT|PLANT:$|TREE_TILE:_
 +
OBJECT:PLANT|PLANT:$|DEAD_TREE_TILE:_
 +
OBJECT:PLANT|PLANT:$|SAPLING_TILE:_
 +
OBJECT:PLANT|PLANT:$|DEAD_SAPLING_TILE:_
 +
OBJECT:PLANT|PLANT:$|TREE_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|DEAD_TREE_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|SAPLING_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|DEAD_SAPLING_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|PICKED_TILE:_
 +
OBJECT:PLANT|PLANT:$|DEAD_PICKED_TILE:_
 +
OBJECT:PLANT|PLANT:$|SHRUB_TILE:_
 +
OBJECT:PLANT|PLANT:$|DEAD_SHRUB_TILE:_
 +
OBJECT:PLANT|PLANT:$|PICKED_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|DEAD_PICKED_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|SHRUB_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|DEAD_SHRUB_COLOR:_:_:_
 +
OBJECT:PLANT|PLANT:$|GRASS_TILES:_:_:_:_
 +
OBJECT:PLANT|PLANT:$|ALT_GRASS_TILES:_:_:_:_
 +
OBJECT:PLANT|PLANT:$|GRASS_COLORS:_:_:_:_:_:_:_:_:_:_:_:_
 +
OBJECT:PLANT|PLANT:$|ALT_PERIOD:_:_
 +
OBJECT:PLANT|PLANT:$|SEED:$:$:_:_:_
 +
 +
MATERIAL?:$|POWDER_DYE:_:_:_
 +
MATERIAL?:$|TILE:_
 +
MATERIAL?:$|ITEM_SYMBOL:_
 +
MATERIAL?:$|DISPLAY_COLOR:_:_:_
 +
MATERIAL?:$|BUILD_COLOR:_:_:_
 +
MATERIAL?:$|TILE_COLOR:_:_:_
 +
MATERIAL?:$|BASIC_COLOR:_:_:_
 +
MATERIAL?:$|STATE_COLOR:_:_:_
 +
 +
INORGANIC:$|DISPLAY_COLOR:_:_:_
 +
INORGANIC:$|TILE:_
 +
INORGANIC:$|ITEM_SYMBOL:_
 +
 +
OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|NAME_COLOR:_:_:_
 +
OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|TILE:$:$:_
 +
OBJECT:BUILDING_FURNACE|BUILDING_FURNACE:$|TILE:$:$:_
 +
OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|COLOR:$:$:_:_:_
 +
OBJECT:BUILDING_FURNACE|BUILDING_FURNACE:$|COLOR:$:$:_:_:_
 +
 +
OBJECT:ENTITY|ENTITY:$|COLOR:_:_:_
 +
 +
OBJECT:ITEM_TOOL?|ITEM_TOOL:$|TILE:_
 
</pre>
 
</pre>

Revision as of 21:40, 30 March 2015

This is a directory page for my Modest Mod work.

I feel a little bad for clogging up the wiki with this stuff, but sometimes I get bored and I'm not at my home computer.

Plans

  • Moving the no-fear-of-commitment orientation mods out into a pair of creature variations, in c_variation_modest. May make a Module applying them to sapients as well. Eternal Lovers are kind of frustrating.
  • Could probably just make the plant growths that I currently have wrapping tree nuts, edible or pressable or whatever in their own right, and never have to deal with the seeds. OTOH, that might mess up grinding them to paste/pressing them? And would still need the hulling reaction for plantable legumes.
  • Could change implementation of all plants, including those brewed 'whole', into growths. Then would be able to share reactions better, and do seed/no seed on a purely FAKESEED basis.
    • Probably not worth it in vanilla, but maybe fore plant features, since we'll be needing to mill "whole plants" (e.g. cassava, whip vines) and also to mill seedheads.
  • Need to move Plump Helmets back to a usable plant instead of a fruit. Save it as fruit for the Basic Adventurer's Pack.
  • Need to look at the expanded creature variation replacement tokens in preparation for the vampire anti-sobriety module.

Accelerated

  • Need to look at the old Accelerated Modest Mod and see how much of it is applicable to the current version.
  • Need to see about thinning down plant materials, like a lot.
  • Need to remove useless plant growths, like cherry blossoms etc. Leaves? Or would that be too ugly?
  • Could probably reduce grass to a single species? Or would that make pandas shitty?

Plant Features

  • Could probably make grain use the fruit(like?) reactions for brewing, milling, etc.
  • Kahlua & Chajun & possibly the plant products that are used to make them could give a temporary [NOSLEEP] tag? Followed by a 'crash' of a drowsiness syndrome?
  • Jellies? Preserves? Juices?
  • More variation in material values

Basic Adventurer's Pack

  • Plump helmet to fruit
  • Enable a whole bunch of sapients playable as outsiders. Not just the ones in the gear-already-exists size range.
    • Hahaha, fairies as a playable outsider race |D That would be silly
  • Plant fiber thread. Rope reeds, pig tail stalks, others?
    • For the merge with Plant Features, abaca/banana/pineapple leaves, cotton bolls, etc. A lot of the plant fabric stuff is Plant Features-necessary.
  • Cooking. Just biscuits? Or full-on recipes?
    • Flour? Oil? Good use for mortar & pestle...
    • Maybe a balanced meal would require a veg, a protein, & a sugar/starch, & would provide minor (temporary) attribute boosts?
  • Remove liquid from bag without dumping out entire bag
  • Leather armor. Tanning if it doesn't already exist.
  • Backpacks, bags, quivers, waterskins.
  • Bone & shell armor.
  • Bone bows, crossbows, blowguns, & ammo.
    • Arrow bamboo?
  • Self-buff "cheats"?
  • Cloth products?
    • Haircloth?
    • Maybe just enable as material for backpacks etc. Don't want to overload with options, menu is kind of crap.
  • Trophy jewelry

Raws

Some related LNP pseudocode

graphicsdict = []		# dict string:string, where the first string is the tag type formatted with pipes a la that section up there (but with $'s replaced), and the second string is the tag as it appears in the raws
milestones=["OBJECT","CREATURE","CASTE","PLANT","GROWTH","INORGANIC","BUILDING_WORKSHOP","BUILDING_FURNACE","ENTITY","ITEM_TOOL"]
files = []			# dict string:list(string), where the first string is the raw file name, and the list is a list of 
valid_tokens = []		# all the pipe-separated graphics tokens loaded into memory

# Process graphicsified raws into a dict, or load from the save of a previously generated dict
def generate_graphics_dict(sourcedir, graphicsdict):
	for file in sourcedir:
		currentobj = []
		passedstones = []
		for line in file:
			for full_tag in tags(line):
				tag = first_token(full_tag)
				if is_milestone(tag):
					if passedstones not contains tag:
						passedstones.add(tag)
						currentobj[tag] = body_tokens(full_tag)
					else:	#milestone is a new instance of a thing
						while passedstones contains tag:
							rollback = passedstones.pop()
							currentobj.remove(rollback)
						passedstones.add(tag)
						currentobj[tag] = body_tokens(full_tag)
				elif is_graphics_tag(currentobj,tag):
					graphicsdict[graphics_tag(currentobj,tag)] = full_tag

# Apply graphics dict to the raws found in sourcedir, outputting in tardir .
def apply_graphics(sourcedir, tardir, graphicsdict):
	graphicsdictcopy = graphicsdict.copy()		# This copies the object references of the dict item, not the reference to the dict nor the contents of the contents.
	for file in sourcedir:
		passedstones = []
		currentobj = []
		create file in tardir, and open for write
		for line in file:
			moddedline = line
			for full_tag in tags(line):
				tag = first_token(full_tag)
				if is_milestone(tag):
					if passedstones not contains tag:
						passedstones.add(tag)
						currentobj[tag] = body_tokens(full_tag)
					else:
						if has_remaining_graphics_tags(graphicsdictcopy,currentobj):
							for graphicstag in pull_remaining_graphics_tags(graphicsdictcopy,currentobj):
								moddedline += '\n'
								moddedline += write_tag(graphicstag)
								graphicsdictcopy.remove(graphics_tag(currentobj,tag))
						while passedstones contains tag:
							rollback = passedstones.pop()
							currentobj.remove(rollback)
						passedstones.add(tag)
						currentobj[tag] = body_tokens(full_tag)
				elif is_graphics_tag(currentobj, tag):
					moddedline.replace(full_tag, graphicsdictcopy[graphics_tag(currentobj,tag)])
					graphicsdictcopy.remove(graphics_tag(currentobj,tag))
			tardir.write(moddedline + '\n')
		close file in tardir

# Load valid graphics token definitions from file
def load_valid_graphics_tokens():
	filelocation = ..\blahblahblah\graphicstiles.txt
	for line in filelocation.open():
		if length(line.strip()) > 0:
			valid_tokens.append(line)
	filelocation.close()
		
# Write graphics dict to file
def save_graphics_dict(tarfile, graphicsdict):
	graphicsdictcopy = graphicsdict.copy()
	tarfile.open(write)
	for rawformmated in to_raw_format(graphicsdictcopy):
		tarfile.write(rawformatted)
	tarfile.close()

More well-formatted graphics token reference file

OBJECT:CREATURE|CREATURE:$|CREATURE_TILE:_
OBJECT:CREATURE|CREATURE:$|COLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|GLOWTILE:_
OBJECT:CREATURE|CREATURE:$|GLOWCOLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|ALTTILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_ALTTILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_COLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_GLOWCOLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_GLOWTILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_SOLDIER_ALTTILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_SOLDIER_TILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|CASTE_TILE:_
OBJECT:CREATURE|CREATURE:$|CREATURE_SOLDIER_TILE:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|REMAINS_COLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|REMAINS_COLOR:_:_:_
OBJECT:CREATURE|CREATURE:$|SENSE_CREATURE_CLASS:$:_:_:_:_
OBJECT:CREATURE|CREATURE:$|CASTE:$|SENSE_CREATURE_CLASS:$:_:_:_:_
OBJECT:CREATURE|CREATURE:$|SOLDIER_ALTTILE:_

OBJECT:PLANT|PLANT:$|GROWTH|GROWTH_PRINT:_:_:_:_:_:$
OBJECT:PLANT|PLANT:$|TREE_TILE:_
OBJECT:PLANT|PLANT:$|DEAD_TREE_TILE:_
OBJECT:PLANT|PLANT:$|SAPLING_TILE:_
OBJECT:PLANT|PLANT:$|DEAD_SAPLING_TILE:_
OBJECT:PLANT|PLANT:$|TREE_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|DEAD_TREE_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|SAPLING_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|DEAD_SAPLING_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|PICKED_TILE:_
OBJECT:PLANT|PLANT:$|DEAD_PICKED_TILE:_
OBJECT:PLANT|PLANT:$|SHRUB_TILE:_
OBJECT:PLANT|PLANT:$|DEAD_SHRUB_TILE:_
OBJECT:PLANT|PLANT:$|PICKED_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|DEAD_PICKED_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|SHRUB_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|DEAD_SHRUB_COLOR:_:_:_
OBJECT:PLANT|PLANT:$|GRASS_TILES:_:_:_:_
OBJECT:PLANT|PLANT:$|ALT_GRASS_TILES:_:_:_:_
OBJECT:PLANT|PLANT:$|GRASS_COLORS:_:_:_:_:_:_:_:_:_:_:_:_
OBJECT:PLANT|PLANT:$|ALT_PERIOD:_:_
OBJECT:PLANT|PLANT:$|SEED:$:$:_:_:_

MATERIAL?:$|POWDER_DYE:_:_:_
MATERIAL?:$|TILE:_
MATERIAL?:$|ITEM_SYMBOL:_
MATERIAL?:$|DISPLAY_COLOR:_:_:_
MATERIAL?:$|BUILD_COLOR:_:_:_
MATERIAL?:$|TILE_COLOR:_:_:_
MATERIAL?:$|BASIC_COLOR:_:_:_
MATERIAL?:$|STATE_COLOR:_:_:_

INORGANIC:$|DISPLAY_COLOR:_:_:_
INORGANIC:$|TILE:_
INORGANIC:$|ITEM_SYMBOL:_

OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|NAME_COLOR:_:_:_
OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|TILE:$:$:_
OBJECT:BUILDING_FURNACE|BUILDING_FURNACE:$|TILE:$:$:_
OBJECT:BUILDING_WORKSHOP|BUILDING_WORKSHOP:$|COLOR:$:$:_:_:_
OBJECT:BUILDING_FURNACE|BUILDING_FURNACE:$|COLOR:$:$:_:_:_

OBJECT:ENTITY|ENTITY:$|COLOR:_:_:_

OBJECT:ITEM_TOOL?|ITEM_TOOL:$|TILE:_