Looking for someone to build a plugin that will allow Workcarts to move on their own and stop at points created by the admin for X amount of seconds before continuing on to the next Stop Point.
Workcart Stopping Stations
Do you have any particular reason for wanting to specify the Stop Points, or do you just assume that is easier than having the plugin automatically figure out the Stop Points? One problem with arbitrary Stop Points, such as those determined by an admin, is that the workcarts may sometimes collide at intersections and get stuck, unless the routes were all carefully made to be independent, or if potentially tricky and performance heavy logic were added to avoid the collisions on the fly.
Would it be a sufficient implementation if the workcarts had predetermined logic that caused them to go into particular loops automatically, covering most of the map, and avoiding all intersection collisions?
Is this intended for procedural maps, custom maps, or both?
It is for a custom map with an unobstructed train track with a single Workcart. I would like to create Train Stop prefabs and insert a Stop Point so that the Workcart stops at those train stops.
How would you like the workcart to come to a stop? By simply turning off its engine when hitting the trigger and then stopping some distance later? Or would you like it to be more time efficient, by braking to slow down as fast as possible?
Do these train stops have a visible entrance and exit like the vanilla ones, or is it like just a very small spot you want the train to stop at? If it's a full station, would you like the train to slow down as it enters the station, come to a stop somewhere in the middle, and then speed up as it leaves?
Would you like the workcart to go low, medium or high speed most of the time? Or do you have a mod adjusting the speed?
I think all of that should be in the config, but I think just cutting power would be pretty useful. No need to come to an abrupt stop.
As for the speed of the workcart, it should be set in the config by the admin.
The reason I ask about speed is that, although ideally it's all configurable, I have already implemented most of this plugin for procedural maps, but haven't worked in configurable speed yet, as it requires predicting where to turn off the engine, when to brake, and how long to brake, so was wondering how important that was.
WhiteThunder
The reason I ask about speed is that, although ideally it's all configurable, I have already implemented most of this plugin for procedural mapd, but haven't worked in adjustable speed yet, so was wondering how important that was.
Honestly, if I had to choose a speed, it would be Low. Perfect world; adjustable in the config.
Merged post
So, is that something you can do or.............?
Yes, I will modify my existing plugin for this use case when I have time. Hopefully I will have time next weekend, but possibly later. You can get someone else to build this, but my plugin will eventually support this anyway, and will be available for free (as are all my plugins).
WhiteThunder
Yes, I will modify my existing plugin for this use case when I have time. Hopefully I will have time next weekend, but possibly later. You can get someone else to build this, but my plugin will eventually support this anyway, and will be available for free (as are all my plugins).
I look foward to this one being done, i have above ground rail system on my custom map and this would be great to have!
I am working on this today. Do you folks have custom maps I could use to test? Will test with procedural maps for now.
Also wondering, would you require the ability to save different stop points for different maps?
Merged post
I made a lot of progress in the past 12 hours. You can beta test it now.
Documentation: https://github.com/WheteThunger/AutomatedWorkcarts
Direct file link: https://raw.githubusercontent.com/WheteThunger/AutomatedWorkcarts/master/AutomatedWorkcarts.cs (right-click and save-as)
To summarize how it works...
- Run the
aw.addtrigger <speed>command to add a trigger at the nearest train track with the specified speed. When a workcart enters that trigger, it will change its speed to that. Speeds are formatted just like they are in-game likeFwd_Hi,Zero, andRev_Hi. - Adding, updating or removing triggers automatically saves them into a data file at
data/AutomatedWorkcarts/{map_name}.json. This allows you to switch between maps without having to swap files. - You can also set track selection to get them turning left or right or whatever. However, I recommend you just specify it via the config, particularly using the default
Left, since that should avoid collisions.
some errors:
(18:38:58) | StackOverflowException: The requested operation caused a stack overflow.
(18:38:58) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:38:58) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:38:58) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:38:58) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:08) | StackOverflowException: The requested operation caused a stack overflow.
(18:39:08) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:08) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:17) | StackOverflowException: The requested operation caused a stack overflow.
(18:39:17) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:17) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:17) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:17) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:28) | StackOverflowException: The requested operation caused a stack overflow.
(18:39:28) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:28) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:37) | StackOverflowException: The requested operation caused a stack overflow.
(18:39:37) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:37) | GetTotalPushingForces: Recursive loop detected. Bailing out.
(18:39:37) | GetTotalPushingMass: Recursive loop detected. Bailing out.
(18:39:37) | GetTotalPushingForces: Recursive loop detected. Bailing out.
Those are from the workcarts colliding, likely all ending up in the same corner. I may need to add some safeguards such as not automating the workcarts if there are no train stations or custom triggers detected.
Merged post
I have made some updates based on Byza's feedback and further testing. Same download and documentation links as before.
- The plugin no longer automates all workcarts by default. Instead, you can either toggle on the
AutomateAllWorkcartsconfig option (off by default), or you can selectively toggle automation for specific workcarts withaw.togglewhile looking at or riding on them. - There is a new trigger option called
Start. If provided, any workcart that passes through (or spawns in) the trigger will start being automated. This allows you to only automate trains on certain loops for instance (i.e., above ground but not below ground) by simply placing these triggers where the workcarts will spawn. - Adding a trigger now finds the nearest track position based on where the player is aiming instead of based on the player positon.
- You can now move a trigger with
aw.movetrigger <id>to the track position where you are aiming.
@JackReigns how has the plugin been working for you? You haven't replied since I sent out the initial release.
I've rewritten most of the plugin since my update three weeks ago. It's difficult to summarize the changes, so I suggest giving a fresh read over the documentation. You will likely have to redo the triggers as most of the properties will have been reset. You should also delete the lang file.
im pretty happy with it.