Closed racingcow closed 10 years ago
In the spawnSettings, set the preyName
property to the name of the entity you want the creatures to move to after spawning. Make sure the creatures either have infinite reaction and search distance or they spawn within their search distance range to the final move to target. Creatures manage their own movement via wander, prey, and predator, so trying to use move to directly doesn't work so well (yet). Spawners also don't account for creatures in the spawn and move to setup (yet), as it was originally intended for non dynamic entities when I added it.
Setting the preyName
works great. They now move to the entity to which it is set. Thanks, @collinhover!
Hello,
I have created a generic
SpawnerCharacterLibraried
module, very similar to the one used in the supercollider demo, to use to generically create various spawners in Weltmeister. I have it set up to spawn at a void entity at a location underneath it. Everything works fine, and the spawner creates entities of the specified type at the void entity as it should.Now, after they spawn, I want the entities walk from the spawn point to another void entity. Here is a screenshot of what I have in the editor...
...and here are the properties set on the
spawner1
spawner in the editor...The entities all spawn, but don't move to the second target afterward. When debugging, I noticed that they start wandering immediately, which seemed to prevent them from moving to the second target (
canWanderX
/canWanderY
were set on the spawned entities). To try and override that, I added the following settings tospawner1
...Still no luck. The entities would spawn at the first target, but then stay there. After stepping through the code some more, I verified that the creature was no longer trying to wander, and
spawner.spawnNext
is definitely callingmoveTo
and passing in the entities in thetargets
map.entity.moveTo
sets the entity'smovingTo
property to the first target in the map, and returnstrue
, making the entity move to it.After that, however, it seems to stop without trying to move to the second target, and I'm not sure why.
Is there something I need to do differently to get the entity to move the second target after being spawned?
Thanks in advance for any help that you might be able to give and, as always, thanks for the great library!