Real Reactions, Real Science!
Dichromate Volcano, Pharaoh's serpent, barcking dog and more!
Pastebin Ubuntu link: https://paste.ubuntu.com/p/4qgf3pd3Kx/
Including:
Ammonium Dichromate(ADCM) that makes a volcano when heated(with realistic Hot glowing Embers of Cr2O3)
Mercury Thiocyanate(MSCN) that expands into a mass of circular "Serpents" when lighted with fire! Even with Realistic Blue Glow as Expansion Happens!
Elements that takes different states, but still occupies a single ID!(LITH,C3N4,S8)
Mix Nitrous Oxide(N2O) and Carbon Disulfide(CS2) and light it to make a burst of photons!
(Now with pressure explosion)
Sulfur(S8) that is solid at room temperature, melts at higher temperature, thickens and burns with a ghostly flame when Hottest.(Realistic!)
Two types of new flames(WIP)(don't use directly)
Ghostly blue Sulfur flame that have two appearences despite being a single element(CS2F), and Atomic Emission Spectra with ATOM(WIP)
Decane NTR fuel that glows brightly with colours when superheated(DECN)
Lithium(WIP)(LITH) that melts without changing type and vaporizes into a brilliant blue plasma
be Free to modify this code with REAL Emission Spectrums!
be sure to post your modifications based on the spectra mechanism, as this is still an early WIP, and we need your help.
please add link on ORIGINAL pastebin (https://pastebin.com/)
Unreadable for me. It does'nt respect the usual syntax of having a namespace before a 4 letter code for the element, when defining its properties
this made it work
local dichromate = elements.allocate("CHEM", "DCMT")
elements.element(elements.CHEM_PT_DCMT, elements.element(elements.DEFAULT_PT_PQRT))
elements.property(elements.CHEM_PT_DCMT, "Name", "ADCM")
elements.property(elements.CHEM_PT_DCMT, "Description", "Ammonium dichromate")
elements.property(elements.CHEM_PT_DCMT, "Colour", 0xFFE0452C)
local cr2o3 = elements.allocate("CHEM", "CROX")
elements.element(elements.CHEM_PT_CROX, elements.element(elements.DEFAULT_PT_CLST))
elements.property(elements.CHEM_PT_CROX, "Weight", tpt.el.stne.weight)
elements.property(elements.CHEM_PT_CROX, "Loss", 0.96)
elements.property(elements.CHEM_PT_CROX, "Name", "CROX")
elements.property(elements.CHEM_PT_CROX, "Description", "Ammonium dichromate")
elements.property(elements.CHEM_PT_CROX, "Colour", 0xFF457742)
yes, makes sense. As the original code gave out syntax errors, I tried doing it the other way (which I thought was the usual one, but it turns out it is not).
As for the script itself, the emission spectra is brilliant!
What is wrong with typing out the long "elements.XXXX_PT_XXXX"?
Also side note, completely unrelated, how would I go about moving where vanilla elements are in the bar down the bottom?
It's not exactly wrong, but if you ever change the strings you pass to element.allocate, you have to change those references that depend on those strings too. If you save the value element.allocate returns into a local and just use that, you don't have to worry about it. Of course you may want to change the name of the local later, but you're much more likely to change the strings. It's just one of the cases in programming where redundancy is not favourable.
You can change in which menu an element appears by changing its MenuSection property. The elem table has the SC_* constants that are valid values for this property, for example elem.SC_SPECIAL. You can't change the order in which they appear in a menu though.