Community Forum

Display silo fill level

Forum Overview >> Farming Simulator 2009

CategoryFarming Simulator 2009
Created21.07.2009 23:32


Christian S (Unknown) 21.07.2009 23:36
Hi,

I want to display the Level of the Farm Silo in the PDA

Is there a List where i can Add the Values, or is there any other way

Best Regards

C.Schoch

Stefan Geiger - GIANTS Software 23.07.2009 09:07
There is no such array.
However you can do your own rendering using the mission listener interface (see sample mod).

if g_currentMission.showPDA and g_currentMission.screen == 4 then
-- render silo content value
local value = Utils.getNoNil(g_currentMission.farmSiloFruitAmount[FruitUtil.FRUITTYPE_YOUR_FRUIT_TYPE],0))
--renderText(x,y,g_currentMission.pdaFontSize, value)
end


x and y you need to replace by the coordinates that match your position.

Using this technique, however it is not compatible with any other mod that does exactly the same as you. If you release a mod using this code, please note this down in the readme.

Michael Pillkahn (Unknown) 23.07.2009 13:09
x & y are values between 0 and 1, eg 0.5 start on center

Christian S (Unknown) 23.07.2009 22:19
Hi,
Thanks a lot

[quote]Using this technique, however it is not compatible with any other mod that does exactly the same as you. If you release a mod using this code, please note this down in the readme.[/quote]

Maybe I'll supply a specialisation to fix this problem

Best Regards

C.Schoch

Tibor Gy (Unknown) 24.07.2009 13:55
hi
this don't work for me..
Christian S please copy your script here
thx

Tibor Gy (Unknown) 24.07.2009 16:37
Error message from game.log (log.txt):
Error running lua function: update
.... attempt to index field 'farmSiloFruitAmount' (a nil value)

Tibor Gy (Unknown) 25.07.2009 18:50
see this picture, what is wrong?
http://game-zone.hu/ls2009/farmsilofruitamount.jpg

Christian S (Unknown) 31.07.2009 18:04
Hi,

I have done it like that

local value = Utils.getNoNil(g_currentMission.missionStats.farmSiloFruitAmount[FruitUtil.FRUITTYPE_YOUR_FRUIT_TYPE] , 0);
renderText(0.046, 0.226, g_currentMission.missionStats.pdaFontSize, tostring(value));

Still not happy with it because there is no space left in the PDA screen

Best Regards

C.Schoch

Honza Sebestu (Unknown) 02.08.2009 01:18
What is his name file, where it can edit ?

Where Shall I this insert??? ?
local value = Utils.getNoNil(g_currentMission.missionStats.farmSiloFruitAmount[FruitUtil.FRUITTYPE_YOUR_FRUIT_TYPE] , 0);
renderText(0.046, 0.226, g_currentMission.missionStats.pdaFontSize, tostring(value));



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