Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetPathNodesInRadius and GetPathNodesInRect are not working correctly. #182

Open
Vitalik-01 opened this issue Nov 8, 2022 · 0 comments
Open

Comments

@Vitalik-01
Copy link

I have been testing under the following conditions:
The activator is installed in the center of the cell (AnvilWorld location), with a large number of nodes of the path grid.
The following script is attached to the activator:

ScriptName TTesTT
Float СenterX
Float СenterY
Float Radius
Array_var ListNodes
Array_var	Iterator
Int Adapter

Begin OnActivate
	Let СenterX := GetPos X
	Let СenterY := GetPos Y
	Let Radiys := ****
	Let ListNodes := ar_Construct Array
	Let ListNodes := ar_Construct Array
	Let ListNodes := GetPathNodesInRadius СenterX СenterY Radiys

	ar_Dump ListNodes

	ForEach Iterator <- ListNodes
		Let Adapter := Iterator["value"]
		SetPathNodeDisabled Adapter 1
	Loop
End

After activation, the following result is obtained:

  1. If the radius is less than 2000, it does not detect more than one node. In a rare case, 1 - 2 nodes in the neighboring cell.
  2. If a radius greater than 2000 is specified, it detects nodes located not around the specified radius, but in the form of a polyline shape. In cells with an activator, the detected nodes may be absent or present at the edge of the cell.
  3. The location and number of nodes found does not change when the activator is reused. The result is constant.
  4. Using GetPathNodesInRect leads to a similar result.

I am creating an artificial path network for fish and the real path network periodically interferes with the AI package. For the normal operation of the plugin, it is necessary to make the fish completely ignore the real path grid. The best solution is a new OBSE function, similar to SetAllReachable, which disables pathfinding not for all actors, but only for the specified ones (Ref.SetAllReachable 1). Perhaps there is a way to disable pathfinding for a specific actor that I do not know about. Therefore, I will be glad of any help or advice with this plugin.

@Vitalik-01 Vitalik-01 changed the title GetPathNodesInRadius and Get Path Nodes In Rect are not working correctly. GetPathNodesInRadius and GetPathNodesInRect are not working correctly. Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant