fungus

Open full view…

How can I simplify this Lua?

academyoff
Tue, 19 Nov 2019 00:03:50 GMT

My game is rather complicated and I often need if statements w/ lots of variable checks. My solution is lua code like this: getvar(fieldFlowchart, "whatShouldIDoWhileImWaitingForTheseCropsToGrow").value = getvar(fieldFlowchart, "DayCropReady").value ~= -1 and (getvar(fieldFlowchart, "Day").value < getvar(fieldFlowchart, "DayCropReady").value) This assigns one variable (whatShouldIDoWhileImWaitingForTheseCropsToGrow) to check if a menu should show. How can I make this lua code more concise? I'm assuming I can make a function somewhere that I could call.