AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   RegisterHam on several entity classes? (https://forums.alliedmods.net/showthread.php?t=283192)

Nero-sama 05-27-2016 10:43

RegisterHam on several entity classes?
 
I'm making a plugin for Sven Co-op that increases damage done to monsters.
RegisterHam( Ham_TakeDamage, "*", "hook_TakeDamage" );

Doesn't work.
Looping it through all monster classes would work, but surely there is a better way of doing it? :S

:3

Arkshine 05-27-2016 11:30

Re: RegisterHam on several entity classes?
 
Nope.

Nero-sama 05-27-2016 11:34

Re: RegisterHam on several entity classes?
 
Aight, thanks :3

gabuch2 05-27-2016 12:03

Re: RegisterHam on several entity classes?
 
If I recall correctly if you register it on monster_headcrab, it will register on every entity derived from CBaseMonster.

See https://forums.alliedmods.net/showthread.php?t=281594 for a similar issue.

klippy 05-27-2016 12:16

Re: RegisterHam on several entity classes?
 
Quote:

Originally Posted by Shattered Heart Lynx (Post 2422480)
If I recall correctly if you register it on monster_headcrab, it will register on every entity derived from CBaseMonster.

I believe you want "linked to" here, not "derived from" as it can be misleading. By saying "derived from CBaseMonster" one could think that every class that derives from CBaseMonster will have its virtual functions hooked too, which is not the case.
For instance, CSquadMonster and CCycler have their own virtual tables even though they derive from CBaseMonster.

Just to make things clear. :bee:

gabuch2 05-27-2016 12:23

Re: RegisterHam on several entity classes?
 
I didn't recall correctly :crab:


All times are GMT -4. The time now is 18:42.

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