Community Forum

Using tipToGroundAroundLine to create a Heap without vehicle?

Forum Overview >> Scripting

CategoryScripting
Created15.12.2016 22:54


It's Me (Vortas) 15.12.2016 22:54
Hi,

I am thinking about a way to create dynamic heaps anywhere out of a script. As far as I have seen in documentation all tipUtil functions don't need a vehicle when called. Except tipToGroundAroundLine.

I guess the manure heaps are using the same function to create it on the position set by transform groups. So what do I need to do to create a heap somewhere?

Creating a fake vehicle? Which values have to be in the table so tipToGroundAroundLine is working? Or is there a second not documented funktion?

Thanks for your help.




EDIT: Ok more questions.

Argument lineOffset and return value lineOffset. What is their actual meaning? Highest point of the heap?

limitToLineHeight == true means when ey is reached the tipping is stopped and dropped is adjusted when sy is reached negative adding ( removing ) stops and dropped is adjusted, too? ey is is maximum height and sy is minimum height?


It's Me (Vortas) 17.12.2016 12:39
Ok found it out myself... I managed to create heaps. But I got troubles finding out how the line offset and the inner radius are influencing the heap. Looking into shovel or other classes doesn't really give me an answer. Neither does testing...

I managed to tip amount X to the ground at given coordinate set. Managed to control the height by Y. Managed to control the radius of the heap by radius ( within the given material settings like angle and so on).

I thought inner radius does influence the tip of the heap. But none of my testet settings did anything at all.

I thought line offset does control the with of tipping along a line. ( for example like the shovel does ). but all the time my heap is growing only at given coordinate set. Even when start and end coordinates form a long line.

Wish you would have documented the arguments better Giants.



Fabio Celsa (fcelsa) 19.12.2016 19:22
Ask you please, how you solved the problem of Vehicle are nil?
I'm working to this problem from a long time...
Thanks.


It's Me (Vortas) 19.12.2016 20:04
Well... In principle it's so simple... Had to bite my ass after trying it finally.

Just create an instance of the vehicle class with new. *shrugs* Worked for me.

My fabrikscript version is producing dynamic heaps for a while now. Even reading back the actual fill level and correcting used ressources and using actual heap fill level.

Fabio Celsa (fcelsa) 19.12.2016 23:30
Thanks for your reply, I went in this direction as you described, but always got same error:

"
Error: Running LUA method 'update'.
dataS/scripts/utils/TipUtil.lua(515) : attempt to compare number with nil
"

I have done something like this:
local self = Vehicle:new(isServer, isClient, mt);
and other related things...

maybe it wrong direction for my mod...

if you want, I can explain my idea with details via email, you can find me fabio dot celsa at gmail dot com




It's Me (Vortas) 20.12.2016 02:58
I will send you a mail. Easier than discussing in public.


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