#Jurgy's fake character pathfinding
1 messages · Page 1 of 1 (latest)
i am very curious to that pathfinding code as-is, never really dove into the depths of how transport drones does it, but having access to a mod at this barebones stage might be helpful learning material 👀
It uses the built-in pathfinding
the_worker.set_command {
type = defines.command.go_to_location,
destination = position,
radius = 1,
distraction= defines.distraction.none,
pathfind_flags = {prefer_straight_paths = true, use_cache = true, allow_paths_through_own_entities = true}
}
And the worker's collision_mask is set such that it collides with almost everything except with the tiles he's walking on
local worker_mask =
{
"ground-tile",
"water-tile",
"resource-layer",
"doodad-layer",
"floor-layer",
"item-layer",
"ghost-layer",
"object-layer",
--"player-layer",
--"train-layer",
"rail-layer",
"transport-belt-layer"
}
I like how you can tell it's still a unit cause it moves exactly like a biter lol
yeah, I wish I could tell it to overshoot less
you can probably set the movement speed to be a little lower
you can also call the pathfinder directly and set the character's walking state to get to the next node, but that's way more complicated
Can you point me in the right direction for that?