View Single Post
caxanga334
Member
Join Date: Nov 2013
Location: Brazil
Old 02-28-2024 , 19:02   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #113

Quote:
Originally Posted by awesome144 View Post
SelectMoreDangerousThreat is an optional native, but it doesn't have its own property in the methodmap? Also could I get an explanation of its callback function?
When IVision::GetPrimaryKnownThreat is called, IContextualQuery::SelectMoreDangerousThreat is used to filter/select which Known Entity the bot should consider as it's primary threat. Generally used when selecting targets to attack.

IContextualQuery::SelectMoreDangerousThreat returns a CKnownEntity pointer and has 4 parameters: The bot itself, the bot BCC, and two known entities, threat1 and threat2. The function must return if the bot should focus on threat1 or threat2. NULL can be returned for a 'no answer'.

In the extension: function Action (any action, Address nextbot, int entity, Address threat1, Address threat2, Address& knownEntity). You have the address to threat1 and threat2. The result is stored in the last parameter: Address& knownEntity.
caxanga334 is offline