AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [TF2 & L4D & L4D2] Actions (https://forums.alliedmods.net/showthread.php?t=336374)

Mystik Spiral 01-19-2024 07:38

Re: [TF2 & L4D & L4D2] Actions
 
Great info. Thank you @BHaType!

awesome144 02-16-2024 03:32

Re: [TF2 & L4D & L4D2] Actions
 
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?

caxanga334 02-28-2024 19:02

Re: [TF2 & L4D & L4D2] Actions
 
Quote:

Originally Posted by awesome144 (Post 2818109)
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.

little_froy 03-09-2024 23:54

Re: [TF2 & L4D & L4D2] Actions
 
L4D2 how can I get attack target in SurvivorAttack? I want to prevent some attacks.

Solved: https://forums.alliedmods.net/showthread.php?t=346696

yongeni 03-11-2024 09:10

Re: [L4D2] Actions
 
!It will lead to many three -way map fried

0 server_srv.so!PathFollower::LadderUpdate(INex tBot*) + 0x251
1 server_srv.so!PathFollower::Update(INextBot*) + 0x273
2 server_srv.so!ChaseVictim::Update(Infected*, float) + 0x546
3 actions.ext.2.l4d2.so!hexecution<[...]> ProcessHandlerImpl<[...]>(ProcessHandlerEx<[...]>(unsigned int, ActionProcessorShared*, ActionResult<[...]> (ActionProcessorShared::*&&)(CBaseEntity*, float), CBaseEntity*&, float&)::{lambda()#1}&, Action<[...]>*, unsigned int, ActionResult<[...]> (ActionProcessorShared::*&)(CBaseEntity*, float), CBaseEntity*&, float&) [invoke.h:73 + 0x1a]
4 actions.ext.2.l4d2.so!ActionProcessorShared:: Update(CBaseEntity*, float) [actions_processor_shared.h:178 + 0x10]
5 server_srv.so!Action<Infected>::InvokeUpdate( Infected*, Behavior<Infected>*, float) + 0xed
6 server_srv.so!Action<Infected>::InvokeUpdate( Infected*, Behavior<Infected>*, float) + 0x12a
7 server_srv.so!Action<Infected>::InvokeUpdate( Infected*, Behavior<Infected>*, float) + 0x12a
8 server_srv.so!Action<Infected>::InvokeUpdate( Infected*, Behavior<Infected>*, float) + 0x12a
9 server_srv.so!Behavior<Infected>::Update(Infe cted*, float) + 0x55
10 server_srv.so!InfectedIntention::Update() + 0xd4
11 server_srv.so!INextBot::Update() + 0x84
12 server_srv.so!Infected::Update() + 0xc5
13 server_srv.so!NextBotCombatCharacter::DoThink () + 0x274
14 server_srv.so!CBaseEntity::PhysicsDispatchThi nk(void (CBaseEntity::*)()) + 0xa9
15 server_srv.so!CBaseEntity::PhysicsRunSpecific Think(int, void (CBaseEntity::*)()) + 0xc4
16 server_srv.so!_ZN11CBaseEntity15PhysicsRunThi nkENS_14thinkmethods_tE.part.150 + 0x32
17 server_srv.so!CBaseEntity::PhysicsCustom() + 0xe7
18 server_srv.so!CBaseEntity::PhysicsSimulate() + 0x9e0
19 server_srv.so!Physics_SimulateEntity(CBaseEnt ity*) + 0x152
20 server_srv.so!Physics_RunThinkFunctions(bool) + 0x2d1
21 server_srv.so!CServerGameDLL::GameFrame(bool) + 0x967
22 sourcemod.2.l4d2.so!__SourceHook_FHCls_IServe rGameDLLGameFramefalse::Func + 0x9b
23 engine_srv.so!SV_Think(bool) + 0x1c8
24 engine_srv.so!SV_Frame(bool) + 0x168
25 engine_srv.so!_Host_RunFrame_Server(bool) + 0x17c
26 engine_srv.so!_Host_RunFrame(float) + 0x470
27 engine_srv.so!CHostState::State_Run(float) + 0xf8
28 engine_srv.so!CHostState::FrameUpdate(float) + 0x166
29 engine_srv.so!HostState_Frame(float) + 0x1d
30 engine_srv.so!CEngine::Frame() + 0x54f
31 engine_srv.so!CDedicatedServerAPI::RunFrame() + 0x26
32 dedicated_srv.so!RunServerIteration(bool) + 0x3c
33 dedicated_srv.so!RunServer(bool) + 0x48
34 engine_srv.so!CModAppSystemGroup::Main() + 0x8d
35 engine_srv.so!CAppSystemGroup::Run() + 0x38
36 engine_srv.so!CDedicatedServerAPI::ModInit(Mo dInfo_t&) + 0x1af
37 dedicated_srv.so!CDedicatedAppSystemGroup::Ma in() + 0xb5
38 dedicated_srv.so!CAppSystemGroup::Run() + 0x38
39 dedicated_srv.so!CAppSystemGroup::Run() + 0x38
40 dedicated_srv.so!main + 0x217
41 srcds_linux!main + 0xf2
42 libc-2.27.so!__libc_start_main + 0xf1
43 srcds_linux + 0x885
44 srcds_linux + 0x630
45 srcds_linux + 0x950
46 srcds_linux + 0x9c0

little_froy 03-12-2024 05:13

Re: [TF2 & L4D & L4D2] Actions
 
report: L4D2 SurvivorAttack.SelectTargetPoint can't be called if plugin late load.

BHaType 04-23-2024 16:20

Re: [TF2 & L4D & L4D2] Actions
 
Quote:

Originally Posted by awesome144 (Post 2818109)
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?

I forgot to add them, fixed in the latest update.

edit:
This callback is game depended because in l4d2 and tf2 it seems to act different
but according to the source code it's just a way to select either the first threat on the list or SelectMoreDangerousThreat result.
basicly what @caxanga334 said

Quote:

Originally Posted by little_froy (Post 2819243)
L4D2 how can I get attack target in SurvivorAttack? I want to prevent some attacks.
Solved: https://forums.alliedmods.net/showthread.php?t=346696

You have to reverse "SurvivorAttack" action to get survivor's target

Quote:

Originally Posted by yongeni (Post 2819306)
...

This is known crash and has nothing to do with the extension.

Quote:

Originally Posted by little_froy (Post 2819347)
report: L4D2 SurvivorAttack.SelectTargetPoint can't be called if plugin late load.

?

BHaType 04-23-2024 16:22

Re: [TF2 & L4D & L4D2] Actions
 
Updated
PHP Code:

Fixed memory leak for sub-overridden actions 
Added vector memory property functions
Added vector/string userdata support
Added missing contextual handlers (thanks to OfficerSpy)
Added new ActionConstructor type to setup and call action constructors within gamedata 


HarryPotter 04-29-2024 04:39

Re: [TF2 & L4D & L4D2] Actions
 
Quote:

Originally Posted by BHaType (Post 2821486)
Updated
PHP Code:

Fixed memory leak for sub-overridden actions 
Added vector memory property functions
Added vector/string userdata support
Added missing contextual handlers (thanks to OfficerSpy)
Added new ActionConstructor type to setup and call action constructors within gamedata 


nice

BHaType 06-09-2024 06:34

Re: [TF2 & L4D & L4D2] Actions
 
Updated

PHP Code:

Fixed crash in the IsHindrance callback caused by custom 'invalid' entity definition (thanks to OfficerSpy for report)
Added BehaviorAction.Matches function to replace the GetName() + strcmp idiom
Definitions provided by the include can now be disabled with the preprocessor 



All times are GMT -4. The time now is 06:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.