I'd check up on the API for TPT. It's simple to do heat/pressure changes, just do:
elements.property(elements.A_PT_EL1, 'X', elements.A_PT_EL2)
and replace X with either
LowTemperatureTransition -- At low temperature change to this element
HighTemperatureTransition -- At high temperature change to this element
LowPressureTransition -- " ", pressure
HighPressureTransition -- " ", pressure high
I'm assuming you know what to change A_PT_EL1 and A_PT_EL2 for.
EDIT: Use
elements.property(elements.A_PT_EL1, 'LowTemperature', '123.4')
to define what the low/high temp/pressure is.
For reactions between different elements, you'll need to set the update() function.
You need to create a lua function specifying which elements, in which conditions and such.
Then you set the "Update" property of your element like:
elements.property(elements.YOUR_ELEMENT, "Update", your_update_function)
For example, my update function for chlorine + hydrogen -> hydrogen chloride:
The function checks the immediate surroundings of the particle, and if HYGN is found, it reacts.
The chance check is to control the overall reaction speed.
When 89.3 comes and sim.neighbors() and sim.partID() are fixed, the code will be smaller and more clear.
jacob1:
@Faerindel (View Post)
actually, instead of 89.3 it was just a re-release of 89.2 with all the bugfixes, so everything works properly now.
Awesome! Already tested sim.neighbors(), and it's faster than using the two for loops.
For some reason, sim.partProperty() is noticeably slower than tpt.get_property() though.