Would be really useful for mods with short production times for units to have units come out turned towards the rally point (use a straight line for that computation to keep it simple and considering the way the pathfinding works it might need using only the 8 cardinal directions, too).
EDIT: Would be useful to have a possiblefacings tag that's an 8-bit mask stating which directions the unit can face so factories with two or more exits can pick the closest one.
Factories turning the produced units towards the rally point
Moderator: Moderators
Just having units exit the factory in a predictable manner might be useful to prevent jammed units. I find units often start pathfinding right into nooks within the interior footmaps, then never seem able to exit. The next unit blocks their escape and you damn near have to end production altogether to fix the snarl.
- BlackLiger
- Posts: 1371
- Joined: 05 Oct 2004, 21:58
- BlackLiger
- Posts: 1371
- Joined: 05 Oct 2004, 21:58
It's extremely easy to make units always face the factory exit. Simply remove the "spin pad" command in the factory script.
A bit more complex, but still easy, the script can execute some "turn pad ..."; to change at will which way the produced units must face.
However I don't see any ways for factories to be informed of which direction if the waypoint. Not to mention that on a well populated map, the shortest path isn't a straight line (as the straight line is most often obstructed), and keep changing.
So that a mod with a very weird pentagonal factory is free to do:
To turn with a 72° increment.
But just to make it clear, yes that is the way I said I don't see, but I don't want such a new function, because waypoint can change while a unit is under construction, and the direction of the waypoint is not the direction one must go to reach it (since there's obstacle to avoid on the way).
So in short, ask the author of your favourite mods to remove every "spin pad" from their script, it should remove most of the "Units bump into factories wall" issues. And now tha
A bit more complex, but still easy, the script can execute some "turn pad ..."; to change at will which way the produced units must face.
However I don't see any ways for factories to be informed of which direction if the waypoint. Not to mention that on a well populated map, the shortest path isn't a straight line (as the straight line is most often obstructed), and keep changing.
Pff, don't go overboard with the tag inflation where it's not needed. Would be cleaner to pass the direction as an usual 16bit angle to a new script function, and have that function turn the pad, or turn it to closer exit depending on unit location. Something like:... it might need using only the 8 cardinal directions, too).
EDIT: Would be useful to have a possiblefacings tag that's an 8-bit mask stating which directions the unit can face so factories with two or more exits can pick the closest one.
Code: Select all
SetExitDirection(heading)
{
turn buildpad to y-axis heading speed <30>;
}
Code: Select all
SetExitDirection(heading)
{
turn buildpad to y-axis (heading/13107)*13107 now;
}
But just to make it clear, yes that is the way I said I don't see, but I don't want such a new function, because waypoint can change while a unit is under construction, and the direction of the waypoint is not the direction one must go to reach it (since there's obstacle to avoid on the way).
So in short, ask the author of your favourite mods to remove every "spin pad" from their script, it should remove most of the "Units bump into factories wall" issues. And now tha
You mean the new cob get/set constant, 73 UNIT_BUILD_PERCENT_LEFT basically BUILD_PERCENT_LEFT, but comes with a unit parameter, that we have had since 70b1?Dragon45 wrote:Something for the factory to get the health of the unit currently being built would be fine. Then just stop-rotate and turn to axis <0> would be perfect.
Asking for features that are already in isn't a good move!
But it doesn't work, because when there's 1% left, you don't know how long before it's done, not to mention ultra cheap unit might jump from 5% to ready without passing by 4,3,2,1, and when there's 0% left, it's too late the unit has left the pad already.
Not to mention that on a well populated map, the shortest path isn't a straight line (as the straight line is most often obstructed), and keep changing.
That's why you'd queue up multiple move orders, one to determine the exit and the rest to move where you want to. If a complete path finding solution can be done fast enough to not cause lag that'd be fine, too. I'm mostly thinking of completely open factories like Nanoblobz's Autofac and quick production speeds like most Nanoblobz units.
That's why you'd queue up multiple move orders, one to determine the exit and the rest to move where you want to. If a complete path finding solution can be done fast enough to not cause lag that'd be fine, too. I'm mostly thinking of completely open factories like Nanoblobz's Autofac and quick production speeds like most Nanoblobz units.
I just try to make sure that I point my factories at the most open area when I lay them down, and then set up a queued series of move orders for that entire factory. This way i know that my units will go where i want. If they get stuck on something, it's not hard to select the factory and set up a new move queue.
The thing that kills me is when one factory will refuse to follow the queue, and I keep getting the "Unable to reach destination" error when it's a clear shot on flat ground. it drives me nuts to keep having to come back and select a big circle of units to move them to the proper area, just to have new units get "stuck" in the same manner.
The thing that kills me is when one factory will refuse to follow the queue, and I keep getting the "Unable to reach destination" error when it's a clear shot on flat ground. it drives me nuts to keep having to come back and select a big circle of units to move them to the proper area, just to have new units get "stuck" in the same manner.