This would be awsome, ofcourse, If pvako is in the mood :)
I will vote for that one too! ;)
I've been thinking about that one for long time! :-)
Yeah cause whats the point for a tractor just chill there, most of the time just taking space for the convoy, would be nice if this option will be remembred as well in memory so it is reloaded :) ofcourse that is only if @Tensuko goes hard on @pvaiko :))) and gives him extr snicker bars :-)))
Since you cant simply park all tools, you also got to check if they still got fruit, or can a Combine even get sent to park with the cutter on ? The Idea is nice but don't take it as to simple :)
The Idea is nice but don't take it as to simple :)
When is simple nice?? pvaiko loves a challenge ;)
Thanks for taking it to the team
I'm not very familiar with AutoDrive, what exactly would CP need to do?
You can use AD to give every Vehicle a Parking Position (I think its an AD Target).
Then you can just click a button and AD drives the Vehicle to its Parking Position.
So CP would need an option to park Vehicle when work is done with AD Destination, so Pak on/off and give it over to AD, but also check on some tools if full (e.g. a Combine or trailed harvesters and so on).... at least I think that makes sence.
This wouldn't be too difficult, I just looked at the AD code.
You can use AD to give every Vehicle a Parking Position (I think its an AD Target).
Then you can just click a button and AD drives the Vehicle to its Parking Position.
So CP would need an option to park Vehicle when work is done with AD Destination, so Pak on/off and give it over to AD, but also check on some tools if full (e.g. a Combine or trailed harvesters and so on).... at least I think that makes sence.
Why check if there full ?
If the Combine or trailed harvester still got fruit inside its tank, you don't want it to be parked, becouse that will be the next Issue Report for sure... So empty with AD or CP or manual, THEN can drive to parking. Other way is not a good Idea.
But wouldn't you need som co-op from the AD team to get the external interface for "go to parking"-command?
And what would happen if a veichle does not have a parking dest. assigned?
But wouldn't you need som co-op from the AD team to get the external interface for "go to parking"-command?
And what would happen if a veichle does not have a parking dest. assigned?
Msg, no parking spot assigned ;)
@Martinnygaard don't think so as I can get the parking destination ID of the vehicle and either get a course from AD for that destination or let AD run that course, both interfaces already exist in AD, right @Stephan-S?
If the Combine or trailed harvester still got fruit inside its tank, you don't want it to be parked, becouse that will be the next Issue Report for sure... So empty with AD or CP or manual, THEN can drive to parking. Other way is not a good Idea.
Yeah @Tensuko if its combine and its not done until its unloaded, sometimes AD Comes or CP to unload it after it gets that last call to the drivers, then after all of that has finished Combine can park
In the newest Release you let empty a Combine before let him end the work
so there is only need a check if there are big workingtools that are not foldable
Yeah you can use the parking destination from AD and call the usual function.
I haven't created an Interface for the querying the parking destination yet though. So either use the variable directly or wait for an Interface Update
But this time, please add a nil check! Last Time you broke all older Versions of AD and especiallx the Modhub one by Not doing a nil check and of course everyone blamed AD
Blame AD is stupid when ppl not able to update their mods. Well it is not like we had no Issues with that and always said make sure you update AD....
@pvaiko use self.vehicle.ad.parkDestination :-)
@Stephan-S yes sir, will do, I apologize, need to familiarize myself to the thought that there are dependencies.
I'd obviously prefer an interface function over accessing the variable directly.
Alright. All good mate :-)
I will take care of the interface tomorrow.
Could you provide one for the last unload when CP has finished harvesting? Or is this also setting the waitingForUnload variable which AD currently checks?
@Stephan-S that's taken care of already, no new function needed, the old one will return true in that case as well. Backwards compatible :)
@Stephan-S yes, this improvement, I requested, that the harvester is unloading first before finishing the route, is already working fine.
This request here goes in this direction, I asked for AD, too.
If the last combine has done, AD is currently waiting on the field. And I asked you, if AD can drive to silo a last time for unloading.
@pvaiko Can you please tell me which state or variable to check if CP combine is finished with the work?
Then I can also trigger AD to drive to the unload destination after offloading the combine.
Thank you!
@Stephan-S is it possible, that you define it in AD as Last unload Trip?
So that AD will Not drive Back to the field again, but only stop at unload Destination.
@Stephan-S
self.state == self.states.ON_FIELDWORK_COURSE and
self.fieldworkState == self.states.UNLOAD_OR_REFILL_ON_FIELD and
self.fieldWorkUnloadOrRefillState == self.states.WAITING_FOR_UNLOAD_AFTER_COURSE_ENDED
Sou you probably want an interface function for it.
@Pvaiko this new state states.WAITING_FOR_UNLOAD_AFTER_COURSE_ENDED will appear only on something like combines right ?
@evansv2 Since it is defined in the CombineAIDriver class, yes.
@evansv2 Since it is defined in the CombineAIDriver class, yes.
Kind of neat how you guys did base classes on courseplay, basically cp.driver is always according to apropriate object initiated the driver base
Do we even have cp.driver left except from old Mode2 ? I think that is all AI Driver now or do I mix things up now ? :)
Do we even have cp.driver left except from old Mode2 ? I think that is all AI Driver now or do I mix things up now ? :)
Well when manually printing tables for the cp.driver , I see that the variables are from the apropriate object initiated, so I figured its loading the apropiate drivers, with the base been set as AIDriver
@Tensuko you may be mixing things up a bit, cp.driver is always derived from AIDriver and is the preferred way to do things.
The old mode 2 still uses the hopelessly unmaintainable drive.lua.
@pvaiko ok got it, thx. Another thing learned :)
Yeah talk about lua from c world, I'm used to c# managed world, where classes are classes, lua is neat, reminds me of mIRC scripting :))) so what you guys did with LUA and made it OOP is kind of unbelivable cool
@Tensuko you may be mixing things up a bit, cp.driver is always derived from AIDriver and is the preferred way to do things.
The old mode 2 still uses the hopelessly unmaintainable drive.lua.
I'm guessing AIDriver is here to stay for now, and driver.lua is from fs17 -fs 15 code era
@evansv2 folks use Lua as an object oriented language all over the place, it is not our idea, Giants does the same. It is painful though, coming from real OO languages...
I Wonder if anyone ever figured out how to get the information about the crops growth state, on any given field, because I see @Stephan-S asked this question on the GDN official forums, and looks like he didnt get a proper response for his last post, I was wondering maybe you guys would know, or maybe this function is only for the elites of the modding club , @pvaiko @Tensuko would you guys know?
You can look at my StoryMode mod where I used this info:
But we are getting a bit offtopic here, sorry guys
You can look at my StoryMode mod where I used this info:
But we are getting a bit offtopic here, sorry guys
@Stephan-S your a god, we must worship you lol thanks bro , I do appologize for been offtopic, but I've been sweating a little on this for over three days before posting, and getting a whipping
@Stephan-S take a look at https://github.com/Courseplay/courseplay/commit/80591279a9e6b9fd6eed6da434c0099a44a01473 please and let me know what's wrong with it, looks like to park the vehicle we need to do something different than StartDrivingWithPathFinder().
Works as expected :-)
I saw that you already check for parkDestionation ~= nil which is good.
Now it worked on my first attempt with an empty loading wagon I just started at the end of some course and it passed control to AutoDrive and sent him to the parking destination.
Now there could be 2 problems when you tried it:
I tried with a plow, don't know what the exit strategy setting was. But there's no guarantee the vehicle will be on a field when this is called, is that a problem?
Is there anything I can do to improve?
The field exit strategy is basically just the name for 'Pathfinder strategy'. So either plot a route to the closest point or to the selected target point.
Neither CP nor AD know for sure which destination would be the best suited target for the pathfinder. Wwe know that for other modes, such as Pickup & Deliver mode since there are two targets set. One is the field destination, which is a good target for the pathfinder usually and the other one is the destination he can then reach via the network.
So I don't really see what you or I could do to improve this. The only option would be to not only force the AD mode to 'Drive' but also to force the Field exit strategy to use the closest point since this is the only logical step here to take.
But there's no guarantee the vehicle will be on a field when this is called, is that a problem?
No, this is not a problem at all. He just has to be able to plan a pathfinder route to the closest point/destination
As far as I'm concerned this is done.
Most helpful comment
Msg, no parking spot assigned ;)