Atleast provide some info about your server. I have no idea what you did to install it but error clearly says that it can't find extension.
Just so you know installation steps:
1. Download archive
2. Put extension and autoload file to sourcemod/extension folder (Make sure you placed right extension since they all depends by game and OS)
3. Put gamedata file to sourcemod/gamedata folder
4. Restart server
5. Done
Atleast provide some info about your server. I have no idea what you did to install it but error clearly says that it can't find extension.
Just so you know installation steps:
1. Download archive
2. Put extension and autoload file to sourcemod/extension folder (Make sure you placed right extension since they all depends by game and OS)
3. Put gamedata file to sourcemod/gamedata folder
4. Restart server
5. Done
PHP Code:
L 05/16/2022 - 12:36:01: SourceMod error session started
L 05/16/2022 - 12:36:01: Info (map "c5m1_waterfront") (file "/home/l4d2server/serverfiles/left4dead2/addons/sourcemod/logs/errors_20220516.log")
L 05/16/2022 - 12:36:01: [SM] Unable to load extension "actions.ext": /home/l4d2server/serverfiles/left4dead2/addons/sourcemod/extensions/actions.ext.2.l4d2.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERjj
L 05/16/2022 - 12:36:04: [SM] Unable to load plugin "l4d2_shove_fix.smx": Native "BehaviorAction.OnShoved.set" was not found
Quote:
[01] Stripper (1.2.2) by BAILOPAN
[02] L4DToolZ (1.0.0.9r1) by Ivailosp
[03] SourceMod (1.10.0.653 by AlliedModders LLC
[04] DHooks (2.2.0-detours17) by Dr!fter and Peace-Maker
[05] SDK Tools (1.10.0.653 by AlliedModders LLC
[06] SDK Hooks (1.10.0.653 by AlliedModders LLC
[07] VoiceHook (3.0) by Accelerator
[08] SteamWorks Extension (1.2.3) by Kyle Sanderson
I would like to request adding information to the include file to make the whole library optional. This will allow plugins to make the extension an optional dependency.
Something like this:
Spoiler
PHP Code:
public Extension __ext_actions = { name = "Actions", file = "actions.ext", autoload = 1, #if defined REQUIRE_EXTENSIONS required = 1, #else required = 0, #endif };
Also, I think the thread title should be renamed with the prefix "[L4D & L4D2]" or something similar since you added support for L4D1.
Also, also, is there a consistent/reliable way to get the target of an action? In your example callback for "OnShovedPost" you have a "shover" param but I don't know where you got that. Then, in your block example, you use an offset to retrieve the target for the "OnFriendAction" callback, and I am wondering if that offset is always the same for every action or not.
Also, also, also, what are the different function prototypes for the callback functions? In your examples, you use different prototypes so I don't know which one to use for "TankAttack". Maybe a "typedef" or "typeset" in the include will help.
Spoiler
PHP Code:
OnStart( BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result ) OnMyActionStart( BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result ) OnMyActionUpdate( BehaviorAction action, int actor, float interval, ActionResult result ) OnShovedPost( BehaviorAction action, int actor, int shover, ActionDesiredResult result ) OnSelfAction( BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result ) OnFriendAction( BehaviorAction action, int actor, BehaviorAction priorAction, ActionResult result )
For my use case, I am experimenting with setting a Tank's target when his current behavior is "TankAttack" so my plugin can decide which survivors to focus.
Also, also, is there a consistent/reliable way to get the target of an action? In your example callback for "OnShovedPost" you have a "shover" param but I don't know where you got that. Then, in your block example, you use an offset to retrieve the target for the "OnFriendAction" callback, and I am wondering if that offset is always the same for every action or not.
For my use case, I am experimenting with setting a Tank's target when his current behavior is "TankAttack" so my plugin can decide which survivors to focus.
In most cases offsets will be same for every action but it's still better to check it yourself if you not sure. I have already mentioned some pattern info about offsets.
Every special infected chooses his target by calling ChooseVictim in ...Attack::Update action handler and return of ChooseVictim is always stored by 0x34 offset. Actually getting current tank target via action is more reliable and proper way since game directly uses this var to make path and it also considers OnContact event handler which makes tank attack who touched him.
About event handlers params. Their params are always same for every action but event handlers in plugins have some differences/additions. First param is always action, then arguments of the default handler, the last is always ActionResult/ActionDesiredResult. I will add typeset soon.
For example default OnShoved handler looks like this
so in plugin OnShoved callback will look like this
PHP Code:
/* First param is always action, then arguments of the default handler, the last is always ActionResult/ActionDesiredResult */
OnShoved(BehaviorAction action, int actor, int shover, ActionDesiredResult result)
ActionResult is used only for OnStart, Update, OnEnd, OnSuspend, OnResume others use ActionDesiredResult (reference)
/* Probably missed something */
typeset ActionHandler
{
function Action OnStart(BehaviorAction action, int actor, BehaviorAction action, ActionResult result);
function Action Update(BehaviorAction action, int actor, float, ActionResult result);
function void OnEnd(BehaviorAction action, int actor, BehaviorAction action, ActionResult result);
function Action OnSuspend(BehaviorAction action, int actor, BehaviorAction action, ActionResult result);
function Action OnResume(BehaviorAction action, int actor, BehaviorAction action, ActionResult result);
function Action InitialContainedAction(BehaviorAction action, int actor, BehaviorAction& action);
function Action OnLeaveGround(BehaviorAction action, int actor, int entity, ActionDesiredResult result);
function Action OnLandOnGround(BehaviorAction action, int actor, int entity, ActionDesiredResult result);
function Action OnContact(BehaviorAction action, int actor, int entity, Address trace, ActionDesiredResult result);
function Action OnMoveToSuccess(BehaviorAction action, int actor, Address path, ActionDesiredResult result);
function Action OnMoveToFailure(BehaviorAction action, int actor, Address path, MoveToFailureType type, ActionDesiredResult result);
function Action OnStuck(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnUnStuck(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnPostureChanged(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnAnimationActivityComplete(BehaviorAction action, int actor, int activity, ActionDesiredResult result);
function Action OnAnimationActivityInterrupted(BehaviorAction action, int actor, int activity, ActionDesiredResult result);
function Action OnAnimationEvent(BehaviorAction action, int actor, Address animevent, ActionDesiredResult result);
function Action OnIgnite(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnInjured(BehaviorAction action, int actor, Address takedamageinfo, ActionDesiredResult result);
function Action OnKilled(BehaviorAction action, int actor, Address takedamageinfo, ActionDesiredResult result);
function Action OnOtherKilled(BehaviorAction action, int actor, int other, Address takedamageinfo, ActionDesiredResult result);
function Action OnSight(BehaviorAction action, int actor, int subject, ActionDesiredResult result);
function Action OnLostSight(BehaviorAction action, int actor, int subject, ActionDesiredResult result);
function Action OnThreatChanged(BehaviorAction action, int actor, int threat, ActionDesiredResult result);
function Action OnSound(BehaviorAction action, int actor, int entity, float vec[3], Address keyvalues, ActionDesiredResult result);
function Action OnSpokeConcept(BehaviorAction action, int actor, int who, Address concept, Address response, Address unknown, ActionDesiredResult result);
function Action OnNavAreaChanged(BehaviorAction action, int actor, Address newArea, Address oldArea, ActionDesiredResult result);
function Action OnModelChanged(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnPickUp(BehaviorAction action, int actor, int entity, int giver, ActionDesiredResult result);
function Action OnDrop(BehaviorAction action, int actor, int item, ActionDesiredResult result);
function Action OnShoved(BehaviorAction action, int actor, int shover, ActionDesiredResult result);
function Action OnBlinded(BehaviorAction action, int actor, int blinder, ActionDesiredResult result);
function Action OnEnteredSpit(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnHitByVomitJar(BehaviorAction action, int actor, int who, ActionDesiredResult result);
function Action OnCommandAttack(BehaviorAction action, int actor, int victim, ActionDesiredResult result);
function Action OnCommandAssault(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnCommandApproach(BehaviorAction action, int actor, const float pos[3], float range, ActionDesiredResult result);
function Action OnCommandApproach(BehaviorAction action, int actor, int goal, ActionDesiredResult result);
function Action OnCommandRetreat(BehaviorAction action, int actor, int threat, float range, ActionDesiredResult result);
function Action OnCommandPause(BehaviorAction action, int actor, float duration, ActionDesiredResult result);
function Action OnCommandResume(BehaviorAction action, int actor, ActionDesiredResult result);
function Action OnCommandString(BehaviorAction action, int actor, const char[] command, ActionDesiredResult result);
function Action IsAbleToBlockMovementOf(BehaviorAction action, int actor, Address nextbot, ActionDesiredResult result);
}
- Docs reconfigure - Fixed crash for multiple hooks on same event handler and default action result - Renamed thread - Added extension optionality (Thanks to Psyk0tik)