Closed GalladeR475 closed 1 year ago
Let me know if you're having any issues!
This is on purpose.
When there is no player passed into OnChaseEnded
event, it signifies that the AI has completely ended, chasing no one.
When a player is passed, it represents that it is chasing a new player, so it would pass the previous player that it chased.
Also note this is part of the examples, which should be viewed as examples I created, and you can improve on or modify.
+Reminder:
AIEngine can be modified to whatever you like, just as Sythivo said.
As you can see, the ?
indicates that the Signal would either return a player or nil
.
This was done by design.
I hope you understand!
Interesting I didn't know about that, thanks!
Modifying the AIEngine source isn't suggested but you are free to do so. You can copy the Examples template to design your own system.
I would close this issue as it appears to be solved. 😅
FIX
On line 65 of the Chase mechanism/module, you'll see a declaration of
OnStateChange
to be something like this: As you can see,OnChaseEnded
doesn't fire with the last targeted player. Just a little above, on line 56 you can see thatOnChaseEnded
will be fired with the last targeted player, but only happens if there is another player in sight. But for single-player games, this is not that handy. Here's my fix: