Could someone tell me how to make a lua mod? I know how to use lua and i screw around with files alot in the console but i would like to know how to make new elements. I already know how to change the properties of elements that exist, but I need to know how to make a new element and then how to actually put it into use.
local ELEMENT = elements.allocate("Something1","Something2")
elements.element(elements.Something1_PT_Something2, elements.element(elements.DEFAULT_PT_WATR))
elements.property(elements.Something1_PT_Something2, "Name", "EXAMPLE")
elements.property(elements.Something1_PT_Something2, "Description", "Just an Example.")
elements.property(elements.Something1_PT_Something2, "Gravity", 0.4)
elements.property(elements.Something1_PT_Something2, "HotAir", 0.1)
elements.property(elements.Something1_PT_Something2, "Colour", 0xFF0000)
elements.property(elements.Something1_PT_Something2, "Loss", 0)
elements.property(elements.Something1_PT_Something2, "Hardness", 9999)
Simple way to create ane element.. A better example is the FOZO Element I created which is below.
local FOZO = elements.allocate("ELEMENT", "FOZO")
elements.element(elements.ELEMENT_PT_FOZO, elements.element(elements.DEFAULT_PT_GLOW))
elements.property(elements.ELEMENT_PT_FOZO, "Name", "FOZO")
elements.property(elements.ELEMENT_PT_FOZO, "Description", "Unknown Liquid. SUB/33/1/4/5/3[4]")
elements.property(elements.ELEMENT_PT_FOZO, "Colour", 0x0000FF)
elements.property(elements.ELEMENT_PT_FOZO, "Weight", 50)
elements.property(elements.ELEMENT_PT_FOZO, "Temperature", 70000)
elements.property(elements.ELEMENT_PT_FOZO, "LowTemperature", 10.0)
elements.property(elements.ELEMENT_PT_FOZO, "LowTemperatureTransition", elements.DEFAULT_PT_BCOL)
Hope this helped.
Thanks RadioActiveLua, you did help. While I was away I learned how to write in lua, and was stuck on trying to figure out how to melt my new element. Your post taught me how to do state changes and such.
I am stuck on how to make it appear in the menu though, help would be nice.
Like mniip would ever help.
I also need help learning how to use elements.property(ID,"Color",xxxxxx) correctly. The only 2 colors I can get are shades of green or shades of blue. Another thing, how do I make an element I create change forms on contact with another element? Like NEUT hitting PLNT to create WOOD?
1. It's "Colour", not "Color".
2. The property uses hex format, with a 0x prefix. Don't understand it?
To make it appear on a menu its
elements.property(elements.Something1_PT_Something2, "MenuSection", 1-11)
1=Electronics
2=Powder Materials
3=Sensors
4=Force
5=Explosives
6=Gasses
7=Liquids
8=Powders
9=Solids
10=Radioactive
11=Special