Community Forum

[functions] difference update/get Fruit

Forum Overview >> Scripting

Created24.08.2011 10:05

Jack Mcneill (Unknown) 24.08.2011 10:10
Hi everyone,
I'm working on a windrower and I'm trying to resolve some issue about killing grass (re-grow is disabled just on a edge line of the windrowing area).
I'm updating the lua file for the functions "Utils.updateFruitCutLongArea(...)" with attributes force="true", delete="false".

There are two pieces of code where:
local area = Utils.updateFruitCutLongArea(fruitType, x, z, x1, z1, x2, z2, 0);
area = area + Utils.updateFruitWindrowArea(fruitType, x, z, x1, z1, x2, z2, 0)*ratio;

What is the difference of using "Utils.update*" wrt the "Utils.get*"?

Stefan Geiger - GIANTS Software 25.08.2011 09:52
update* does change the area, whereas get* only returns the summed values in the area.
update* however also returns the summed values before the update.
So you normally don't need to call get* and then update* afterwards, unless you want to change the parameters to the update call based on the values in the area.

Note: Log in to post. Create a new account here.