| Blockland Forums > Modification Help |
| PyBLS (Blockland Save File Library for Python) |
| (1/5) > >> |
| Brian Smithers:
What it is So if you have Python 2.7 or above (untested on lower versions) and you have a decent amount of knowledge of python this could become handy if your a lazy fatass. This basically is a 50 line class that you can use to write save files. How to use A quote from the example: if __name__ == "__main__": import random bs = BlocklandSave('ASuperFunTest.bls',8437) cnt = 100 size = 100 data = "4x Cube" for i in range(cnt): pos = str(int(random.random() * size)) + " " + str(int(random.random() * size)) + " " + str(int(random.random() * size)) bs.addBrickLine(data,pos,0,0,0,0,0,-1,1,1,1,8437) bs.finish() I think you can figure it out yourself. :) It's a zip file, since theres this long boring part i just call a prefix (prefix.txt) where you can change the colorsets and stuff, so you go to the colorset.txt of your colorset. 0.900 0.000 0.000 1.000 0.900 0.900 0.000 1.000 0.000 0.500 0.250 1.000 0.200 0.000 0.800 1.000 0.900 0.900 0.900 1.000 0.750 0.750 0.750 1.000 0.500 0.500 0.500 1.000 0.200 0.200 0.200 1.000 100 50 0 255 DIV:Standard 230 87 20 255 191 46 123 255 99 0 30 255 34 69 69 255 0 36 85 255 27 117 196 255 255 255 255 255 20 20 20 255 255 255 255 64 DIV:Bold 236 131 173 255 255 154 108 255 255 224 156 255 244 224 200 255 200 235 125 255 138 178 141 255 143 237 245 255 178 169 231 255 224 143 244 255 DIV:Soft 0.667 0.000 0.000 0.700 1.000 0.500 0.000 0.700 0.990 0.960 0.000 0.700 0.000 0.471 0.196 0.700 0.000 0.200 0.640 0.700 152 41 100 178 0.550 0.700 1.000 0.700 0.850 0.850 0.850 0.700 0.100 0.100 0.100 0.700 DIV:Transparent Then you just remove the line breaks and the DIV lines, also make sure they are all in decimal format (i think that matters, do not know), by taking the hole numbers and dividing them by 255. Then in the output you'll get something like... 0.898039 0.000000 0.000000 1.000000 0.898039 0.898039 0.000000 1.000000 0.000000 0.498039 0.247059 1.000000 0.200000 0.000000 0.800000 1.000000 0.898039 0.898039 0.898039 1.000000 0.749020 0.749020 0.749020 1.000000 0.498039 0.498039 0.498039 1.000000 0.200000 0.200000 0.200000 1.000000 0.392157 0.192157 0.000000 1.000000 0.901961 0.337255 0.078431 1.000000 0.749020 0.176471 0.482353 1.000000 0.384314 0.000000 0.113725 1.000000 0.129412 0.266667 0.266667 1.000000 0.000000 0.137255 0.329412 1.000000 0.101961 0.458824 0.764706 1.000000 1.000000 1.000000 1.000000 1.000000 0.078431 0.078431 0.078431 1.000000 1.000000 1.000000 1.000000 0.247059 0.921569 0.513726 0.674510 1.000000 1.000000 0.603922 0.419608 1.000000 1.000000 0.874510 0.611765 1.000000 0.956863 0.874510 0.784314 1.000000 0.784314 0.921569 0.486275 1.000000 0.537255 0.694118 0.549020 1.000000 0.556863 0.929412 0.956863 1.000000 0.694118 0.658824 0.901961 1.000000 0.874510 0.556863 0.956863 1.000000 0.666667 0.000000 0.000000 0.698039 1.000000 0.498039 0.000000 0.698039 0.988235 0.956863 0.000000 0.698039 0.000000 0.470588 0.192157 0.698039 0.000000 0.200000 0.639216 0.698039 0.592157 0.156863 0.392157 0.694118 0.549020 0.698039 1.000000 0.698039 0.847059 0.847059 0.847059 0.698039 0.098039 0.098039 0.098039 0.698039 Then for all the extra lines just add in a bunch of lines that say 1.000000 0.000000 1.000000 0.000000 Until the line count is exactly 64 So in the end you'll see 0.898039 0.000000 0.000000 1.000000 0.898039 0.898039 0.000000 1.000000 0.000000 0.498039 0.247059 1.000000 0.200000 0.000000 0.800000 1.000000 0.898039 0.898039 0.898039 1.000000 0.749020 0.749020 0.749020 1.000000 0.498039 0.498039 0.498039 1.000000 0.200000 0.200000 0.200000 1.000000 0.392157 0.192157 0.000000 1.000000 0.901961 0.337255 0.078431 1.000000 0.749020 0.176471 0.482353 1.000000 0.384314 0.000000 0.113725 1.000000 0.129412 0.266667 0.266667 1.000000 0.000000 0.137255 0.329412 1.000000 0.101961 0.458824 0.764706 1.000000 1.000000 1.000000 1.000000 1.000000 0.078431 0.078431 0.078431 1.000000 1.000000 1.000000 1.000000 0.247059 0.921569 0.513726 0.674510 1.000000 1.000000 0.603922 0.419608 1.000000 1.000000 0.874510 0.611765 1.000000 0.956863 0.874510 0.784314 1.000000 0.784314 0.921569 0.486275 1.000000 0.537255 0.694118 0.549020 1.000000 0.556863 0.929412 0.956863 1.000000 0.694118 0.658824 0.901961 1.000000 0.874510 0.556863 0.956863 1.000000 0.666667 0.000000 0.000000 0.698039 1.000000 0.498039 0.000000 0.698039 0.988235 0.956863 0.000000 0.698039 0.000000 0.470588 0.192157 0.698039 0.000000 0.200000 0.639216 0.698039 0.592157 0.156863 0.392157 0.694118 0.549020 0.698039 1.000000 0.698039 0.847059 0.847059 0.847059 0.698039 0.098039 0.098039 0.098039 0.698039 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 1.000000 0.000000 Then go to the file thats titled prefix.txt, you'll see a bunch of lines similar to this, just replace them with the new colorsets, making sure not to remove the line break. Thats all. Now where do I get this stuff? Right here! It includes: BlocklandSave.py - What you import prefix.txt - Must be in same directory ASuperFunTest.bls - A file generated with this. Enjoy! (btw i wrote everything, incase you wondered) |
| elm:
...Lol... |
| Brian Smithers:
--- Quote from: elm on May 21, 2012, 07:27:42 PM ---...Lol... --- End quote --- ? |
| Ipquarx:
So this is basically completely pointless? |
| Brian Smithers:
--- Quote from: Ipquarx on May 21, 2012, 07:54:42 PM ---So this is basically completely pointless? --- End quote --- ;~; if you don't know/use pyhon, then duh. It's a python library type thing. |
| Navigation |
| Message Index |
| Next page |