ASExtHook
is a Metamod plugin used to extend the Sven Co-op AngelScripts scripting system.
Using this plugin makes it easy to perform operations that were previously exceptionally difficult, such as hooking whether a monster is dead or not.
Auto-generated HTML documentation for the Sven Co-op AsExtHook Angelscript API is available Here
Used HTML Generator Here
-
- 3.1. Current Expansion Property
- 3.2. Current Expansion Objects
- 3.3. Current Expansion Methods
- 3.4. Expansion Method Examples
- 3.5. 3.5 Expansion CVar
- 3.6. Current Expansion Hooks
- 3.6.1. EntitySpawn
- 3.6.2. IRelationship
- 3.6.3. MonsterSpawn
- 3.6.4. MonsterTraceAttack
- 3.6.5. BreakableKilled
- 3.6.6. BreakableTakeDamage
- 3.6.7. BreakableTraceAttack
- 3.6.8. PlayerPostTakeDamage
- 3.6.9. PlayerTakeHealth
- 3.6.10. PlayerCallMedic
- 3.6.11. PlayerCallGrenade
- 3.6.12. PlayerUserInfoChanged
- 3.6.13. GrappleGetMonsterType
-
Grab metamod-p and asext.dll/asext.so Here
-
Install them.
-
Grab asexthook.dll/asexthook.so, put them into
svencoop/addons/metamod/dlls
-
edit
svencoop/addons/metamod/plugins.ini
-
add
win32 addons/metamod/dlls/asexthook.dll
linux addons/metamod/dlls/asexthook.so
- enjoy your new hook :3
If you are using systems that are not covered by automatic builds (yum's and aur's)
or want to add new hooks yourself, you can follow these steps to configure your build environment.
-
Install everything you need
- Git or
winget install --id Git.Git -e --source winget
- Visual Studio with vc143 toolset And C++ desktop development
sudo apt install git make build-essential gcc gcc-multilib g++-multilib cmake -y
sudo yum install git make gcc gcc-c++ glibc-devel.i686 libstdc++-devel.i686 cmake -y
Sorry guys who using Arch, I've never used an Arch based distribution, you'll have to find out how to configure the dependencies yourselves!🙂
- Git or
-
Clone metamod modified by hzqst
git clone https://github.com/DrAbcOfficial/metamod-fallguys.git metamod
cd metamod
-
Clone this
git clone https://github.com/DrAbcOfficial/asexthook.git
cd asexthook
-
Build!
- Open
asexthook.sln
with visual studio - Press
F7
- Wait and done.
mkdir build && cd build && cmake .. && make
- Open
-
Grab
Now you can grab your new library (asexthook.dll/asexthook.so) in
metamod/build/addons/metamod/dlls/
Class | Namespace | Object |
---|---|---|
CBinaryStringBuilder | <Global> | g_BinaryStringBuilder |
class HealthInfo{
CBaseEntity@ pEntity;
float flHealth;
int bitsDamageType;
int health_cap;
}
Class | Method | Explian |
---|---|---|
CEngineFuncs | uint32 CRC32(const string& in szBuffer) | Caculate CRC32 for a string |
CEngineFuncs | bool ClassMemcpy(?& in src, ?& in dst) | copy class, If src and dst are different type, return false. If not class ref, crash game. |
--- | --- | --- |
CBinaryStringBuilder | More info click url👉 | CBinaryStringBuilder |
CSQLite | More info click url👉 | CSQLite |
CVar | default | explain |
---|---|---|
sv_fixgmr | 1 | add gmr found before SV_ModelIndex to fix gmr crash game |
Hooks::Entity const uint32 EntitySpawn (CBaseEntity@ pEntity)
Call after original CBaseEntity::Spawn called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Entity const uint32 IRelationship (CBaseEntity@ pEntity, CBaseEntity@ pOther, bool param, int& out newValue)
Pre call before checking relation.
if newValue changed, will use new relationship.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Monster const uint32 MonsterSpawn (CBaseMonster@ pMonster)
Call after who having FL_MONSTER entity CBaseEntity::Spawn called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Monster const uint32 MonsterTraceAttack (CBaseMonster@ pMonster, entvars_t@ pevAttacker, float flDamage, Vector vecDir, const TraceResult& in ptr, int bitDamageType)
Call before origin CBaseMonster::TraceAttack called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Entity const uint32 BreakableKilled (CBaseEntity@ pBreakable, entvars_t@ pevAttacker, int iGib)
Call before origin CBreakable::Die called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Entity const uint32 BreakableTakeDamage (DamageInfo@ info)
Call before origin CBreakable::TakeDamage called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Monster const uint32 MonsterTraceAttack (CBaseEntity@ pBreakable, entvars_t@ pevAttacker, float flDamage, Vector vecDir, const TraceResult& in ptr, int bitDamageType)
Call before origin CBreakable::TraceAttack called.
Notice that player died will call this hook, because player is monster too.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 PlayerPostTakeDamage (DamageInfo@ info)
Call after origin CBasePlayer::TakeDamage called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 PlayerTakeHealth (HealthInfo@ info)
Call after origin CBasePlayer::TakeHealth called.
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 PlayerCallMedic (CBasePlayer@ pPlayer)
Call before "Medic!!!!"
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 PlayerCallGrenade (CBasePlayer@ pPlayer)
Call before "Take Cover!!!!"
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 PlayerUserInfoChanged (CBasePlayer@ pClient, string szInfoBuffer, uint&out uiFlag)
Call before player userinfo changed (e.g: name change)
will block original call if uiFlag not 0
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Weapon const uint32 GrappleGetMonsterType (CBaseEntity@ pThis, CBaseEntity@ pEntity, uint& out flag)
Pre call before Weapon Grapple checking monster type
No more hardcoded grapple, yay!
out return value:
value | result |
---|---|
1 | pull monster to player |
2 | pull player to monster |
other | use default |
StopMode: CALL_ALL
MapScript | Plugin
Hooks::Player const uint32 SendScoreInfo (CBasePlayer@ pPlayer, edict_t@ pTarget, int iTeamID, string szTeamName, uint& out flag)
Pre call before sending hud info to edict
will block original call if out value not 0.
StopMode: CALL_ALL
MapScript | Plugin