Workaround for a BYOND bug that the BYOND devs say isn't a bug.

Conflicts:
	icons/mob/items_lefthand.dmi
	icons/mob/items_righthand.dmi
	tools/OpenBYOND
This commit is contained in:
Rob Nelson
2014-05-24 10:09:01 -04:00
committed by ZomgPonies
parent e1ce0ee664
commit 19d906e6bb
16 changed files with 640 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
In-Hand DMI Compile System
==========================
A shitty hack by N3X15
WHY THE FUCK?
-------------
BYOND 499 limited the number of icon states that can be
added to a DMI to 512 states. Why? Who fucking knows.
Magically, DM can't edit them but the server doesn't
care how big they are, so it's probably a shitty hack
so they don't have to change the array's index type.
Whatever the case, we ran into this wall. You cannot edit
items_lefthand and items_righthand with BYOND anymore. We
filed a bug report: http://www.byond.com/forum/?post=1507331
They closed it with "Not a Bug".
So, here we are. The only way to edit DMIs that big
is with third-party tools like OpenBYOND.
How to Compile
--------------
Simply dump your DMIs into the appropriate folder and run
compile.py from within this folder. It'll build the DMIs
and jam everything into a single meta-DMI for you.
Simple.
Adding More Output Targets
--------------------------
If you've run into the problem mentioned above with another
DMI, have no fear: Just edit compile.py and add the new
output target to the ToBuild dict as shown in the comments.
License
-------
MIT
+48
View File
@@ -0,0 +1,48 @@
'''
Created on Feb 28, 2014
@author: Rob
'''
import os, sys, logging
ToBuild={
# ' file to build': 'directory to pull from/',
'../items_lefthand.dmi': 'left/',
'../items_righthand.dmi': 'right/'
}
# Tell Python where to find OpenBYOND.
# Assuming we're in icons/mob/in-hand
sys.path.append('../../../tools/OpenBYOND/src')
from com.byond.DMI import DMI
from DMITool import compare_all
def buildDMI(directory, output):
dmi = DMI(output)
logging.info('Creating {0}...'.format(output))
for root, _, files in os.walk(directory):
for filename in files:
if filename.endswith('.dmi') and not filename.endswith('.new.dmi'):
filepath = os.path.join(root,filename)
logging.info('Adding {0}...'.format(filename,output))
subdmi = DMI(filepath)
subdmi.loadAll()
if subdmi.icon_height!=32 or subdmi.icon_width!=32:
logging.warn('Skipping {0} - Invalid icon size.'.format(filepath))
changes = 0
for state_name in subdmi.states:
if state_name in dmi.states:
logging.warn('Skipping state {0}:{1} - State exists.'.format(filepath,state_name))
continue
dmi.states[state_name]=subdmi.states[state_name]
changes += 1
logging.info('Added {0} states.'.format(changes))
#save
logging.info('Saving {0} states to {1}...'.format(len(dmi.states),output))
dmi.save(output)
if __name__ == '__main__':
# Cheating, but useful for checking for unsync'd stuff
compare_all('left/','right/','in-hand_sync_report.txt',None,newfile_theirs=False,newfile_mine=False)
for output, input_dir in ToBuild.items():
buildDMI(input_dir,output)
+549
View File
@@ -0,0 +1,549 @@
# DMITool Difference Report: C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\cable_stuff.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\cable_stuff.dmi
+ cuff_cyan
+ cuff_orange
+ cuff_pink
+ cuff_white
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\guns.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\guns.dmi
+ scythe0
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\rpd.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\rpd.dmi
+ rpd
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\swords_axes.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\swords_axes.dmi
+ axe0
+ axe1
- dualsaber0
- dualsaber1
- fireaxe0
- fireaxe1
- katana
- scythe0
- unathiknife
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\vox_civvie.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\vox_civvie.dmi
+ vox-pressure-security
--- C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\left\zz_old_items_lefthand.dmi
+++ C:\Users\Rob\Documents\Projects\vgstation13\icons\mob\in-hand\right\zz_old_items_lefthand.dmi
+ DONGS
+ Gibtonite ore
+ altair_locket
+ an_tank
+ analyzer
+ armor
+ armor_reflec
+ assembly
+ atmos_gold_hardsuit
+ atmos_gold_helm
+ atmos_hardsuit
+ atmos_helm
+ atmos_suit
+ atoxinbottle
+ autoinjector
+ axe0
+ axe1
+ b_mask
+ b_shoes
+ b_shoesold
+ b_suit
+ ba_suit
+ backpack
+ balloon
+ balloon-empty
+ banana_peel
+ basketball
+ baton
+ beachball
+ beaker
+ bedsheet
+ beer
+ bgloves
+ bible
+ bike_horn
+ bio_hood
+ bio_orange
+ bio_suit
+ bl_shoes
+ bl_shoesold
+ bl_suit
+ blackskirt
+ blade
+ blindfold
+ blueprints
+ bombvest
+ brain2
+ brick
+ briefcase
+ broken_beer
+ broom
+ browncane
+ brutepack
+ bucket
+ buckler
+ bucklerOLD
+ buildpipe
+ burger
+ butch
+ butcher_knife
+ c20r
+ c_tube
+ cakehat0
+ cakehat1
+ candy
+ canister
+ caphat
+ capspacehelmet
+ capspacesuit
+ captainpack
+ card-id
+ cardborg
+ cardborg_h
+ carton
+ caution
+ ce_hardsuit
+ ce_helm
+ cell
+ centcom
+ centhat
+ cespace_helmet
+ cespace_suit
+ chain
+ chainmail
+ chef
+ chefhat
+ chickensuit
+ chips
+ cigoff
+ cigon
+ cigpacket
+ classic_baton
+ claymore
+ cleaner
+ clipboard
+ clown
+ clown_hat
+ clown_shoes
+ clownpack
+ coffee
+ coil
+ coil_blue
+ coil_cyan
+ coil_green
+ coil_orange
+ coil_pink
+ coil_red
+ coil_white
+ coil_yellow
+ cola
+ contliquid
+ contsolid
+ contvapour
+ coolant-c
+ crossbow
+ crossbow-solid
+ crowbar
+ crowbar_red
+ cueball
+ cuff_blue
+ cuff_cyan
+ cuff_green
+ cuff_orange
+ cuff_pink
+ cuff_red
+ cuff_white
+ cuff_yellow
+ cultblade
+ culthood
+ cultpack
+ cultrobes
+ cutlass0
+ cutlass1
+ cutters
+ cutters_yellow
+ daederic
+ deagleg
+ death_commando_mask
+ death_commando_suit
+ deathnettle
+ det
+ det_hat
+ det_suit
+ dg_suit
+ dnainjector
+ donut1
+ donut2
+ dpickaxe
+ dr_gibb
+ dropper
+ dualsaber0
+ dualsaber1
+ dualsaberblue1
+ dualsabergreen1
+ dualsaberpurple1
+ dualsaberrainbow1
+ dualsaberred1
+ earmuffs
+ egg
+ egg1
+ egg2
+ egg3
+ egg4
+ egg5
+ electronic
+ electropack
+ emergency
+ emergency_double
+ emergency_engi
+ emp
+ energy_drink
+ energykill
+ energykill0
+ energykill100
+ energykill25
+ energykill50
+ energykill75
+ energystun
+ energystun0
+ energystun100
+ energystun25
+ energystun50
+ energystun75
+ eng_hardsuit
+ eng_helm
+ engi_suit
+ engiepack
+ engspace_helmet
+ engspace_suit
+ eshield0
+ eshield1
+ faggot
+ fire_extinguisher
+ fire_suit
+ fireaxe0
+ fireaxe1
+ firefighter
+ firstaid
+ firstaid-advanced
+ firstaid-ointment
+ firstaid-toxin
+ flamethrower_0
+ flamethrower_1
+ flare
+ flashlight
+ foamcrossbow
+ focus
+ fr_jacket
+ g_suit
+ galoshes
+ gas_alt
+ gas_mask
+ gift
+ giftbag
+ glasses
+ gold_id
+ gpickaxe
+ greatcoat
+ greenbandana
+ gun
+ gy_suit
+ handcuff
+ harpoon
+ hatchet
+ headset
+ healthanalyzer
+ helm-command
+ helm-orange
+ helmet
+ hfrequency0
+ hfrequency1
+ hoe
+ holidaypriest
+ ice_tea_can
+ imperium_monk
+ implantcase
+ ithaqua
+ jackboots
+ jackhammer
+ janitor
+ jensencoat
+ jensensuit
+ jetpack
+ jetpack-black
+ jetpack-void
+ johnny
+ johnny_coat
+ judge
+ katana
+ kilt
+ kineticgun
+ kingyellow
+ knife
+ kobskull
+ koran
+ l6closedmag
+ l6closednomag
+ l6openmag
+ l6opennomag
+ labcoat
+ lamp
+ lampgreen
+ laser
+ latexballon
+ lawyer_black
+ lawyer_blue
+ lawyer_red
+ lb_suit
+ lemon-lime
+ lgloves
+ lipstick
+ lipstickopen
+ m_mask
+ magboots
+ medibottle
+ medical_hardsuit
+ medical_helm
+ medicalpack
+ melted
+ miniFE
+ mining_hardsuit
+ mining_helm
+ mop
+ mousetrap
+ multitool
+ muzzle
+ nazi1
+ necronomicon
+ nettle
+ newspaper
+ nothing
+ nucgun
+ nucgun0
+ nucgun100
+ nucgun25
+ nucgun50
+ nucgun75
+ nullrod
+ nun
+ nursesuit
+ o_shoes
+ o_shoes1
+ o_suit
+ ointment
+ overalls
+ owl
+ owl_mask
+ oxygen
+ oxygen-c
+ oxygen_f
+ oxygen_fr
+ p_suit
+ paintcan
+ paper
+ pen
+ pickaxe
+ pie
+ pill
+ pizzabox1
+ plantbgone
+ plasma
+ plasma-c
+ plasticbag
+ plasticx
+ pneumatic
+ pneumatic-tank
+ ppickaxe
+ prod
+ psyche
+ pulse
+ pulse0
+ pulse100
+ pulse25
+ pulse50
+ pulse75
+ purple_can
+ pwig
+ quarrel
+ r_feet
+ r_hands
+ r_head
+ r_shoes
+ r_suit
+ rack_parts
+ rad_suit
+ radio
+ rainbow
+ rcd
+ rcdammo
+ rejuvbottle
+ rev_headballoon
+ revballoon
+ rig_helm
+ rig_suit
+ riot
+ riotgun
+ ro_suit
+ rods
+ rolling_pin
+ roman_shield
+ rpd
+ rubberducky
+ s-ninja_mask
+ s-ninja_suit
+ s_helmet
+ s_mask
+ s_suit
+ santa
+ santahat
+ saw3
+ scalpel
+ scientology
+ scrapbook
+ scratch
+ screwdriver
+ screwdriver_blue
+ screwdriver_brown
+ screwdriver_cyan
+ screwdriver_green
+ screwdriver_purple
+ screwdriver_yellow
+ scythe0
+ sec-case
+ sec_hardsuit
+ sec_helm
+ secsoft
+ securitypack
+ shard-glass
+ sheet-card
+ sheet-glass
+ sheet-metal
+ sheet-rglass
+ shotgun
+ shovel
+ signaler
+ silver_id
+ sl_suit
+ sodawater
+ sord
+ space-up
+ space_helmet_syndicate
+ space_mountain_wind
+ space_suit_syndicate
+ spade
+ spearglass0
+ spearglass1
+ speargun
+ spickaxe
+ spoon
+ spraycan
+ staff
+ staffofchange
+ stamp
+ starkist
+ stick
+ stool
+ straight_jacket
+ suit-command
+ suit-orange
+ sunflower
+ sunglasses
+ swat_gl
+ swat_hel
+ swat_sh
+ swat_suit
+ sword0
+ swordblue
+ swordchain
+ swordgreen
+ swordpurple
+ swordrainbow
+ swordred
+ syndballoon
+ syndicate-black
+ syndicate-black-blue
+ syndicate-black-green
+ syndicate-black-red
+ syndicate-green
+ syndicate-green-dark
+ syndicate-helm-black
+ syndicate-helm-black-blue
+ syndicate-helm-black-green
+ syndicate-helm-black-red
+ syndicate-helm-green
+ syndicate-helm-green-dark
+ syndie_hardsuit
+ syndie_helm
+ syringe_0
+ syringe_1
+ syringe_10
+ syringe_15
+ syringe_5
+ syringe_kit
+ syringegun
+ table_parts
+ taser
+ taser0
+ taser100
+ taser25
+ taser50
+ taser75
+ tdgreen
+ tdhelm
+ tdred
+ template
+ that
+ thirteen_loko
+ tile
+ tonic
+ toolbox_blue
+ toolbox_red
+ toolbox_syndi
+ toolbox_yellow
+ toxinbottle
+ toysword0
+ toysword1
+ trashbag
+ ty_necklace
+ unathiknife
+ upickaxe
+ vhammer
+ vhelmet
+ vialblue
+ vialgreen
+ violin
+ vox-helmet-engineer
+ vox-helmet-medical
+ vox-helmet-normal
+ vox-helmet-science
+ vox-helmet-security
+ vox-helmet-specops
+ vox-pressure-engineer
+ vox-pressure-medical
+ vox-pressure-normal
+ vox-pressure-science
+ vox-pressure-security
+ vox-pressure-specops
+ w_shoes
+ w_suit
+ waiter
+ warden
+ wcoat
+ welder
+ welder1
+ welding
+ welding-g
+ weldingoff
+ wiz_hardsuit
+ wiz_helm
+ wizhat
+ wizrobe
+ wizshoe
+ wrap_paper
+ wrench
+ xenos_helm
+ xenos_suit
+ y_suit
+ ygloves
+ zippo
+ zippoon
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB