Premium Domniq 928 Posted April 1, 2016 Premium Share Posted April 1, 2016 Hey, Here is my script for generating property for Trees, Buildings, Effects and Dungeon Blocks to make work more efficent. - crc32 as ObjectID (same as in WE) - skip LOD file (.gr2) - adjustable shadow output (Buildings) - auto .mdatr attachment (Collisions for *.gr2) Script: Spoiler import os import glob import binascii prb = "gr2 >> object" prd = "gr2 >> dungeon block" prt = "spt >> tree" pre = "mse >> effect" bshadow = '' filetype = [prb, prd, prt, pre] filename = [] filepath = [] crc32 = [] filecount = 0 currentfile = 0 count = 0 def clear(): os.system('cls') def getcrc32(f): fo = open(f, 'rb').read() return binascii.crc32(fo) % (1 << 32) def properties(fileext, propertyext, propetytype): global currentfile, filecount, count for srcfn in glob.glob('*%s' % fileext): if '_lod_0' in srcfn: # skip LOD files pass else: filename.append(srcfn) filepath.append((os.getcwd() + '\%s' % srcfn).replace('\\', '/').lower()) filecount += 1 for i in range(0, len(filename)): prop = open(filename[i][:-4] + propertyext, 'w') prop.write('YPRT\n') crc32.append(getcrc32(filename[i])) prop.write(str(crc32[i]) + '\n') if propertyext == '.prb': prop.write('buildingfile\t\t"%s"' % filepath[i].lower()) if os.path.exists(filename[i][:-4] + '.mdatr'): prop.write('\nisattributedata\t\t"0"') # include .mdatr if propertyext == '.prd': prop.write('dungeonblockfile\t\t"%s"' % filepath[i].lower()) if propertyext == '.prt': prop.write('treefile\t\t"%s"' % filepath[i].lower()) if propertyext == '.pre': prop.write('effectfile\t\t"%s"' % filepath[i].lower()) prop.write('\npropertyname\t\t"%s"\n' % filename[i][:-4]) prop.write('propertytype\t\t"%s"\n' % propetytype) if propertyext == '.prb' and bshadow == 'T': prop.write('shadowflag\t\t"1"\n') # include shadow if propertyext == '.prt': prop.write('treesize\t\t"1000.000000"\n') prop.write('treevariance\t\t"0.000000"') print "(%d/%d) %s | crc32: %d" % (currentfile + 1, filecount, filename[i], crc32[i]) currentfile += 1 count += 1 def option(ext): global bshadow if ext == prb: outputshadow = raw_input("Include shadows? (T/N): ") if outputshadow == 't' or outputshadow == 'T': bshadow += 'T' properties('.gr2', '.prb', 'Building') if ext == prd: properties('.gr2', '.prd', 'DungeonBlock') if ext == prt: properties('.spt', '.prt', 'Tree') if ext == pre: properties('.mse', '.pre', 'Effect') def menu(): print "1) ", prb print "2) ", prd print "3) ", prt print "4) ", pre select = raw_input("Choose option: ") if 5 > int(select) > 0: clear() print "You have chosen: ", filetype[int(select) - 1] option(filetype[int(select) - 1]) else: clear() menu() menu() print "Generated", count raw_input("Press any key to exit") Video: How to use: 1. Install the newest python 2.7.x 2. Paste script into text editor and save with .py extension 3. Put that script in directory with objects 4. Right click on script -> open as -> python.exe 5 1 15 Link to comment Share on other sites More sharing options...
Silver Sonitex 1438 Posted April 1, 2016 Silver Share Posted April 1, 2016 Thank you so much! I will try that tomorrow and I hope it works! Gonna save a lot of time Link to comment Share on other sites More sharing options...
Ace 3252 Posted April 5, 2016 Share Posted April 5, 2016 how to use this script? Spoiler Ymir Entertainment was founded in 1999 in Seoul, Korea and is currently headed by Byoung Gwan Kim as CEO. The company started developing its first 2D online game Metin the same year it was founded. The game was commercially launched in Korea a year later and received a prize from the Korean Ministry of Information and Communication in December of the same year. Following the success of their flagship game Ymir Entertainment immediately started work on the game’s sequel Metin 2, which went into Closed Beta in Korea in May 2004. The game was officially launched in Korea and China in March 2005 before being launched in Asia, Europe and North America in the years that followed. In January 2011 all of the company’s shares were bought by Webzen Inc., a Korean game giant known for their popular MMORPG, MU Online. The company was also awarded Gameforge’s Global Best Partner of the Year in 2011. Source: https://mmos.com/publishers/ymir-entertainment Thank you ymir and F*** you Gameforge, 2011 you ruined it. Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted April 5, 2016 Author Premium Share Posted April 5, 2016 Make sure you have installed python 2.7, then open this file by "python.exe" Link to comment Share on other sites More sharing options...
ScreamMyName 100 Posted April 8, 2016 Share Posted April 8, 2016 Nice generator, I had my own but only for single files. Thanks. Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted October 27, 2016 Author Premium Share Posted October 27, 2016 #updated Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted February 5, 2017 Author Premium Share Posted February 5, 2017 #updated Link to comment Share on other sites More sharing options...
alondark 59 Posted February 26, 2017 Share Posted February 26, 2017 Bro can you upload py. file ? I can't download in metin2dev's upload service. Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted February 26, 2017 Author Premium Share Posted February 26, 2017 9 hours ago, alondark said: Bro can you upload py. file ? I can't download in metin2dev's upload service. Here you are This is the hidden content, please Sign In or Sign Up 21 1 6 1 7 Link to comment Share on other sites More sharing options...
alondark 59 Posted February 26, 2017 Share Posted February 26, 2017 1 hour ago, Nevisor said: Here you are This is the hidden content, please Sign In or Sign Up thanks dude xD 7 1 3 1 Link to comment Share on other sites More sharing options...
Premium Domniq 928 Posted July 30, 2017 Author Premium Share Posted July 30, 2017 #update Added guide how to use. - Fixed crc32 duplication Link to comment Share on other sites More sharing options...
Viello 54 Posted January 16, 2022 Share Posted January 16, 2022 Do I make some tab errors or something? I can see the menu at cmd and select option but creates 0 property Can someone upload right py file, pls Link to comment Share on other sites More sharing options...
Recommended Posts