Raised This Month: $ Target: $400
 0% 

[HELP] Writing a module hooking CBasePlayer::SetAnimation


Post New Thread Reply   
 
Thread Tools Display Modes
wiwi249
Member
Join Date: Oct 2013
Old 04-20-2015 , 14:27   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #11

Okay, @Arkshine, I've finally tried testing the module. Unfortunately i'm getting a bad load while loading it. No idea why. I get no logs at all, i just see it in amx_modules that it loaded badly.
I just uploaded it to the Linux server and added "setanimation" at the bottom of modules.ini. Then wrote a plugin for that, the plugin loads well of course, but the module doesn't.

Last edited by wiwi249; 04-20-2015 at 14:33.
wiwi249 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-20-2015 , 15:44   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #12

Make sure you uploaded it in the right folder. I've tested it before posting.

Try to see if (server) console doesn't say something.

You can try to set meta_debug to 7 for example, and do "meta refresh", to see if you get useful messages.
__________________

Last edited by Arkshine; 04-20-2015 at 15:48.
Arkshine is offline
wiwi249
Member
Join Date: Oct 2013
Old 04-20-2015 , 17:28   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #13

Arkshine, It works great! I didn't check the anim param (it seems to be returning gaitsequence values) but the anims are blocked perfectly. I don't know how to thank you! ;)
Anyway, i don't know what happened that it didn't want to load. Now works all fine.
wiwi249 is offline
hzqst
Senior Member
Join Date: Jul 2008
Old 04-20-2015 , 23:20   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #14

Quote:
Originally Posted by wiwi249 View Post
I mean how many animations can one mdl file contain. (Player models have something like 117 animations if I remember well).
#define MAXSTUDIOTRIANGLES 20000 // TODO: tune this
#define MAXSTUDIOVERTS 2048 // TODO: tune this
#define MAXSTUDIOSEQUENCES 2048 // total animation sequences -- KSH incremented
#define MAXSTUDIOSKINS 100 // total textures
#define MAXSTUDIOSRCBONES 512 // bones allowed at source movement
#define MAXSTUDIOBONES 128 // total bones actually used
#define MAXSTUDIOMODELS 32 // sub-models per model
#define MAXSTUDIOBODYPARTS 32
#define MAXSTUDIOGROUPS 16
#define MAXSTUDIOANIMATIONS 2048
#define MAXSTUDIOMESHES 256
#define MAXSTUDIOEVENTS 1024
#define MAXSTUDIOPIVOTS 256
#define MAXSTUDIOCONTROLLERS 8

maybe you mean
#define MAXSTUDIOSEQUENCES 2048
or
#define MAXSTUDIOANIMATIONS 2048
but however it's 2048
hzqst is offline
wiwi249
Member
Join Date: Oct 2013
Old 04-21-2015 , 07:12   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #15

That's really good, 2048 animations is definitely enough XD
That's what I've been asking for, thanks.
wiwi249 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 04-22-2015 , 00:47   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #16

Quote:
Originally Posted by Arkshine View Post
Try that.

Unzip setanimation-files in /dlls (1.8.2) or /modules (1.8.3-dev)

In your plugin use the OnSetAnimation forward:

Code:
public OnSetAnimation(player, anim) {     // return PLUGIN_HANDLED to block the call }

EDIT: I guess I could add a native later.
Wow. Arkshine, I have a question about that code. Can be that code be modified for hooking another functions? I haven't got any example of how to hook an specific function of the engine providing his sig with a module..
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-21-2016 , 06:19   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #17

Mega-bump
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-21-2016 , 06:31   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #18

Not sure what is your actual problem.
__________________
Arkshine is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 07-21-2016 , 07:24   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #19

Quote:
Originally Posted by Arkshine View Post
Not sure what is your actual problem.
How hard would be to hook another function (actually FireBullets and FireBullets3, not with Rage because it keeps files opened and nobody fixed it yet), but it's out of the scope of this topic, so when I get some time I will post my issue.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-22-2016 , 19:47   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #20

Quote:
Originally Posted by meTaLiCroSS View Post
How hard would be to hook another function (actually FireBullets and FireBullets3, not with Rage because it keeps files opened and nobody fixed it yet), but it's out of the scope of this topic, so when I get some time I will post my issue.
Have you took a look at the source code?

It's easy to achieve
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:36.


Powered by vBulletin®
Copyright ©2000 - 2023, vBulletin Solutions, Inc.
Theme made by Freecode