Community Forum

Missing parameter on BaleUtil:getBale

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created07.03.2016 20:23


Clemens Klug (agp8x) 07.03.2016 20:34
Hi,
I want to create Bales of a non-windrow filltype (chaff). I have a custom specialization which worked in fs13, and for fs15 I have overwritten the BaleUtil:getBale function to bypass the windrow-check. This led to some very strange behaviour, so I added extensive printouts, which uncovered a shifting of the arguments between the calling and the receiveing code:

SiloBaler:createBale(): --call getBale()
BaleUtil:getBale(9, 1.2, 0.9, 2.4, 1.8, false)
BaleUtil:getBale(): --received
BaleUtil:getBale(1.2, 0.9, 2.4, 1.8, false, nil)

The calling code is basically line 707 from the Scriptdocumentation of the Baler class.
My overwriting code is here: https://gist.github.com/agp8x/bb23b3b486a6c9177f23

What am I missing?

Emil Drefers (Unknown) 08.03.2016 07:43
Hi,

BaleUtil.getBale(...)
VS
BaleUtil:getBale(...)

The first one expects to get 'self' as an argument.
The latter expects 'self' to be the object which is used to call the function.

Just use '.' in this case and all should be good ;)

Cheers,
Emil



Clemens Klug (agp8x) 08.03.2016 11:27
Well, that was easy :)

Thanks alot,
Clemens


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