Download

AIMoveTo aborting before succes, need help.

Hey Folks,

I made this “game” where you start with a castle.
On start castle spawns a unit.
Said unit is now controlled by AI and does the following.

AIState
IsHomeless
[INDENT]FindExistingHome[/INDENT]
[INDENT][INDENT]GetRandomLocation[/INDENT][/INDENT]
[INDENT][INDENT]MoveTo WORKS[/INDENT][/INDENT]
[INDENT][INDENT]FindHousing[/INDENT][/INDENT]
[INDENT]BuildShack[/INDENT]
[INDENT][INDENT]GetRandomLocation[/INDENT][/INDENT]
[INDENT][INDENT]MoveTo WORKS[/INDENT][/INDENT]
[INDENT][INDENT]BuildHouse[/INDENT][/INDENT]
IsUnemployed
[INDENT]CheckhouseReferenceSet[/INDENT]
[INDENT][INDENT]MoveTo WORKS[/INDENT][/INDENT]
[INDENT]CheckCastleReferenceSet[/INDENT]
[INDENT][INDENT]MoveTo WORKS[/INDENT][/INDENT]
[INDENT]CheckForEmployment[/INDENT]
IsWorking
[INDENT]IsConstructionWorker[/INDENT]
[INDENT][INDENT]IsNotAtOffice(sequence)[/INDENT][/INDENT]
[INDENT][INDENT][INDENT]MoveTo ABORTS due to AssignWorkerJob[/INDENT][/INDENT][/INDENT]
[INDENT][INDENT]IsAtOffice[/INDENT][/INDENT]
[INDENT][INDENT][INDENT]AssignWorkerJob[/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT][INDENT]MoveTo ABORTS due to IsNotAtOffice[/INDENT][/INDENT][/INDENT][/INDENT]

The task MoveTo is multifunctional and its the same one being used every time

For some reason the AI doesnt finish the sequence, for clarity, it initiates the AIMoveTo, aborts a split second later and moves on with the tree.
So the moment the NPC starts walking to his job location, well a split second later, the AI fires IsNotAtOffice- A split second later it fires AssignWorkerJob etc etc etc.
The only way I can get anything built now is if I place it directly in front of the castle entrance.

Any Ideas?

PS


Picture of the IsConstructionWorker part

Found the culprit.
For some reason SetPauseHandle wasn’t connected, causing AssignWorkerConstructionJob to loop or something.

I was going to mention that it sounds like they are constantly changing their minds on what it is they want to do.