Posted: Mon Jun 10, 2019 4:22 am Post subject:
Experimenting with scripted map units...
Subject description: (problem with helicopters)
So let me begin by saying I have several maps with planes flying through, in all cases they are [AircraftTypes] and Spawned=yes, however I decided to try doing the same with helicopters and it just doesn't work. This then leads me to try alternate moves, and later debugging with aircraft again.
1. A Landable=yes helicopter using "move to waypoint" will arrive and attempt to repeatedly land without succeeding, despite having room to do so on land. When the waypoint is outside the visible edge of the map, the helicopter tried to land within the visible limit, but in any case, it does not proceed to "finish" and will not disappear.
2. The same helicopter told to move to a series of waypoints, the first one being on water, results in arriving and endlessly hovering, never going to the next waypoint.
3. Using "patrol to waypoint" gets the helicopter to land at a land based first waypoint, but once arriving at the final waypoint, it repeats the attempting to land failure in #1, thus never completing the script.
4. Observing this odd behaviour, I repeated #2 with spawned aircraft, where I get endless circling as seen in the pic attached. I had figured that since they couldn't land they would pass over the waypoint and move to the next, but this doesn't happen, and can't complete the script.
Is there a workable way to have helicopters do a realistic patrol that I've missed?
I realize that the paradrop planes are given an order to do an operation at a point, but once complete they are allowed to freely leave the map as all spawned aircraft do automatically, so there is no such confusion about multiple waypoint moves.
As an aside I also see how the circling aircraft issue could be used to make a flock of voxel birds circle like vultures over a spot hah!
BalloonHover makes it possible to reach the waypoints for jumpjet units. Otherwise, in general, a unit is supposed to be within 1 cell distance to complete the waypoint reaching script actions. QUICK_EDIT
I guess landing isn’t part of the move command. So when it finishes the move command and arrives the waypoint it’s still in air, check fails, then it starts to land. QUICK_EDIT
I tried another experiment with a bus. I gave it MovementRestrictedTo=Road, and it drove to the first waypoint (on road) where it stopped as if it had completed its mission.
Shooting at it made it move to another cell, but still didn't progress to the next waypoint.
yep that happens when a unit cant complete a script action it just sort of dies. most common culprit in working scripts is
a fault in the pathfinding. lat tile errors most especially. trains are also super finicky and id wager whatever your trying to do with
momevementrestrictedto= is going to be a massive nuisance to script. _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
This was a city map with tons of road, and all the waypoints are on the roads. The first thing I thought about was that not all the road tiles have the right type set, especially the crosswalks, but I checked and they all do. Pathfinding should not have been a problem.
EDIT: I should clarify, dirt road tiles are typically 12, paved road is 11, my crosswalks were 12, as are the island medians for trees. I tried both 11 and 12 for these other bits and it didn't make a difference. The bus drove along the paved road happily, but stopped at the first waypoint in all cases. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai Last edited by G-E on Sun Jun 23, 2019 3:07 am; edited 1 time in total QUICK_EDIT
I think you're missing the point here, if I remove MovementRestrictedTo=Road, it drives along the road, turns the corners on the road, and completes just fine. Only when the tag is present does it stop, so I fail to see how angle applies here. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
Use more than 1 waypoint on the turns, so that there is wide angle and possibly it is in the line of sight on the same terrain. Movement restricted flag does that. QUICK_EDIT
trains will break if you even try and get them to make sharp turns. its an unspoken rule that every 'turn' in the track be several cells long.
also consider playing with a player owned unit for debugging. _________________ visit my moddb profile for .shp downloads and stuff QUICK_EDIT
What's the width of your road?
If 2 adjacent vertical/horizontal cells only touch with a corner, MovementRestrictedTo pathfinding may break.
Make sure adjacent cells share an edge.
Pathfinding for horizontal/vertical adjacent cells works only with Land=Railroad.
Do you tried placing 2 waypoints very close to each other? Does the unit then still stop at the first?
A screenshot may also help. _________________ SHP Artist of Twisted Insurrection: Nod buildings
What's the width of your road?
If 2 adjacent vertical/horizontal cells only touch with a corner, MovementRestrictedTo pathfinding may break.
Make sure adjacent cells share an edge.
Standard 3-wide paved road. See image.
Lin Kuei Ominae wrote:
Pathfinding for horizontal/vertical adjacent cells works only with Land=Railroad.
By this you mean off-grid axis moves, but I'm not sure in what context this applies? The roads have plenty of cells to move purely along the normal cell axis?
Lin Kuei Ominae wrote:
Do you tried placing 2 waypoints very close to each other? Does the unit then still stop at the first?
I have tried moving the next waypoint, but not closer than 10 cells, and along the same road, so I only changed the theoretical turn angle.
In this case, no clue why they can't plot a path around a corner.
I would try what happens if there are impassable overlays at the corners next to the road. Maybe the pathfinding has issues since the clear ground cells next to the road are passable too.
You could also try creating a wall type overlay with Land=Road. Then place this on clear ground tiles (not roads) and see if a unit can follow this overlay better around corners.
Maybe MovementRestrictedTo works better when driving on overlays than on terrain tiles.
@E1: placing that many waypoints counters the benefit of restricted movement, which in theory doesn't need one at each corner, but only at the bus stops. _________________ SHP Artist of Twisted Insurrection: Nod buildings
In this case, no clue why they can't plot a path around a corner.
I would try what happens if there are impassable overlays at the corners next to the road. Maybe the pathfinding has issues since the clear ground cells next to the road are passable too.
At each corner the traffic lights stop movement onto the sidewalk tile for the turn, so even without restriction, it has to turn onto road.
Lin Kuei Ominae wrote:
You could also try creating a wall type overlay with Land=Road. Then place this on clear ground tiles (not roads) and see if a unit can follow this overlay better around corners.
Maybe MovementRestrictedTo works better when driving on overlays than on terrain tiles.
While this is possible, that a single line path might cure the pathfinding, the effect on building space would negate its utility.
Lin Kuei Ominae wrote:
@E1: placing that many waypoints counters the benefit of restricted movement, which in theory doesn't need one at each corner, but only at the bus stops.
Exactly, the only purpose here was to mimic normal bus stops, without allowing it to traverse onto sidewalks or go offroading the moment there's an obstruction. I would have no qualms with the bus stopping if the road section was impassable, but a gazillion waypoints are just not worth it. _________________ http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum