Community Forum

LUA Access to price of sales stations

Forum Overview >> Scripting

Created22.03.2020 15:36

Paul Oberosler (pavll) 22.03.2020 15:36
Is it possible access the data where the prices at the sales stations are safed? If yes then can you please tell me how to do?

Bilbo Beutlin (BBeutlin) 22.03.2020 16:13
The selling stations appear in the table "g_currentMission.storageSystem.unloadingStations".
They can be idenfied by "{station}.isSellingPoint" - this is 'true' for selling stations.
There are several price tables, each ordered by fillTypeIndex, eg. "{station}.fillTypePrices[fillTypeIndex]".
I'd recommand to examine the station tables (eg. by DebugUtil.printTableRecursively), so you'll meet all price tables to choose the right one.

Paul Oberosler (pavll) 22.03.2020 17:03
Thank you, that helped.

tryingToCode 13.06.2020 15:05

I hope I can jump onto here.

I am new to lua and I just can't get the price of something returned.
I can get the tables out with DebugUtil ... but only until unloadingStations where I am getting a lot of tables and can't select a specific one in order to go deeper into the variables.

I am not able to select the {station} since I am always getting an error.

Can someone give me the whole line for requesting getting the price of a crop from a station or getting the information if the station isSellingPoint to a variable with which I then can work?

My plan is to make a small script which notifies me as soon as a price has reached a certain value.

Bilbo Beutlin (BBeutlin) 14.06.2020 20:55
Search for "fs19 console helper".
With this little utility you can examine FS data structures quite easily.

Furtheron you should improve your LUA knowledge. It's also quite easy to scan data tables like
for _,station in pairs(g_currentMission.storageSystem.unloadingStations) do
if station.isSellingPoint ~= nil and station.isSellingPoint == true then
- examine it

Brian Thompson (tommert) 30.07.2020 18:30

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