Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: NightS' Easy Metal Creator  (Read 7970 times)

NightS

  • Bay Watcher
    • View Profile
NightS' Easy Metal Creator
« on: August 09, 2011, 05:02:48 am »

An easy batch script which lets you creaty nearly any metal introducing just some parameters.
Here is the original code:

Spoiler (click to show/hide)
And here is the new one, improved by Putnam
Spoiler (click to show/hide)
To use it: Paste it in a .txt document, save as *put name here*.bat

Try it and report any bugs ^^
Also, one little problem: The metal names don't appear in caps, so you'll have to modify that manually :)
« Last Edit: October 23, 2011, 12:50:25 pm by NightS »
Logged

jaxy15

  • Bay Watcher
  • Adept Modder
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #1 on: August 09, 2011, 05:11:10 am »

Now I don't have to copy and paste existing metals and take several hundred hours to change the values.
Thank you, sir.
Logged
Dwarf Fortress: Threats of metabolism.

NightS

  • Bay Watcher
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #2 on: August 09, 2011, 05:14:56 am »

Yay, i'm useful ^^
If you are going to use it in your mod, please give me credit, just that :D
Logged

jaxy15

  • Bay Watcher
  • Adept Modder
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #3 on: August 09, 2011, 05:15:51 am »

Yeah, sure.
Logged
Dwarf Fortress: Threats of metabolism.

krisslanza

  • Bay Watcher
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #4 on: August 09, 2011, 08:21:28 am »

Now this seems pretty useful... now if I only knew enough about metals not in DF that I could make accurate versions of them, or knew enough of what all the tokens mean, to know what I'm doing if I mod in new metals... :P

NightS

  • Bay Watcher
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #5 on: August 09, 2011, 08:59:27 am »

You can also make weapons-grade gems or ceramics or whatever with this, you just need to modify some tags :)
You don't need to know much about the metals to use it, the script tells you what do the things that you write in it (some are interpretations, so it might not be 100% accurate)
If you still don't know what does tensile this or compressive that, you can look in the wiki :P
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #6 on: August 10, 2011, 09:25:21 pm »

Great job NightS! This will make my metal working so much easier. You can also use it for the material_template_default file, but with a little bit of tinkering.

The only thing I would add onto it is that you should be able to choose what [ITEMS_xxx] tags you want/don't want. But keep up the good work :D
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #7 on: October 08, 2011, 10:24:02 am »

Good job!
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #8 on: October 15, 2011, 02:58:26 pm »

I just made a version of this that can convert ANY real life metal into DF; is it okay if I post that? I've make sure to mention that your metal creator is the base.

Actually, I'm just going to post it here :P

Code: [Select]
@echo off
:bucle1
echo Putnam's Easy Metal Converter (Based on NightS easy metal creator, most of file is from NightS)
echo Metal name:
set /p name=
cls
echo %name% ingame value (dorfbucks)
echo Insert value here:
set /p value=
cls
echo %name% specific heat (j/(KgK)) (Joules per kilogram kelvin)
echo Insert value here:
set /p specheat=
cls
echo %name% melting point (farenheit)
echo Insert value here:
set /p rawmelt=
cls
echo %name% boiling point (farenheit)
echo Insert value here:
set /p rawboil=
cls
echo %name% solid density (g/cm3) * 1000
echo Insert value here:
set /p rawdenss=
cls
echo %name% liquid density (g/cm3) * 1000
echo Insert value here:
set /p rawdensl=
cls
echo %name% molar mass (g/mol) * 1000
echo Insert value here:
set /p rawmmass=
cls
echo %name% Young's Modulus
set /p tyield=
cls
echo %name% Bulk Modulus
set /p cistrain=
cls
echo %name% Shear Modulus
set /p arbstrain=
cls
echo %name% max edge (default 10000)
echo Note: Maximum edge it can hold, 10000 for most metals, maybe higher for glasses, ceramics, etc.
echo Insert value here:
set /p edge=
cls
echo Please wait...

set /a tyieldone=%tyield% * 1000
set /a arbstrainone=%arbstrain% * 1000
set /a cistrainone=%cistrain% * 1000
set /a testimateone=155000 * ( %tyieldone% / 211 )
set /a testimate=%testimateone% / 1000
set /a tfract=%testimate% * 2
set /a melt=%rawmelt% + 9968
set /a boil=%rawboil% + 9968
set /a denss=%rawdenss%
set /a densl=%rawdensl%
set /a mmass=%rawmmass%
set /a iyield2=%testimate% * 7
set /a ifract2=%tfract% * 7
set /a istrain=319 * (%cistrainone% / 170 )
set /a cyield2=%testimate% * 7
set /a cfract2=%tfract% * 7
set /a cstrain=319 * ( %cistrainone% / 170 )
set /a toryield=%testimate%
set /a torfract=%tfract%
set /a torstrain=189 * ( %arbstrainone% / 82 )
set /a syield=%testimate%
set /a sfract=%tfract%
set /a sstrain=189 * ( %arbstrainone% / 82 )
set /a byield=%testimate%
set /a bfract=%tfract%
set /a bstrain=73 * ( %tyieldone% / 211 )
set /a iyield=%iyield2% / 2
set /a ifract=%ifract2% / 2
set /a cyield=%cyield2% / 2
set /a cfract=%cfract2% / 2

set /a shearbasedone=sstrain / 1000
set /a youngbasedone=bstrain / 1000
set /a bulkbasedone=cstrain / 1000


echo [INORGANIC:%name%] >> inorganics_metal_NEMC.txt
echo [USE_MATERIAL_TEMPLATE:METAL_TEMPLATE] >> inorganics_metal_NEMC.txt
echo [STATE_NAME_ADJ:ALL_SOLID:%name%] >> inorganics_metal_NEMC.txt
echo [STATE_NAME_ADJ:LIQUID:molten %name%] >> inorganics_metal_NEMC.txt
echo [STATE_NAME_ADJ:GAS:boiling %name%] >> inorganics_metal_NEMC.txt
echo [DISPLAY_COLOR:0:7:1] >> inorganics_metal_NEMC.txt
echo [MATERIAL_VALUE:%value%] >> inorganics_metal_NEMC.txt
echo [SPEC_HEAT:%specheat%] >> inorganics_metal_NEMC.txt
echo [MELTING_POINT:%melt%] >> inorganics_metal_NEMC.txt
echo [BOILING_POINT:%boil%] >> inorganics_metal_NEMC.txt
echo [ITEMS_HARD] >> inorganics_metal_NEMC.txt
echo [ITEMS_METAL] >> inorganics_metal_NEMC.txt
echo [ITEMS_BARRED] >> inorganics_metal_NEMC.txt
echo [ITEMS_SCALED] >> inorganics_metal_NEMC.txt
echo [SOLID_DENSITY:%denss%] >> inorganics_metal_NEMC.txt
echo [LIQUID_DENSITY:%densl%] >> inorganics_metal_NEMC.txt
echo [MOLAR_MASS:%mmass%] >> inorganics_metal_NEMC.txt
echo [IMPACT_YIELD:%iyield%]  >> inorganics_metal_NEMC.txt
echo [IMPACT_FRACTURE:%ifract%] >> inorganics_metal_NEMC.txt
echo [IMPACT_STRAIN_AT_YIELD:%bulkbasedone%] >> inorganics_metal_NEMC.txt
echo [COMPRESSIVE_YIELD:%cyield%] >> inorganics_metal_NEMC.txt
echo [COMPRESSIVE_FRACTURE:%cfract%] >> inorganics_metal_NEMC.txt
echo [COMPRESSIVE_STRAIN_AT_YIELD:%bulkbasedone%] >> inorganics_metal_NEMC.txt
echo [TENSILE_YIELD:%testimate%] >> inorganics_metal_NEMC.txt
echo [TENSILE_FRACTURE:%tfract%] >> inorganics_metal_NEMC.txt
echo [TENSILE_STRAIN_AT_YIELD:%youngbasedone%] >> inorganics_metal_NEMC.txt
echo [TORSION_YIELD:%toryield%] >> inorganics_metal_NEMC.txt
echo [TORSION_FRACTURE:%torfract%] >> inorganics_metal_NEMC.txt
echo [TORSION_STRAIN_AT_YIELD:%shearbasedone%] >> inorganics_metal_NEMC.txt
echo [SHEAR_YIELD:%syield%] >> inorganics_metal_NEMC.txt
echo [SHEAR_FRACTURE:%sfract%] >> inorganics_metal_NEMC.txt
echo [SHEAR_STRAIN_AT_YIELD:%shearbasedone%] >> inorganics_metal_NEMC.txt
echo [BENDING_YIELD:%byield%] >> inorganics_metal_NEMC.txt
echo [BENDING_FRACTURE:%bfract%] >> inorganics_metal_NEMC.txt
echo [BENDING_STRAIN_AT_YIELD:%youngbasedone%] >> inorganics_metal_NEMC.txt
echo [MAX_EDGE:%edge%] >> inorganics_metal_NEMC.txt
cls
echo Want to create another metal?
echo Write y (no caps) to create another one
set /p bucle=
if %bucle%==y GOTO bucle1
cls
echo Thanks for using Putnam's Easy Metal Converter (made first by NightS)
pause
exit
« Last Edit: October 15, 2011, 03:03:33 pm by Putnam »
Logged

NightS

  • Bay Watcher
    • View Profile
Re: NightS' Easy Metal Creator (2.0)
« Reply #9 on: October 23, 2011, 12:48:54 pm »

First, excuse me for the late reply (i forgot i had the new replies button, i've been on the forum all this time without using it :P) and second, great job :P My creator was just a small script to make them easy and fast, but not 100% accurate, making just balanced metals with the parameters you gave it, but yours looks quite a lot more polished and accurate. If anyone finds something that can be improved (or fixed!), post it and i will change the text from the first post for the fixed one.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: NightS' Easy Metal Creator (2.0)
« Reply #10 on: October 23, 2011, 12:55:05 pm »

First, excuse me for the late reply (i forgot i had the new replies button, i've been on the forum all this time without using it :P) and second, great job :P My creator was just a small script to make them easy and fast, but not 100% accurate, making just balanced metals with the parameters you gave it, but yours looks quite a lot more polished and accurate. If anyone finds something that can be improved (or fixed!), post it and i will change the text from the first post for the fixed one.

Nono, mine is for a different purpose. Yours can be used to create fictional metals; mine is used to put real metals into DF.

Mine can be used for fictional metals, but yours is far easier.

Besides, mine isn't polished. It's thrown together with a few edits to yours and kind of jury-rigged just to get it working at all.

Rather than calling mine an improved version, call mine something along the lines of "a version which takes a metal's real-life properties and converts them into DF properties".

Souleater17

  • Bay Watcher
  • [ANGEL]
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #11 on: January 21, 2012, 04:17:43 pm »

How do I use this?

Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #12 on: January 21, 2012, 05:23:24 pm »

How do I use this?

It's a BAT file that you run on Windows and Windows only.

Souleater17

  • Bay Watcher
  • [ANGEL]
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #13 on: January 21, 2012, 06:07:59 pm »

How exactly would I go about doing that? I'm rather new to all this, as you've probably gathered.
Logged

Minnakht

  • Bay Watcher
  • Green Eyed Monster
    • View Profile
Re: NightS' Easy Metal Creator
« Reply #14 on: January 21, 2012, 06:34:27 pm »

Well...
You know how there are executable files? You double-click them or open them in some other way and they do something.
.bat files are pretty much the same, if I remember correctly. It's been years since I've seen one. They're old.
Logged
Giant badgers are cruel saddistic balls of fur and hate. Did anyone know they could paint a wall with a single dwarven baby?.... You know what, I made the Giant badgers sound like sane DF players.
A Kea has stolen a coke!
Pages: [1] 2