[WIP] The Makerlathe

How, what and why to code in BYOND.
Post Reply
suomynonAyletamitlU
Joined: Thu Apr 17, 2014 5:09 pm

[WIP] The Makerlathe

Post by suomynonAyletamitlU » #20920

This is somewhere between an FYI, a call for help, and a "Just in case" message post.

So I'm moving somewhere in the next couple weeks and getting a new job. The predictable TL;DR here is that dev work will be on standby, and wouldn't you know it, I'm in the middle of something I wanted to offer. I've been posting code hereabouts as I finish it, but it is an unfortunate possibility that I am not going to be able to get it done.

The makerlathe project replaces fucking everything that should have been the same object type to begin with--autolathe, protolathe, mech fab, circuit fab, biogenerator, and it'd be as easy to make new ones as you could possibly wish. It has a lot of features like arbitrary costs for building things (it's all reagent based, and new "reagents" were added for things like glass and diamond sheets), using stock parts in the building of objects (and getting them back when you recycle the thing), converting reagents (nutriment into milk in the biogen), fill reagents like welding fuel and fire extinguisher water, reagents that are consumed making the thing and not recycled (acid -> circuit boards, circuit boards -/> acid), build queues, hacked product lists, researchable product lists, dumping stock back into sheets, bottling reagents, etc, usw.

It's done, and it's not done. The backend works, the UI I deem good enough, and it's easy to specify new machines; it's basically just filling out lists of typepaths. The problem isn't that, the problem is that I have to
  1. Attach a new cost list to virtually every item - note that these costs are not just iron and glass anymore, but can include custom and classy reagents such as leather, cloth, aluminum, and plastic, making clothing lathes an exciting future idea
  2. Create new reagents and make them sane (I would also like to add titanium and aluminum ores and sheets, and plastic and rubber sheets with some way to make that reagent--you can make leather sheets in the biogenerator, cloth would be a logical addition there too--these are all details that can be better integrated later as long as they are added). Note that making them sane means adding color and other details, and might involve fixing anything stupid I did that I haven't discovered yet.
  3. If I am replacing the protolathe and circuit fab, alter the R&D front end so the panel no longer accesses them, or something to that effect (the machines will sync with the robotics R&D server currently). I do not have a DA replacement, but if I did, the R&D rectangle could be completely replaced
  4. The code is not integrated--there is for example a file with all of the new reagents in the module folder instead of those reagents being put in the master reagents file. Another file has procs added to all items, which needs to be moved. The items are not currently on the map.
  5. Old code needs to be torn out - This replaces m/g_amt, cyborg/mecha construction cost list, makes unnecessary some variables in the research design datums, etc.
  6. There needs to be some thought given to the following ratios, and I do not want to do it:
    • Sheets to reagents (currently 2000 reagents/1 sheet)
    • Atmospherics gas to reagents (for filling air tanks, etc - currently 100 reagents / 1 mole gas)
    • Cost of various manufactured diddys (since all makerlathes can recycle things into components--but only if they contain only parts/reagents that the makerlathe builds with); for example, it's obvious that you can recycle clothing to build other clothing, but you don't want to recycle jumpsuits to build rig suits; rig suits must require exotic materials, space suits less exotic but still not just cloth, etc.
    • Component parts multipliers on costs/speed/etc (currently a little arbitrary)
Teaser images (costs are arbitrary and may not reflect final values):
Image Image Image Image
Teaser code that actually defines the autolathe:
Spoiler:

Code: Select all

/obj/item/weapon/circuitboard/maker/autolathe
	name = "circuit board (autolathe)"
	build_path = /obj/machinery/maker/autolathe

/obj/machinery/maker/autolathe
	name = "autolathe"
	board_type = /obj/item/weapon/circuitboard/maker/autolathe // allows disassembly
	// Fortunately the standard icons for the makerlathe are autolathe icons
	insert_anim(var/obj/item/I)
		var/anim = "autolathe_o"
		switch(I.type) // this could be done better
			if(/obj/item/stack/sheet/glass, /obj/item/stack/sheet/rglass)
				anim = "autolathe_r"
		flick(anim,src)
		sleep(10)

	main_menu_name = "Common"
	std_products = list(
		/obj/item/stack/rods,/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb, /obj/item/weapon/rcd_ammo,
		"tools", /obj/item/weapon/crowbar, /obj/item/device/multitool, /obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver, /obj/item/weapon/wirecutters, /obj/item/weapon/wrench,
		"utilities", /obj/item/weapon/reagent_containers/glass/bucket, /obj/item/device/flashlight, /obj/item/device/analyzer, /obj/item/device/t_scanner, /obj/item/device/taperecorder/empty, /obj/item/device/tape, /obj/item/weapon/kitchenknife,
		"safety", /obj/item/weapon/extinguisher, /obj/item/clothing/head/welding, /obj/item/device/radio/headset, /obj/item/device/radio/off, /obj/item/weapon/camera_assembly,
		"parts", /obj/item/newscaster_frame, /obj/item/weapon/stock_parts/console_screen, /obj/item/weapon/airlock_electronics, /obj/item/weapon/airalarm_electronics, /obj/item/weapon/firealarm_electronics,
				/obj/item/device/assembly/igniter, /obj/item/device/assembly/signaler, /obj/item/device/assembly/infra, /obj/item/device/assembly/timer, /obj/item/device/assembly/voice, /obj/item/device/assembly/prox_sensor,
		"medical", /obj/item/weapon/scalpel, /obj/item/weapon/circular_saw, /obj/item/weapon/surgicaldrill, /obj/item/weapon/retractor, /obj/item/weapon/cautery, /obj/item/weapon/hemostat,
					/obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/reagent_containers/glass/beaker/large,/obj/item/weapon/reagent_containers/syringe,
		"ammunition", /obj/item/ammo_casing/shotgun/beanbag, /obj/item/ammo_box/c38
		)
	hack_products = list(
		"tools", /obj/item/weapon/rcd, /obj/item/weapon/weldingtool/largetank,
		"safety", /obj/item/weapon/flamethrower/full, /obj/item/device/radio/electropack, /obj/item/weapon/handcuffs,
		"ammunition",  /obj/item/ammo_box/a357, /obj/item/ammo_casing/shotgun, /obj/item/ammo_casing/shotgun/buckshot, /obj/item/ammo_casing/shotgun/dart, /obj/item/ammo_casing/shotgun/incendiary
		)

	stock_parts = list() // enabled
	researchable = null // disabled
	queue = null // disabled

// if reliability falls you may end up with one of these and waste resources
	junk_recipes = list(/obj/item/weapon/ore = list("iron" = 200), /obj/item/weapon/shard = list("glass" = 200), /obj/item/weapon/wirerod = list("iron" = 350), /obj/item/weapon/kitchen/utensil/fork = list("iron" = 600)) 

// only items with these resources (and stock parts, see above) can be recycled here; items with any other resource costs are rejected
	recycleable = list("iron","glass","water","fuel") 
As I say it is mostly done, and I am moving. I will try to finish it, but if you don't hear from me in the next few months, you may want to endeavor to finish it on your own. There are still bugs in addition to all the work above (there always are), some known or WIP, some just not yet discovered.
User avatar
Hornygranny
Horny Police
Joined: Tue Apr 15, 2014 4:54 pm
Byond Username: Hornygranny

Re: [WIP] The Makerlathe

Post by Hornygranny » #20921

can this be called a CNC machine instead of a fucking MAKERlathe
Image
suomynonAyletamitlU
Joined: Thu Apr 17, 2014 5:09 pm

Re: [WIP] The Makerlathe

Post by suomynonAyletamitlU » #20922

There is no literal makerlathe, the "maker machine" / matherlathe is the basis for making new lathes/printers/generators/fabs/etc.

If anyone adds a "makerlathe" per se it won't be me
Post Reply

Who is online

Users browsing this forum: No registered users