Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - arclance

Pages: 1 ... 15 16 [17] 18 19 ... 38
241
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 19, 2012, 09:15:56 pm »
I think I ran into some bugs. I downloaded the new version and replaced all my files with the ones in the download. I had Dwarf Fortress 1.9.5 before and had the orc fortress plugin installed as well. When I genned a new world I could browse through the legends perfectly fine but in fortress mode the "dwarves are all giant pythons". Here's the save.

http://dffd.wimbli.com/file.php?id=6943
Sounds like a raw duplication bug to me.
Did you delete your old Masterwork 1.9.5 raws before replacing them with the Masterwork 2 Alpha raws?
They don't contain the exact same files so you can't just overwrite them you need to delete the old files first.

242
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 19, 2012, 07:25:45 pm »
I'll do it. However, I have an outdated version, so I'll have to build a new fort.
As I don't have school the next days, I'll sleep late tonight, so, yes, it will be done in a couple hours.

Edit: The settings still don't work. Anyway.
Edit 2: Did you... update the download link? The blessing of armok gems are still free, so I think it's outdated.
Edit 3: Found an issue! Three ironclad sauropods spawned in my freezing biome. Ironclad.
If you downloaded the archive that Meph uploaded the settings GUI in there is broken.
I uploaded a archive with a fix to the GUI bug found in Mephs archive.
Someone had another problem with it since then.
I don't know why their error happened (it should not in Windows) but I posted new GUI code that should fix it.
I have not heard back from them to see if the fix works yet though.

243
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 19, 2012, 01:27:07 pm »
Never used python before but I'll give the alpha a go. I tried to use the "fixed gui" version.

Downloaded Python 3.2.3... got this in the prompt while trying to "write" (on Vista).


Code: [Select]
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python32\lib\tkinter\__init__.py", line 1399, in __call__
    return self.func(*args)
  File "C:\Users\user\Desktop\dwarf fortress\DFMW Alpha\MasterworkDF Settings.py
", line 154, in write
    wf.write(totdat[i][z].replace('[','!!!'))
  File "C:\Python32\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\x96' in position 35
: character maps to <undefined>
That is strange I don't know why it would use "charmap" encoding in Windows it should use "ISO-8859-1" by default.

Could you try using this and see if it fixes your error?
Code: [Select]
from tkinter import *
import os
import fnmatch
from tkinter import tix
from tkinter import filedialog

dir1 = 'MasterworkDwarfFortress/raw/objects/'
dir2 = 'Dwarf Fortress/raw/objects/'

match = ['creature*','item*','inorganic*','reaction*','plant*','entity*']
files = []
for m in match:
for file in os.listdir(dir1):
if fnmatch.fnmatch(file, m):
files.append(file)

totdat = [[]]*len(files)
for i in range(len(files)):
f = open(dir1+files[i], mode="rt", buffering=1, encoding="ISO-8859-1")
dat = []
for row in f:
dat.append(row)
totdat[i] = dat
f.close()

ddtot = [[]]*len(totdat)
for j in range(len(totdat)):
d = []
for i in range(len(totdat[j])):
par = totdat[j][i].partition(':')[0]
if (par == '[CREATURE') or (par == '!!!CREATURE'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[REACTION') or (par == '!!!REACTION'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[INORGANIC') or (par == '!!!INORGANIC'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[PLANT') or (par == '!!!PLANT'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_AMMO') or (par == '!!!ITEM_AMMO'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_ARMOR') or (par == '!!!ITEM_ARMOR'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_FOOD') or (par == '!!!ITEM_FOOD'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_GLOVES') or (par == '!!!ITEM_GLOVES'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_HELM') or (par == '!!!ITEM_HELM'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_INSTRUMENT') or (par == '!!!ITEM_INSTRUMENT'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_PANTS') or (par == '!!!ITEM_PANTS'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SHIELD') or (par == '!!!ITEM_SHIELD'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SHOES') or (par == '!!!ITEM_SHOES'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SIEGEAMMO') or (par == '!!!ITEM_SIEGEAMMO'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TOOL') or (par == '!!!ITEM_TOOL'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TOY') or (par == '!!!ITEM_TOY'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TRAPCOMP') or (par == '!!!ITEM_TRAPCOMP'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_WEAPON') or (par == '!!!ITEM_WEAPON'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!1') != 0:
d[-1][2] = 'off'
elif (par == '[ENTITY') or (par == '!!!ENTITY'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
if len(d) != 0:
dd = []
for i in range(len(d)-1):
dd.append([d[i][0], d[i][1], d[i+1][1], d[i][2]])
dd.append([d[-1][0], d[-1][1], len(totdat[j]), d[-1][2]])
ddtot[j] = dd

if os.path.exists('configuration.txt'):
pass
else:
for i in range(len(files)):
A = files[i].partition('_')[0]
B = files[i].partition('_')[2].partition('.')[0]
for j in range(len(ddtot[i])):
C = ddtot[i][j][0]
ddtot[i][j][0] = A+'.'+B+'.'+C

def save():
fn = filedialog.asksaveasfilename()
wf = open(fn, 'w', buffering=1, encoding="ISO-8859-1")
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
wf.write(ddtot[i][j][0]+'#'+ddtot[i][j][3]+'\n')
wf.close()

def load():
fn = filedialog.askopenfilename()
wf = open(fn, "rt", buffering=1, encoding="ISO-8859-1")
dat = []
for row in wf:
dat.append(row)
wf.close()
for i in range(len(dat)):
for j in range(len(ddtot)):
for k in range(len(ddtot[j])):
if dat[i].partition('#')[0] == ddtot[j][k][0]:
ddtot[j][k][3] = dat[i].partition('#')[2].partition('\n')[0]

def write():
#print("Write")
for i in range(len(files)):
if len(ddtot[i]) != 0:
wf = open(dir2 + files[i], 'w', buffering=1, encoding="ISO-8859-1")
for k in range(ddtot[i][0][1]):
wf.write(totdat[i][k])
for j in range(len(ddtot[i])):
for z in range(ddtot[i][j][1],ddtot[i][j][2]):
if ddtot[i][j][3] == 'off':
wf.write(totdat[i][z].replace('[','!!!'))
elif ddtot[i][j][3] == 'on':
wf.write(totdat[i][z].replace('!!!','['))
wf.close()

if __name__ == '__main__':
root = tix.Tk()

canvas = tix.Canvas(root, width = 500, height=500)
canvas.grid(row=0, column=0, sticky=N+S+E+W)
root.grid_rowconfigure(0,weight=1)
frame = tix.Frame(canvas)
frame.rowconfigure(1,weight=1)
frame.columnconfigure(1,weight=1)

class states:

def __init__(self,ty):
self.t =Toplevel(root)
self.ty = ty
self.top = []
self.ord = []
self.sub = []
self.tot =  []
self.base = []
self.makelist()
cls = tix.Button(self.t, text='Close', command=self.close)
cls.grid()

def close(self):
self.t.destroy()

def update(self,item):
if len(item.split('.')) == 2:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
val = ddtot[i][j][0].split('.')[0]+'.'+ddtot[i][j][0].split('.')[1]
if val == item:
if self.cl.getstatus(item) == 'off':
self.cl.setstatus(ddtot[i][j][0], 'off')
ddtot[i][j][3] = 'off'
elif self.cl.getstatus(item) == 'on':
self.cl.setstatus(ddtot[i][j][0], 'on')
ddtot[i][j][3] = 'on'
elif len(item.split('.')) == 3:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
if item == ddtot[i][j][0]:
ddtot[i][j][3] = self.cl.getstatus(item)

def update2(self,item):
if len(item.split('.')) == 2:
meti = item.partition('.')[2]
for i in range(len(self.ord)):
if self.ord[i].count(meti) != 0:
for j in range(len(self.sub)):
if (self.ord[i][1] == self.sub[j][0]) and (self.ord[i][0] == item.partition('.')[0]):
temp = self.ord[i][0]+'.'+self.ord[i][1]+'.'+self.sub[j][1]
if self.cl.getstatus(item) == 'off':
self.cl.setstatus(temp, 'off')
elif self.cl.getstatus(item) == 'on':
self.cl.setstatus(temp, 'on')
for k in range(len(ddtot)):
for l in range(len(ddtot[k])):
if ddtot[k][l][0] == temp:
ddtot[k][l][3] = self.cl.getstatus(temp)
elif len(item.split('.')) == 3:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
if item == ddtot[i][j][0]:
ddtot[i][j][3] = self.cl.getstatus(item)

def makelist(self):
if os.path.exists('configuration.txt'):
self.cl = tix.CheckList(self.t, width=500, height=400, browsecmd=self.update2)
self.cl.grid()
f = open('configuration.txt')
conf = []
for row in f:
conf.append(row)
f.close()
for i in range(len(conf)):
if conf[i].partition(' ')[0] == 'BASE':
self.base.append([conf[i].partition(' ')[2], i, 0])
for i in range(len(self.base)-1):
self.base[i][2] = self.base[i+1][1]
self.base[-1][2] = len(conf)
for vl in self.base:
if vl[0].partition('\n')[0] == self.ty.upper():
for val in conf[vl[1]:vl[2]]:
if val.partition(' ')[0] == 'TOP':
self.top.append(val.partition(' ')[2].partition('\n')[0])
self.cl.hlist.add(self.top[-1], text=self.top[-1])
if val.partition(' ')[0] == 'ORD':
self.ord.append([self.top[-1], val.partition(' ')[2].partition('\n')[0]])
self.cl.hlist.add(self.top[-1]+'.'+self.ord[-1][1], text=self.ord[-1][1])
self.cl.setstatus(self.top[-1]+'.'+self.ord[-1][1], 'on')
if val.partition(' ')[0] == 'SUB':
self.sub.append([self.ord[-1][1],val.partition(' ')[2].partition('\n')[0]])
self.cl.hlist.add(self.ord[-1][0]+'.'+self.ord[-1][1]+'.'+self.sub[-1][1], text=self.sub[-1][1])
self.tot.append(self.ord[-1][0]+'.'+self.ord[-1][1]+'.'+self.sub[-1][1])
self.cl.autosetmode()
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(len(self.sub)):
if self.sub[k][1] == ddtot[i][j][0]:
ddtot[i][j][0] = self.tot[k]
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
elif ddtot[i][j][0] == self.tot[k]:
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
else:
self.cl = tix.CheckList(self.t, width=500, height=400, browsecmd=self.update)
self.cl.grid()
self.cl.hlist.add(self.ty, text=self.ty + 's')
for i in range(len(files)):
if files[i].partition('_')[0] == self.ty:
self.top.append([files[i].partition('_')[0],files[i].partition('_')[2].partition('.')[0]])
self.cl.hlist.add(self.top[-1][0] +'.'+ self.top[-1][1], text=self.top[-1][1])
self.cl.setstatus(self.top[-1][0] +'.'+ self.top[-1][1], "on")
for j in range(len(ddtot[i])):
if ddtot[i][j][0].partition('.')[0] == self.top[-1][0]:
self.cl.hlist.add(ddtot[i][j][0], text=ddtot[i][j][0].partition('.')[2].partition('.')[2])
else:
self.sub.append(ddtot[i][j][0])
self.cl.hlist.add(self.top[-1][0] +'.'+ self.top[-1][1] + '.' + self.sub[-1], text=ddtot[i][j][0])
ddtot[i][j][0] = self.top[-1][0] +'.'+ self.top[-1][1] + '.' + self.sub[-1]
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
self.cl.autosetmode()

canvas.create_window(0,0,anchor=NW,window=frame)
frame.update_idletasks()
canvas.config(scrollregion=canvas.bbox('all'))

def creatures():
states('creature')
def items():
states('item')
def reactions():
states('reaction')
def entities():
states('entity')
def inorganics():
states('inorganic')
def plants():
states('plant')

########################################################################
if os.path.exists('metatags.txt'):

def func(q):
if textvar[q].get() == txt[q] + ' Off':
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(ddtot[i][j][1],ddtot[i][j][2]):
totdat[i][k] = totdat[i][k].replace('NO'+tag[q]+'![','NO'+tag[q]+'!!')
totdat[i][k] = totdat[i][k].replace('YES'+tag[q]+'!!','YES'+tag[q]+'![')
textvar[q].set(txt[q] + ' On')
elif textvar[q].get() == txt[q] + ' On':
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(ddtot[i][j][1],ddtot[i][j][2]):
totdat[i][k] = totdat[i][k].replace('NO'+tag[q]+'!!','NO'+tag[q]+'![')
totdat[i][k] = totdat[i][k].replace('YES'+tag[q]+'![','YES'+tag[q]+'!!')
textvar[q].set(txt[q] + ' Off')

f = open('metatags.txt')
tags = []
txt = []
tag = []
textvar = []
b = []
z = 0
for row in f:
tags.append(row)
f.close()
for val in tags:
txt.append(val.partition('/')[2].partition('\n')[0])
tag.append(val.partition('/')[0])
textvar.append(StringVar())
textvar[z].set(txt[z] + ' On')
b.append(tix.Button(frame, textvariable=textvar[z], command=lambda z=z:func(z)))
b[z].grid()
z = z + 1

########################################################################

b1 = tix.Button(frame, text='Creatures', command=creatures)
b2 = tix.Button(frame, text='Reactions', command=reactions)
b3 = tix.Button(frame, text='Entities', command=entities)
b4 = tix.Button(frame, text='Items', command=items)
b5 = tix.Button(frame, text='Plants', command=plants)
b6 = tix.Button(frame, text='Inorganics', command=inorganics)
b7 = tix.Button(frame, text='Load', command=load)
b8 = tix.Button(frame, text='Save', command=save)
b9 = tix.Button(frame, text='Write', command=write)
b1.grid()
b2.grid()
b3.grid()
b4.grid()
b5.grid()
b6.grid()
b7.grid()
b8.grid()
b9.grid()
root.update()
root.mainloop()

244
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 19, 2012, 12:10:31 am »
running into problems getting settings to even start.  says its a .py file, presumably python.
Yes you need Python3 to run it.
We will be compiling the GUI into a executable so you won't need Python installed to use it once the GUI is out of the alpha stage.

245
It is. :) Brewery...
Ah I see it now.
I was looking for "BREW_BLOODWINE" or "MAKE_BLOODWINE" not "DISTILL_BLOOD".

246
Meat is not the problem, we won't be starving. But, and this is a big but, you can't make booze out of a horse, even though it's a great idea. Without any underground plants or their seeds, the fort is stuck with prickle berry wine and shit like that.
I guess bloodwine is not in the alpha?
I know it was in Masterwork at some point since Meph used the idea with my permission.

247
Ishar, I assure you I did not intentionally send you fools out without food! You are testing out the 'military' pre-made embark. Any complaints should be routed to the royal advisor, meph ;)
Maybe it was intended for reclaims were not being murdered is harder that finding food.

249
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 17, 2012, 09:34:20 am »
I used the new version of your gui arclance, and I noticed nothing new in the parameters.
The second fix is entirely invisible to the user.
What happened was that the script stopped partway through saving your settings in the game raw files which is a good way to mess up the raws
It does not do that anymore all the changes you make in the GUI will be successfully save now.

Quote
@ Meph
Do you want me to upload a new archive with the fixed version of the GUI since you are stuck in the Internet Stone Age?
Yes please. :)
I will do that after I eat breakfast.

250
What does that have to do with posting your images so the show up in the post as something other than a link?

251
zenerbufen did you use the GUI included with the archive to generate the new fort?
I just discovered that my fix for the bug that was reported was not complete and the raws are not totally updated when you click the "write" button.
It looks like this may have been causing raw duplication for some people.

252
You need to put
Code: [Select]
[img][/img]
tags around your images for them to show up in your post.

253
Masterwork DF / Re: ☼MASTERWORK☼ DF2 - Alpha
« on: September 16, 2012, 06:04:29 pm »
Traceback (most recent call last):
  File "C:\Users\user\Downloads\MDF2\MasterworkDF Settings.py", line 110, in <module>
    dd.append([d[-1][0], d[-1][1], len(totdat[j]), d[-1][2]])
IndexError: list index out of range
I found another problem with the same cause as this bug.
The write button will fail partway through when it gets to the file that caused the earlier bug.
This does not crash the GUI so you would not notice it unless you were running the GUI in a terminal.
Not all of the raws will be updated when this happens and could be why people are seeing raw duplication bugs.

Here is a new version of the GUI code with that bug fixed.
Code: [Select]
from tkinter import *
import os
import fnmatch
from tkinter import tix
from tkinter import filedialog

dir1 = 'MasterworkDwarfFortress/raw/objects/'
dir2 = 'Dwarf Fortress/raw/objects/'

match = ['creature*','item*','inorganic*','reaction*','plant*','entity*']
files = []
for m in match:
for file in os.listdir(dir1):
if fnmatch.fnmatch(file, m):
files.append(file)

totdat = [[]]*len(files)
for i in range(len(files)):
f = open(dir1+files[i], mode="rt", buffering=1, encoding="ISO-8859-1")
dat = []
for row in f:
dat.append(row)
totdat[i] = dat
f.close()

ddtot = [[]]*len(totdat)
for j in range(len(totdat)):
d = []
for i in range(len(totdat[j])):
par = totdat[j][i].partition(':')[0]
if (par == '[CREATURE') or (par == '!!!CREATURE'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[REACTION') or (par == '!!!REACTION'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[INORGANIC') or (par == '!!!INORGANIC'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[PLANT') or (par == '!!!PLANT'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_AMMO') or (par == '!!!ITEM_AMMO'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_ARMOR') or (par == '!!!ITEM_ARMOR'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_FOOD') or (par == '!!!ITEM_FOOD'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_GLOVES') or (par == '!!!ITEM_GLOVES'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_HELM') or (par == '!!!ITEM_HELM'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_INSTRUMENT') or (par == '!!!ITEM_INSTRUMENT'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_PANTS') or (par == '!!!ITEM_PANTS'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SHIELD') or (par == '!!!ITEM_SHIELD'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SHOES') or (par == '!!!ITEM_SHOES'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_SIEGEAMMO') or (par == '!!!ITEM_SIEGEAMMO'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TOOL') or (par == '!!!ITEM_TOOL'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TOY') or (par == '!!!ITEM_TOY'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_TRAPCOMP') or (par == '!!!ITEM_TRAPCOMP'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
elif (par == '[ITEM_WEAPON') or (par == '!!!ITEM_WEAPON'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!1') != 0:
d[-1][2] = 'off'
elif (par == '[ENTITY') or (par == '!!!ENTITY'):
d.append([totdat[j][i].partition(':')[2].partition(']')[0], i, 'on'])
if par.count('!!!') != 0:
d[-1][2] = 'off'
if len(d) != 0:
dd = []
for i in range(len(d)-1):
dd.append([d[i][0], d[i][1], d[i+1][1], d[i][2]])
dd.append([d[-1][0], d[-1][1], len(totdat[j]), d[-1][2]])
ddtot[j] = dd

if os.path.exists('configuration.txt'):
pass
else:
for i in range(len(files)):
A = files[i].partition('_')[0]
B = files[i].partition('_')[2].partition('.')[0]
for j in range(len(ddtot[i])):
C = ddtot[i][j][0]
ddtot[i][j][0] = A+'.'+B+'.'+C

def save():
fn = filedialog.asksaveasfilename()
wf = open(fn, 'w')
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
wf.write(ddtot[i][j][0]+'#'+ddtot[i][j][3]+'\n')
wf.close()

def load():
fn = filedialog.askopenfilename()
wf = open(fn)
dat = []
for row in wf:
dat.append(row)
wf.close()
for i in range(len(dat)):
for j in range(len(ddtot)):
for k in range(len(ddtot[j])):
if dat[i].partition('#')[0] == ddtot[j][k][0]:
ddtot[j][k][3] = dat[i].partition('#')[2].partition('\n')[0]

def write():
for i in range(len(files)):
if len(ddtot[i]) != 0:
wf = open(dir2 + files[i], 'w')
for k in range(ddtot[i][0][1]):
wf.write(totdat[i][k])
for j in range(len(ddtot[i])):
for z in range(ddtot[i][j][1],ddtot[i][j][2]):
if ddtot[i][j][3] == 'off':
wf.write(totdat[i][z].replace('[','!!!'))
elif ddtot[i][j][3] == 'on':
wf.write(totdat[i][z].replace('!!!','['))
wf.close()

if __name__ == '__main__':
root = tix.Tk()

canvas = tix.Canvas(root, width = 500, height=500)
canvas.grid(row=0, column=0, sticky=N+S+E+W)
root.grid_rowconfigure(0,weight=1)
frame = tix.Frame(canvas)
frame.rowconfigure(1,weight=1)
frame.columnconfigure(1,weight=1)

class states:

def __init__(self,ty):
self.t =Toplevel(root)
self.ty = ty
self.top = []
self.ord = []
self.sub = []
self.tot =  []
self.base = []
self.makelist()
cls = tix.Button(self.t, text='Close', command=self.close)
cls.grid()

def close(self):
self.t.destroy()

def update(self,item):
if len(item.split('.')) == 2:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
val = ddtot[i][j][0].split('.')[0]+'.'+ddtot[i][j][0].split('.')[1]
if val == item:
if self.cl.getstatus(item) == 'off':
self.cl.setstatus(ddtot[i][j][0], 'off')
ddtot[i][j][3] = 'off'
elif self.cl.getstatus(item) == 'on':
self.cl.setstatus(ddtot[i][j][0], 'on')
ddtot[i][j][3] = 'on'
elif len(item.split('.')) == 3:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
if item == ddtot[i][j][0]:
ddtot[i][j][3] = self.cl.getstatus(item)

def update2(self,item):
if len(item.split('.')) == 2:
meti = item.partition('.')[2]
for i in range(len(self.ord)):
if self.ord[i].count(meti) != 0:
for j in range(len(self.sub)):
if (self.ord[i][1] == self.sub[j][0]) and (self.ord[i][0] == item.partition('.')[0]):
temp = self.ord[i][0]+'.'+self.ord[i][1]+'.'+self.sub[j][1]
if self.cl.getstatus(item) == 'off':
self.cl.setstatus(temp, 'off')
elif self.cl.getstatus(item) == 'on':
self.cl.setstatus(temp, 'on')
for k in range(len(ddtot)):
for l in range(len(ddtot[k])):
if ddtot[k][l][0] == temp:
ddtot[k][l][3] = self.cl.getstatus(temp)
elif len(item.split('.')) == 3:
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
if item == ddtot[i][j][0]:
ddtot[i][j][3] = self.cl.getstatus(item)

def makelist(self):
if os.path.exists('configuration.txt'):
self.cl = tix.CheckList(self.t, width=500, height=400, browsecmd=self.update2)
self.cl.grid()
f = open('configuration.txt')
conf = []
for row in f:
conf.append(row)
f.close()
for i in range(len(conf)):
if conf[i].partition(' ')[0] == 'BASE':
self.base.append([conf[i].partition(' ')[2], i, 0])
for i in range(len(self.base)-1):
self.base[i][2] = self.base[i+1][1]
self.base[-1][2] = len(conf)
for vl in self.base:
if vl[0].partition('\n')[0] == self.ty.upper():
for val in conf[vl[1]:vl[2]]:
if val.partition(' ')[0] == 'TOP':
self.top.append(val.partition(' ')[2].partition('\n')[0])
self.cl.hlist.add(self.top[-1], text=self.top[-1])
if val.partition(' ')[0] == 'ORD':
self.ord.append([self.top[-1], val.partition(' ')[2].partition('\n')[0]])
self.cl.hlist.add(self.top[-1]+'.'+self.ord[-1][1], text=self.ord[-1][1])
self.cl.setstatus(self.top[-1]+'.'+self.ord[-1][1], 'on')
if val.partition(' ')[0] == 'SUB':
self.sub.append([self.ord[-1][1],val.partition(' ')[2].partition('\n')[0]])
self.cl.hlist.add(self.ord[-1][0]+'.'+self.ord[-1][1]+'.'+self.sub[-1][1], text=self.sub[-1][1])
self.tot.append(self.ord[-1][0]+'.'+self.ord[-1][1]+'.'+self.sub[-1][1])
self.cl.autosetmode()
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(len(self.sub)):
if self.sub[k][1] == ddtot[i][j][0]:
ddtot[i][j][0] = self.tot[k]
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
elif ddtot[i][j][0] == self.tot[k]:
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
else:
self.cl = tix.CheckList(self.t, width=500, height=400, browsecmd=self.update)
self.cl.grid()
self.cl.hlist.add(self.ty, text=self.ty + 's')
for i in range(len(files)):
if files[i].partition('_')[0] == self.ty:
self.top.append([files[i].partition('_')[0],files[i].partition('_')[2].partition('.')[0]])
self.cl.hlist.add(self.top[-1][0] +'.'+ self.top[-1][1], text=self.top[-1][1])
self.cl.setstatus(self.top[-1][0] +'.'+ self.top[-1][1], "on")
for j in range(len(ddtot[i])):
if ddtot[i][j][0].partition('.')[0] == self.top[-1][0]:
self.cl.hlist.add(ddtot[i][j][0], text=ddtot[i][j][0].partition('.')[2].partition('.')[2])
else:
self.sub.append(ddtot[i][j][0])
self.cl.hlist.add(self.top[-1][0] +'.'+ self.top[-1][1] + '.' + self.sub[-1], text=ddtot[i][j][0])
ddtot[i][j][0] = self.top[-1][0] +'.'+ self.top[-1][1] + '.' + self.sub[-1]
self.cl.setstatus(ddtot[i][j][0], ddtot[i][j][3])
self.cl.autosetmode()

canvas.create_window(0,0,anchor=NW,window=frame)
frame.update_idletasks()
canvas.config(scrollregion=canvas.bbox('all'))

def creatures():
states('creature')
def items():
states('item')
def reactions():
states('reaction')
def entities():
states('entity')
def inorganics():
states('inorganic')
def plants():
states('plant')

########################################################################
if os.path.exists('metatags.txt'):

def func(q):
if textvar[q].get() == txt[q] + ' Off':
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(ddtot[i][j][1],ddtot[i][j][2]):
totdat[i][k] = totdat[i][k].replace('NO'+tag[q]+'![','NO'+tag[q]+'!!')
totdat[i][k] = totdat[i][k].replace('YES'+tag[q]+'!!','YES'+tag[q]+'![')
textvar[q].set(txt[q] + ' On')
elif textvar[q].get() == txt[q] + ' On':
for i in range(len(ddtot)):
for j in range(len(ddtot[i])):
for k in range(ddtot[i][j][1],ddtot[i][j][2]):
totdat[i][k] = totdat[i][k].replace('NO'+tag[q]+'!!','NO'+tag[q]+'![')
totdat[i][k] = totdat[i][k].replace('YES'+tag[q]+'![','YES'+tag[q]+'!!')
textvar[q].set(txt[q] + ' Off')

f = open('metatags.txt')
tags = []
txt = []
tag = []
textvar = []
b = []
z = 0
for row in f:
tags.append(row)
f.close()
for val in tags:
txt.append(val.partition('/')[2].partition('\n')[0])
tag.append(val.partition('/')[0])
textvar.append(StringVar())
textvar[z].set(txt[z] + ' On')
b.append(tix.Button(frame, textvariable=textvar[z], command=lambda z=z:func(z)))
b[z].grid()
z = z + 1

########################################################################

b1 = tix.Button(frame, text='Creatures', command=creatures)
b2 = tix.Button(frame, text='Reactions', command=reactions)
b3 = tix.Button(frame, text='Entities', command=entities)
b4 = tix.Button(frame, text='Items', command=items)
b5 = tix.Button(frame, text='Plants', command=plants)
b6 = tix.Button(frame, text='Inorganics', command=inorganics)
b7 = tix.Button(frame, text='Load', command=load)
b8 = tix.Button(frame, text='Save', command=save)
b9 = tix.Button(frame, text='Write', command=write)
b1.grid()
b2.grid()
b3.grid()
b4.grid()
b5.grid()
b6.grid()
b7.grid()
b8.grid()
b9.grid()
root.update()
root.mainloop()
I you used the GUI you should rerun it using the new code and regen your world.

254
Anywya, I'm live at http://livestream.com/novaworks for the time being.
The time being until my friend shows yp to give me a ride to disc goldf.
Call it a test.
In any case, turn begins now.
You might want to turn the quality up a little bit if you can.
It is not unintelligible but it is pretty blurry right now.
I can tell where the walls are though so it is better than the last Dwarf Fortress livestream I saw.

255
@ Bobnova
From the specs you posted I was not worried about you capturing the stream, just uploading it.
You need a decent amount of bandwidth to stream live, more than you would think.
I know where I live upload speeds are not very good so I though I would ask about it.

it was just a terrible blur.
Yeah, that tends to happen when your turn comes.
That stream was so bad it looked like it would if you were very drunk.
I was sober.

Does this forum even care about double/teriple/quad posting?
I think so, but I think it's allowed for specific occasions, and this is one :)
Too bad that I really need my sleep tonight, and won't be able to follow your livestream. In any case: good luck!
I think they should be avoided here but I have not seen it strongly enforced.
As long as it is your turn and you don't make a bunch of small posts it should not be a problem.
Double and triple posts seem to be fairly common, more than that is probably not a good thing to do.

Pages: 1 ... 15 16 [17] 18 19 ... 38