real chemistry chemicals?

since i have absolutely no clue about lua i was wondering if it would be possible to make real chemicals? (in containers, maybe make them have them like water in a bucket (know its a bad description but still i dont know how to word it differently)) and be able to mix them together to make realistic effects?

(User was banned for this post ("Wrong forum" - Overv))

This is in the wrong section :wink: I have thought about this idea too , but you would need to make a whole library of effects and combinations and eventually uses. I think it would just be better if you could make chemicals at an atom level , through a GUI. like place atoms, and link them into molecules, then then mix certain mixtures of molecules.

All in all , i agree with this idea :slight_smile:

Define ‘real chemicals’ and how it has to do with lua.

@James & Diss: He wants to make something like that thing in the toybox, the repusion gel bucket, but give it chemicals… that can mix and cause reactions… he wants to know how to do it.
@kig: This would be extremely difficult for a beginner… try proposing it to someone looking for a project build.

thanks! (and sorry about the wrong section, new to facepunch, dont punish me) lol

This shouldnt be too hard to make.
Have a table of chemicals and their uses and reactions along with a few functions.
The only thing this involves is time.

If this becomes a project, I would very much enjoy working on it. I could make the libraries for it ( I like science reactiony stuff :wink: ).

Eh, there’s two possible endings with this, you either make some gimmicky crap not many people will like to play or make an overly complex chemistry simulator that is not fun to play.

There’s really nothing in between, like, either you have an overly simplistic “USE THIS ON THIS TO GET THAT”, or something that accounts for molarity, density, atomic mass, and of course the physics and chemistry of reactions to make something people interested on it will like.

This alone requires not only incredibly complex GUI work, but a whole load of knowledge of Van der Wals forces, chemical bonds, electronegativity and even a certain degree of quantum physics, like the uncertainty principle and particle-wave duality.

Who said the GUI would be complex?!? I don’t think you know what I had in mind :wink: and the rest is just values and physic laws :slight_smile:

The GUI should be intuitive enough to tell if you can actually create the molecule, and the physics behind it are very, very complex.

This would be horrible to make. It’s hard enough understanding certain reactions never mind trying to recreate them in a game.

Just because you can’t get your head around something doesn’t make it a bad idea. If this guy is speaking about what I think, I’m guessing it will be stuff like sodium+chlorine=salt or carbon+hydrogen+oxygen=sugar.

I did chemistry to a level the equivalent of first year university… this isn’t a good idea because the only people that would use it are the people that would like to simulate complex reactions (And they would be able to do the real reaction instead of a copy)

Which adds another feature :smiley: what if you can choose a difficulty level, as to match your level of understanding :slight_smile:

– counter that if you would be so kind

That’s not how chemistry works, and that’s exactly what I’m referring to as gimmicky. Sugar is a carbohydrate, yes, and as most organical chemicals it contains carbon, hydrogen and oxygen. You however are not considering a whole bunch of things.

  1. Organic chemistry is entirely different from inorganic, it has different rules, different laws governing them (Most specifically those concerning carbon), and how there are THOUSANDS of combinations that don’t actually exist in real life for various reasons.

  2. Sugar is actually a whole family of crystalline compounds, none of which are easy to work with. Glucose (C6H12O6), the simplest monosaccharide of them all, is actually quite hard to work with, to begin with it has 4 chiral carbons, meaning it has enantiomers and a diasteroismomer (mirror shape), l-glucose, which albeit tastes the same, cannot be metabolized by the body. It is fabricated by enzimatic hydrolisis of starch, not some simple addition of hydrogen and oxygen in it’s pure form.

Hell, it’s IUPAC name is (2R,3S,4R,5R)-2,3,4,5,6-Pentahydroxyhexanal. It’s even hard to express through any notation.

Oh hell, and don’t even get me started with sodium chloride.

I think kids would be more interested in concoctions like “Minge Juice” and “Ban Elixir” rather than making sertraline hydrochloride, or sildenafil.

I doubt most GModders even know what a dispersion force is.

I did try this and I have a mass of files that I could upload if you really wanted to take a look yourself.

Sample code for Copper:

-- This table sets flags of the element.
ElementFlags["start quantity"]="1" -- Probably not a good idea to change this number.
ElementFlags["name"]="Copper" -- What is this elements name?
ElementFlags["symbol"]="Cu" -- One uppercase letter and one lowercase letter will do for the symbol. Something like Je or Mz will do. Don't use numbers or things like $ and %.
ElementFlags["atomic number"]="29" -- Set this to a triple digit number, somewhere above 300 preferably to avoid conflicts with existing elements. 
ElementFlags["state"]="solid" -- What state does the element start in? (solid, liquid, gas)
ElementFlags["melting point"]="1360 K" -- What temperature (measured in Kelvin) is needed to move from a solid to liquid state?
ElementFlags["boiling point"]="3200 K" -- What temperature (measured in Kelvin) is needed to move from a liquid to gas state? This should be AT LEAST 50 K higher than the melting point!
ElementFlags["group"]="Transition Metal" -- Set between 1 and 18. Group 1 is the most reactive with 18 being unreactive.
ElementFlags["period"]="4" -- Set between 1 and 7. Note: setting the number to 7 will FORCE and OVERRIDE radioactivity in order to conform with the periodic table.
ElementFlags["radioactive"]="No" -- Does it give off radioactive energy? Setting this to "Yes" will cause user damage if a HAZMAT suit is not worn.
ElementFlags["half life"]="0" -- How long in seconds it will take the radioactive element to halve its quantity.

-- This 'if' statement checks if your element's state is a gas and then sets it to run in a molecular structure (diatomic).
if ( ElementFlags["state"] == "gas" ) and ( ElementFlags["start quantity"] == "1" ) then
    ElementFlags["start quantity"] = "2"

-- This 'if' statement checks if your element is in period 7 and then sets it to a radioactive state.
if ( ElementFlags["period"] == "7" ) and ( ElementFlags["radioactive"] == "No" ) then
    ElementFlags["radioactive"] = "Yes"
    ElementFlags["half life"] = "5" -- default half life (5 seconds)

-- This 'if' statement checks if your element is NOT in period 7 and is radioactive and if those conditions are met, it deactivates the radioactive properties.(this reduces complexity on searches/table matching)
if ( ElementFlags["period"] != "7" ) and ( ElementFlags["radioactive"] == "Yes" ) then
    ElementFlags["radioactive"] = "No"
    ElementFlags["half life"] = "0"

-- print the flags of element to console (later to be hooked up to some kind of visual display)
function RetrieveFlags(flags) 
    Msg("Element: "..ElementFlags["name"].."
    Msg("Atomic Number: "..ElementFlags["atomic number"].."
    Msg("State: "..ElementFlags["state"].."
    Msg("Melting Point: "..ElementFlags["melting point"].."
    Msg("Boiling Point: "..ElementFlags["boiling point"].."
    Msg("Table Group: "..ElementFlags["group"].."
    Msg("Table Period: "..ElementFlags["period"].."
    Msg("Radioactivity: "..ElementFlags["radioactive"].."
    Msg("Half life: "..ElementFlags["half life"].."
    Msg("Formula: "..ElementFlags["symbol"]..""..ElementFlags["start quantity"].."

concommand.Add( "element_details copper" , RetrieveFlags(flags) ) -- console command to list the details in the console. Replace "ELEMENTHERE" after the command with the element name.

These flags are read from the entity file which I never got around to making. Obviously the elements will need many flags in order to work properly.

The final output will never be realistic of course, and if it’s realistic it isn’t fun at all. If anybody wants to make this, the realistic focus should be removed for a Hollywood-esque simplification of real life chemical processes.

Well i agree with this project. I think that if we could have a simple language so that it could be as simple as putting “for every hydrogen add 2 oxygens”.

Anyway. I also think if there are gas gans and pipes, like the engines mod, it would work well.

Think SS13 chemistry, do awesome stuff.