Is it possible to make low/high temperature transformations in Lua?
I tried this, but it doesn't seem to work:
elements.property(elements.NOBODY_PT_PLAS, "HighTemperature", 400.0)
elements.property(elements.NOBODY_PT_PLAS, "HighTemperatureTransition", NOBODY_PT_MPLA)
local notmolten = elements.allocate("boxbox", "AWES")
-- copy some element just for ease
elements.element(notmolten, elements.element(elements.DEFAULT_PT_SAND))
local molten = elements.allocate("boxbox", "SEWA")
elements.element(molten, elements.element(elements.DEFAULT_PT_GLOW))
elements.property(notmolten, "HighTemperature", 400.0)
elements.property(notmolten, "HighTemperatureTransition", molten)
-- :{)
It is another element in my code. I'm not a bloody idiot.
Thanks.
EDIT: Well, the transition to MPLA to PLAS does work, but PLAS does not melt.
Your transition code should look like this:
elements.property(elements.NOBODY_PT_PLAS, "HighTemperatureTransition", elements.NOBODY_PT_MPLA)
Well, still the same. MPLA hardens, but PLAS does not melt. Here is my code:
local plastic = elements.allocate("NOBODY", "PLAS")
I'm making PLAS like COAL and MPLA like MWAX to make things easier, I tweak almost every property. The point is, if I set PLAS to WAX,it does melt, but it just keeps melting into bloody MWAX!
elements.element(elements.NOBODY_PT_PLAS, elements.element(elements.DEFAULT_PT_COAL))
(All the other properties, not important...)
elements.property(elements.NOBODY_PT_PLAS, "HighTemperature", 400.0)
elements.property(elements.NOBODY_PT_PLAS, "HighTemperatureTransition", elements.NOBODY_PT_MPLA)
local molten = elements.allocate("NOBODY", "MPLA")
elements.element(elements.NOBODY_PT_MPLA, elements.element(elements.DEFAULT_PT_MWAX))
(All the other properties, not important...)
elements.property(elements.NOBODY_PT_MPLA, "LowTemperature", 380.0)
elements.property(elements.NOBODY_PT_MPLA, "LowTemperatureTransition", elements.NOBODY_PT_PLAS)
The freezing point for MPLA is lower than the melting point for PLAS.
EDIT: Also, try changing the property line from MWAX to something else. Also, change it from WAX to something else.
I thought it should be like that. whatever. I'll try.
Interestingly, I just did some testing, and it turns out that you might have to not define it using properties from an existing element. The problem is that if you were to change the property definition to METL for example, it will melt at the temperature that you specified, but it will NOT melt into the element that you specified. In the example of using METL's properties, your element will melt into the LAVA element at whatever temperature you specified.
elements.property(elements.NOBODY_PT_PLAS, "HighTemperatureTransition", elements.NOBODY_PT_MPLA)
local molten = elements.allocate("NOBODY", "MPLA")
Try allocating all elements before using them in element property values. For example:
local plastic = elements.allocate("NOBODY", "PLAS")
local molten = elements.allocate("NOBODY", "MPLA")
elements.element(elements.NOBODY_PT_PLAS, elements.element(elements.DEFAULT_PT_COAL))
elements.property(elements.NOBODY_PT_PLAS, "Name", "PLAS")
elements.property(elements.NOBODY_PT_PLAS, "HighTemperature", 400.0)
elements.property(elements.NOBODY_PT_PLAS, "HighTemperatureTransition", elements.NOBODY_PT_MPLA)
elements.element(elements.NOBODY_PT_MPLA, elements.element(elements.DEFAULT_PT_MWAX))
elements.property(elements.NOBODY_PT_MPLA, "Name", "MPLA")
elements.property(elements.NOBODY_PT_MPLA, "LowTemperature", 380.0)
elements.property(elements.NOBODY_PT_MPLA, "LowTemperatureTransition", elements.NOBODY_PT_PLAS)
Some sort of error message in situations like this would be helpful though.