Community Forum

How get a value from BGA Extension Mod

Forum Overview >> Farming Simulator 17

CategoryFarming Simulator 17
Created29.08.2018 18:29


Bio Medical Extetion (Unknown) 29.08.2018 18:29
Hi,

I need to get a value from a specific mod named "BGA Extension " from my own mod script

This is BGA Extension link: https://www.modhoster.com/mods/bga-extension

In particolary, i need to extract the current value of "printPower" variable

Thx for the reply ...

Bilbo Beutlin (BBeutlin) 30.08.2018 00:27
I don't know the mod, but where is the problem? Examine the mod's LUA(s), search for the wanted variable.
At best you look where it is initialized, the first time used. Very often in a load..() function or even in the base code (outside the functions)..

If it is a variable global to the mod, you can access immediately "modName.variableName" where the "modName" is the initializing "modName = {}" at the beginning.

If the mod has multiple instances (like eg. vehicles, triggers) it becomes difficult. If you're lucky, you know the right instance pointer, let's say "abc" and you can use "abc.variableName".
Else you must search a table with the instances to get a dedicated pointer. You may browse the table with
----------
for _,abc in pairs(tableBase) do
-- examine abc, abc.variableName or debug print
end
----------

Good luck.


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