In 4.7 AAIController::MoveToActor() doesn’t really automatically updating its target position like it use to.
I’ve tested using AAIController::GetImmediateMoveDestination() and it seems to be updating once it reach the first target.
Wierd yet, after that my AI running back and forth between its original position and next points along its path.
Does someone know why the background of this changes : ‘bReplicateInstigator’ : undeclared identifier?
What happened to this behavior? Is it acting as True or false?
IOnlineFriends - Watch out, the function signature are not all the same. I mean, that some changed with passing a delegate to it to be called once it’s over, and the others still work in the old fashion.
FYI I raised a Answers question on this
It will help to understand where we are going in the future…
Quick question on TimerHandle.
If a TimerHandle has been set private (like Lifespan in Actor.h), I can’t reuse it. So if I set a new timerhandle variable in my class, then set a new timer on the same function. What will happen?
Do we have now 2 separate timer on the same function or is it behave like before so the timer is clear and set to the new value and we end with 2 timerhandle on the same timerdata?
It tried to read the cpp part, but I’m usure about the conclusion, I hope you will know
My opinion is that we end up with 2 separate timer as I didn’t see any code checking for the “inDelegate” to see if it is already set.
It throws the following errors that I’m currently trying to decipher…
1>D:\Users\stuart\Documents\Unreal Projects\FireFight\Source\FireFight\Private\FFWeaponAttachment.cpp(234): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'TIndexedContainerIterator<TArray<FImpactInfo,FDefaultAllocator>,FImpactInfo,int32>' (or there is no acceptable conversion)
1> D:\Program Files\Unreal Engine\4.7\Engine\Source\Runtime\Engine\Classes\Sound/DialogueWave.h(37): could be 'bool operator !=(const FDialogueContextMapping &,const FDialogueContextMapping &)'
1> D:\Program Files\Unreal Engine\4.7\Engine\Source\Runtime\Engine\Classes\Sound/DialogueTypes.h(57): or 'bool operator !=(const FDialogueContext &,const FDialogueContext &)'
1> D:\Program Files\Unreal Engine\4.7\Engine\Source\Runtime\Engine\Classes\Engine/StaticMesh.h(210): or 'bool operator !=(const FMeshSectionInfo &,const FMeshSectionInfo &)'
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\guiddef.h(197): or 'bool operator !=(const GUID &,const GUID &)'
1> D:\Program Files\Unreal Engine\4.7\Engine\Source\Runtime\Core\Public\Containers\Array.h(121): or 'bool TIndexedContainerIterator<TArray<FImpactInfo,FDefaultAllocator>,FImpactInfo,int32>::operator !=(const TIndexedContainerIterator<TArray<FImpactInfo,FDefaultAllocator>,FImpactInfo,int32> &,const TIndexedContainerIterator<TArray<FImpactInfo,FDefaultAllocator>,FImpactInfo,int32> &)' [found using argument-dependent lookup]
1> while trying to match the argument list '(TIndexedContainerIterator<TArray<FImpactInfo,FDefaultAllocator>,FImpactInfo,int32>, int)'
**I’m pretty sure that the TimerManager will recognize that the timer was already running **and restart the existing timer, because none of the timers in my project got broken by upgrading to 4.7
However if you want to be absolutely sure you can just clear the timer yourself before restarting
The only thing that changed for me in 4.7 timers was just how to keep track of them to clear them / check if they are running from a function other than the one in which they were created.
The behavior of restarting the same timer by just calling it again seems to be unchanged!
.h
FTimerHandle MyLoopingTimerHandle;
.cpp
//some func that starts timer
{
GetWorldTimerManager().ClearTimer(MyLoopingTimerHandle);
GetWorldTimerManager().SetTimer(MyLoopingTimerHandle, &YourClass::YourFunc, 0.01,true );
}
//some func that stops the timer normally
{
GetWorldTimerManager().ClearTimer(MyLoopingTimerHandle);
}
You could test both ways, calling the clear yourself as above, and then just omitting that first clear, let us know what happens!
Again all my research so far leads me to believe that if the timer manager is already running a timer and gets a request to start that same timer again, it will just restart the current one.
If 4.7 timers worked differently than 4.6 and prior it would have broken a lot of code that relied on non-duplication of timers, so I think the extra ClearTimer is unnecessary but might be emotionally comforting (which is always nice when not inefficient).
I can’t called ClearTimer in this particular case because the TimerHandle has been hidden by Epic Team by setting it Private. This is why I need to create my own variable, but I have no clue of the side effect like if the private timerhandle is set back to null due to the fact that I’m settings a new handle on the same function so if there is code relying on this, it won’t work… etc…
I know I can change this and compile it by myself, but it would be great to be sure on how things work on the backend. I will open a Answer question to get Epic feedback on this.
Yes I have to alter the current timer to change the lifespan to a different one than the default during the gameplay.
I can’t just change the value on the variable as the timer will be still based on the DefaultLifespan.
This is why I need to have acces to this timer. But I can’t retrive it, I can’t access it… My only option was to create a new timer handle with potential side effects. I opened the answer question here. I will keep you updated.
If you search the code base you will find TriggerBox.h, so its definitely there
/** A box shaped trigger, used to generate overlap events in the level */
UCLASS(MinimalAPI)
class ATriggerBox : public ATriggerBase
{
GENERATED_UCLASS_BODY()
**Include**
Try adding this include to your .h file, above your .generated #include!
```
#include "Engine/TriggerBox.h"
```
Let us know!
:)
Rama
Without seeing the error you are asking about, its hard to understand what you want as an answer I read your question two different ways so here are two answers
Read as “why do I see this twice?”
the .h file contains the definition (the syntax of the function/method)
the .cpp file contains the implementation (the logic that actually does something)
Read as “There is some sort of error about redefinition, but you didnt paste the error”
If you want to make your own version of a file in the parent the parent has to have first created it as “virtual”, then you can override it