PDA

View Full Version : [RELEASE] UTILS Extension


arthurdead
09-17-2016, 13:55
native FireBulletsInfo_t utils_CreateFireBulletsInfo();
native void utils_FireBulletsInfoSetVar(FireBulletsInfo_t info, const char[] name, any[] value); // please use the methodmap
native void utils_EntityFireBullets(int entity, FireBulletsInfo_t info);

native float utils_StudioSetBoneController(int entity, int controller, float value, float &newvalue);
native float utils_StudioGetBoneController(int entity, int controller, float value);

native void utils_EntityGetPoseParameterRange(int entity, int parameter, float &minvalue, float &maxvalue);

native bool utils_EntityHasMovement(int entity, int sequence);
native bool utils_EntityHasPoseParameter(int entity, int sequence, int parameter);

native int utils_EntityGetNumBones(int entity);

native int utils_EntityLookupAttachment(int entity, const char[] name);
native int utils_EntityLookupBone(int entity, const char[] name);
native int utils_EntityLookupSequence(int entity, const char[] name);
native int utils_EntityLookupPoseParameter(int entity, const char[] name);
native Activity utils_EntityLookupActivity(int entity, const char[] name);

native void utils_EntityGetBonePosition(int entity, int index, float origin[3], float angle[3]);
native void utils_EntityGetAttachment(int entity, int index, float vec[3], float angle[3]);
native void utils_EntityGetAttachmentLocal(int entity, int index, float vec[3], float angle[3]);

native float utils_StudioSetPoseParameter(int entity, int parameter, float value, float &newvalue);

native float utils_StudioGetPoseParameter(int entity, int parameter, float value);

native int utils_EntitySelectWeightedSequence(int entity, Activity activity);
native Activity utils_EntityGetSequenceActivity(int entity, int sequence);
native float utils_EntitySequenceDuration(int entity, int sequence);
native float utils_EntitySequenceGroundSpeed(int entity, int sequence);

native any utils_AnimOverlayFunc(AnimOverlayHandler handler, const char[] name, any ...); // please use the methodmap

native void utils_GetActivityName(Activity activity, char[] name, int maxlen);
native Activity utils_GetActivityIndex(const char[] name);
native float utils_GetFrameTime();

stock float utils_EntitySetPoseParameter(int entity, int parameter, float value)
stock float utils_EntityGetPoseParameter(int entity, int parameter)

stock float utils_EntitySetBoneController(int entity, int controller, float value)
stock float utils_EntityGetBoneController(int entity, int controller)

https://github.com/arthurdead/utilsext

windows build
https://github.com/arthurdead/utilsext/blob/master/build/package/addons/sourcemod/extensions/utilsext.ext.2.tf2.dll?raw=true

linux build
https://github.com/arthurdead/utilsext/blob/6aac841a8e1d320bcca17bfbf6b0b30e23eb6567/build/package/addons/sourcemod/extensions/utilsext.ext.2.tf2.so?raw=true

gamedata
https://raw.githubusercontent.com/arthurdead/utilsext/master/gamedata/utilsext.txt (https://raw.githubusercontent.com/arthurdead/utilsext/master/build/package/addons/sourcemod/gamedata/utils.ext.txt)

include
https://raw.githubusercontent.com/arthurdead/utilsext/master/build/package/addons/sourcemod/scripting/include/utilsext.inc

Pelipoika
09-17-2016, 13:57
:bacon!:

iGANGNAM
09-17-2016, 14:07
and what is the point of this extension? what are possibilities with it? Any usages for CS:GO?

Benoist3012
09-17-2016, 14:10
:bacon!: This extension is amazing, I could achieve all I wanted to do the last month, thanks to you.

arthurdead
09-17-2016, 14:10
and what is the point of this extension? what are possibilities with it? Any usages for CS:GO?

get csgo gamedata and compile it for csgo i ain't touching that

404UserNotFound
09-17-2016, 14:38
I can work on my Battle Bots plugin with this :D

and what is the point of this extension? what are possibilities with it? Any usages for CS:GO?

It's useful for animating things, for example the Player Pets plugin that's out there on the forum. There's a few versions of the plugin:

- The one that's gotten well known on the forums
- The one that me and Arthurdead worked on, based off of Golden machine gun's pets
- Golden Machine Gun's pets

I have all three versions of that plugin and I've been working on a new version that adds proper walking (using m_flPoseParameters) and new states like crouchwalking, swimming, etc.


This extension seems to make the animating process a bit easier, offering tons of wonderful little ways to do things.

My Battle Bots plugin is in essence a copy of the many Pets plugins out there, except I'm using the MvM robot models as the "bots", the Romevision helmets/armor as optional "equipment" for the bots that increases defense, and in a battle arena map that I'm working on that'll use sourcemod plugins for extra map functionality, you will control the little prop_dynamic "bots" and make them fight.

As well, the utils_AnimOverlayFunc(AnimOverlayHandler func is a wonderful thing to have when trying to make something do an attack animation, as you need to layer animations for that.

This extension should help those Pet plugins add a bit more functionality to them. All that's needed now is some sort of pathfinding to keep the "pets" from clipping through walls and floating in midair if the ground you're standing on is uneven. I know Peli has an extension he made for it that's private, and he did give me a price for if I want to actually buy a copy of it off him, but I don't have the cashola right now.

Oh, I forgot to mention also that it has a "FireBullets" thing allowing you to make the thing you're animating fire bullets. I haven't actually tested this extension out yet, but I will be shortly.

Benoist3012
09-18-2016, 02:06
@abrandnewday Fire bullets function allows you to shoot bullets from an entity and set its damage, damage force, and of course the number of bullets and the spread. I used it in my sf2 plugin last week, can say, it works pretty well.

tonline_kms65
10-04-2016, 11:59
native FireBulletsInfo_t utils_CreateFireBulletsInfo();

Required module. Does not work on Counter-Strike:Source. What to do what would have worked?

Potato Uno
10-04-2016, 14:28
This looks like it is only compiled for TF2. You need to compile it for your game (and maybe find gamedata for it).

xXDeathreusXx
01-18-2017, 14:17
If only I knew how to make use of this, it looks super handy, anyone have any kind of example?

Pelipoika
01-18-2017, 14:40
If only I knew how to make use of this, it looks super handy, anyone have any kind of example?

What do you want to do?

xXDeathreusXx
01-19-2017, 11:32
What do you want to do?

Play sequences on a player if this can do that, like making Merasmus model do his bomb animation

Pelipoika
01-19-2017, 11:46
Play sequences on a player if this can do that, like making Merasmus model do his bomb animation

Nah this can't set/play animations on the player entity

404UserNotFound
01-26-2017, 23:48
Nah this can't set/play animations on the player entity

It's possible via other methods that don't require an extension...I think?

I know some methods (for example the Shortstop Shove Animation Enabler (https://forums.alliedmods.net/showthread.php?t=293002)) may require signatures and offsets. But I forget if there's a non-gamedata/non-extension way of doing player animations *without* resorting to the classic "spawn a prop_dynamic player model in and make it do the animation* like the unused burning death animation (https://forums.alliedmods.net/showthread.php?p=2226510) plugin on the forums uses.

Speaking of both the Shortstop Shove and the Unused Burning Death animations plugins.....I think I'm going to look into the possibility of redoing that Unused Burning Death animation plugin that works similarly to the Shortstop plugin, but actually makes the player do the burning death animation instead of spawning a prop.

xXDeathreusXx
01-27-2017, 14:06
It's possible via other methods that don't require an extension...I think?

I found this: CTFPlayer::PlaySpecificSequence and CTFPlayer::PlayScene
PlayScene has a vtable offset, PlaySpecificSequence needs a signature

There's also CTFPlayer::SetAnimation, but I don't know where to find the PLAYER_ANIM defenitions

Pelipoika
01-27-2017, 14:23
I found this: CTFPlayer::PlaySpecificSequence and CTFPlayer::PlayScene
PlayScene has a vtable offset, PlaySpecificSequence needs a signature

There's also CTFPlayer::SetAnimation, but I don't know where to find the PLAYER_ANIM defenitions

https://github.com/danielmm8888/TF2Classic/blob/d070129a436a8a070659f0267f6e63564a519a47/src/game/shared/shareddefs.h#L353-L370

https://github.com/akowald/StopThatTank/blob/master/addons/sourcemod/gamedata/tank.txt#L61-L66

404UserNotFound
01-27-2017, 20:24
https://github.com/danielmm8888/TF2Classic/blob/d070129a436a8a070659f0267f6e63564a519a47/src/game/shared/shareddefs.h#L353-L370

https://github.com/akowald/StopThatTank/blob/master/addons/sourcemod/gamedata/tank.txt#L61-L66

http://i.imgur.com/QSnSUN7.png

xXDeathreusXx
01-28-2017, 13:11
https://github.com/danielmm8888/TF2Classic/blob/d070129a436a8a070659f0267f6e63564a519a47/src/game/shared/shareddefs.h#L353-L370

https://github.com/akowald/StopThatTank/blob/master/addons/sourcemod/gamedata/tank.txt#L61-L66

But that can't be all of them can it? I knew about shareddefs

Either way, thanks for finding that signature since I would of never thought to look at STT

Pelipoika
01-28-2017, 15:53
But that can't be all of them can it? I knew about shareddefs

Either way, thanks for finding that signature since I would of never thought to look at STT

Doesn't matter
void CTFPlayer::SetAnimation()
{
;
}

https://github.com/danielmm8888/TF2Classic/blob/master/src/game/server/tf/tf_player.cpp#L5959-L5966

Chdata
02-11-2017, 11:45
build and gamedata are 404

edit:

gamedata filename is utilsext.txt

yet

L 02/11/2017 - 05:53:07: [SM] Error parsing gameconfig file "/home/chdata/vsh/tf/addons/sourcemod/gamedata/utils.ext.txt":
L 02/11/2017 - 05:53:07: [SM] Error 1 on line 0, col 0: Stream failed to open
L 02/11/2017 - 05:53:07: [SM] Unable to load extension "utilsext.ext": FAILED TO LOAD GAMEDATA ERROR: File could not be opened: No such file or directory
L 02/11/2017 - 05:53:07: [SM] Unable to load plugin "saxtonhale.smx": Required extension "utilsext" file("utilsext.ext") not running

typo ;o

arthurdead
02-11-2017, 13:45
https://github.com/arthurdead/utilsext

build is outdated then

404UserNotFound
02-11-2017, 15:00
build and gamedata are 404

no...i'm 404