Community Forum

Function getDensityAtWorldPos

Forum Overview >> Scripting

CategoryScripting
Created24.06.2015 18:05


Bad Touch (Unknown) 24.06.2015 18:07
Would there be a chance, at some point, of having the source code for the getDensityAtWorldPos function?

Thanks in advance,
Alan

Emil Drefers (Unknown) 25.06.2015 07:41
Hi,

sorry to say, but no. (It's an engine function and we only publish LUA code - if at all ;) )

But I wonder what you would like to do with that?
Maybe there's another way to achieve what you wanna do.

Cheers,
Emil


Bad Touch (Unknown) 25.06.2015 17:45
Emil,
Thanks for your reply. In updating my Field Status mod for FS15, I discovered this function to help with my field scanning. It allowed me to detect the borders of fields with grass growing around them. For instance, if a certain field has grass growing on it, this function would return a value > 0. However, outside the field borders, even if there was grass growing, it would return 0. This is exactly what I needed for my scanning to work. The other functions, getDensityParallelogram, getDensityParallelogramArea, etc, would always return a value > 0 if grass was growing, whether it was on the field or outside the borders.

Then I started working on updating my mod for FS13 as well, but the getDensityAtWorldPos function doesn't exist in that version of the game. So that's what prompted my question.

Hopefully, you might have a suggestion to help me make this work for FS13.
Thank you,
Alan

Bad Touch (Unknown) 03.07.2015 23:43
Emil,

Would you know of a way I can get similar functionality in FS13 as I am getting with getDensityAtWorldPos() in FS15?

Thanks,
Alan

Emil Drefers (Unknown) 06.07.2015 07:52
Hi,

sorry to say, but currently I can't think of any other way.
But I'm gonna ask a colleague and see if he has an idea.

Cheers,
Emil


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