Community Forum

Get information from market?

Forum Overview >> Scripting

CategoryScripting
Created13.11.2016 02:41


Zane Gna (Unknown) 13.11.2016 02:43
Is there a way to get current grain pricing from the market?


Sámson Bence (Unknown) 13.11.2016 15:42
I literally just started looking for the same thing a few hours ago and the closest I could find is this: https://gdn.giants-software.com/documentation_scripting.php?version=script&category=67&class=2144#getEffectiveFillTypePrice29692

I haven't done anything with lua or farming simulator before though so I have no idea how to actually call that function or if it's the one I want at all. Probably pretty simple, but I am absolutely new.

Zggtf211 (Unknown) 14.11.2016 04:15
I'm new too! lol!

Hopefully someone will be able to point us in the right direction


Sámson Bence (Unknown) 14.11.2016 19:04
Okay, so I have been what feels like banging my head against a wall for hours upon hours (but it's alright, I learned some stuff), here's the useful stuffs I learned:

You can use DebugUtil.printTableRecursively(g_currentMission.tipTriggers, "--" , 0, 1); to get information about tip triggers or any tables in the game.

TipTrigger https://gdn.giants-software.com/documentation_scripting.php?version=script&category=67&class=2144 is the one we need here.

map01.xml (for goldcrest) also helps somewhat with tipTriggers.
After reading through and understanding the above things I think I have a good grasp on things, but I am obviously missing something important and probably very simple.

Now you should be able the get values out by doing something like this:
g_currentMission.tipTriggers???.fillTypePrices[FillUtil.FILLTYPE_WHEAT]

I don't know how to index it properly (hence the ???), I have tried many things some logical, some stupid, but most of the time I get the error "attempt to index a nil value". I am stuck at this point.

I have to admit though, the severe lack of proper documentation doesn't help. But I guess they will fill out the gaps seeing how fs15 is now.

Tykonket (Unknown) 18.11.2016 17:57
This should be the final solution:
FillUtil.fillTypeIndexToDesc[fillType].pricePerLiter

You can even use printTableRecursively and try to find something in the "EconomyManager" object.
Let me know if you need something else.


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