Ok i am trying to make a new liquid but everytime i go to run it I keep getting that "then expected near "="
this is what I have
tpt.el.watr.name="MGLQ"
tpt.el.watr.temp=255
function heat()
if tpt.get_property(temp)=256 then
tpt.set_property (temp 0 watr)
Positive comments only I am new at lua.
same here but i think the lines after "function heat()" are wrong.well i know scripting elements in such a way i can give you correct code if you can give me properties you want.
if tpt.get_property (temp) == 256 then
Here is the fixed code*
---------------------------------------------------------------------------
tpt.el.eqve.name="TEST" --Giving it a name
tpt.el.eqve.enabled=1
tpt.el.eqve.menu=1
tpt.el.eqve.menusection=10 --adding it to the menusection "Specials"
tpt.el.eqve.heat=255 --setting its starting heat
tpt.el.eqve.gravity=2 --gravity
tpt.el.eqve.falldown=2 --state of matter (Liquid)
function Heat_Loop()
if tpt.get_property("temp","eqve") == 256
then do
tpt.set_property("temp",0"eqve")
end
end
end
end
tpt.register_step(Heat_Loop)
------------------------------------------------------------------
this should work but it doesnt. It doesnt even rename the element.
By the way you had many things wrong to start off with. (Not to be negative, im a noob too. i started the day before yesterday.)
here are the basic mistakes you made:
----------------------------------------------
tpt.el.watr.name="MGLQ" --i changed this to make sure that the name wasnt the problem.
tpt.el.watr.temp=255 --there is no property called temp. use tpt.el.watr.heat=255
function heat() --always use correct indentation.
if tpt.get_property(temp)=256 then --here it should be in more lines. and = should be ==. Like so:
if tpt.get_property("temp","watr")
then --im not sure if you should use then or then do here.
tpt.set_property (temp 0 watr) --right here it should be tpt.set_property("temp",0,"watr")
end --you forgot to write end to end the "then" and the functionand "if"
end
tpt.register_step(heat) --this will make the function run every frame, otherwise it runs only once.
---------------------------------------------
~Vertigo