Author Topic: TPT Lua  (Read 520 times)

The Powder Toy's forum seems to be very very slow with answers in help, so I am coming to you guys.

How would this code look in lua? It is currently C++ I think.

Code: [Select]
HighTemperature = 625.0f;
HighTemperatureTransition = PT_FIRE;

It is suppose to make an element change to fire when it is at a high temp.

the powder toy has scripting now?

edit: was thinking of danball, sorry

Looks like it's just setting variables. Minus the 'f' on the first number, it'd be valid lua code.

HighTemperatureFahrenheit = 625
HighTemperatureTransition = PT_FIRE (what is this line for)

HighTemperatureFahrenheit = 625
HighTemperatureTransition = PT_FIRE (what is this line for)
The variable is called PT_FIRE in TPT. Idk why.

HighTemperatureTransition = PT_FIRE (what is this line for)
it's pretty obvious considering his description for it. it's the variable that decides what element it turns into when it reaches 625 degress. that is, fire

You just have just googled "lua variable declare syntax"


HighTemperatureFahrenheit = 625
is not the same as
HighTemperatureFahrenheit = 625.0f

one is an integer and the other is a float

also PT_FIRE might have been defined earlier. it also should be a float value as its assigned to another float variable

Floats and integers are one in the same as of Lua 5.2.

i see
that makes things easier i guess