UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Play animations on viewmodel weapon?

broken avatar :(
Created 10 years ago
by Linoxet
0 Members and 1 Guest are viewing this topic.
5,954 views
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Can I play an animation on the player current weapon by script? Not a "default" animation like reload, fire, etc.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Not really able to play your own unless you make a delta view model animation but that's difficult for everyone.
Marked as best answer by Linoxet 10 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Can I play an animation on the player current weapon by script? Not a "default" animation like reload, fire, etc.

You can make a new weapon and change the animations used for that weapon.

But if you mean play an animation on the current viewarms holding the current weapon, the easiest way I achieved that was through additional weapon files with different fire and reload anims. I would forceviewmodelanimation on the other weapon file. Settings get tricky.

But an easier way to do that with a weapon file is to just make the weapon file an alt of the weapon, and in the alt animation you put the animation you want to play. You would script it to switch back, and this wouldn't work with weapons that had alt weapons already very easily. Plus you have some menu editing for the alt image and counter to not display.
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
You can make a new weapon and change the animations used for that weapon.

But if you mean play an animation on the current viewarms holding the current weapon, the easiest way I achieved that was through additional weapon files with different fire and reload anims. I would forceviewmodelanimation on the other weapon file. Settings get tricky.

But an easier way to do that with a weapon file is to just make the weapon file an alt of the weapon, and in the alt animation you put the animation you want to play. You would script it to switch back, and this wouldn't work with weapons that had alt weapons already very easily. Plus you have some menu editing for the alt image and counter to not display.

Thanks, my idea is to play that "shaking" animation on the portal gun when you get your portals deleted. I'll do what you said :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I don't know what that is, but would maybe earthquake work for that? It shakes your whole screen... Or is it like an actual shaking of the gun or something?

If you use the alt weapon thing, just freeze switching, switch to alt weapon, wait for it to be done anim, and switch back, and un freeze, I would think. You will have to add checks for it though, maybe with a waittill_any for weapon changes and complete weapon changes in a loop to make sure it doesn't get stuck, and doesn't get given back when they are downed or something.
Last Edit: February 19, 2016, 05:58:06 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
I don't know what that is, but would maybe earthquake work for that? It shakes your whole screen... Or is it like an actual shaking of the gun or something?

If you use the alt weapon thing, just freeze switching, switch to alt weapon, wait for it to be done anim, and switch back, and un freeze, I would think. You will have to add checks for it though, maybe with a waittill_any for weapon changes and complete weapon changes in a loop to make sure it doesn't get stuck, and doesn't get given back when they are downed or something.

Just a quick shake of the gun, thanks for the tip :D
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
Just a quick shake of the gun, thanks for the tip :D

Could maybe use just the dvars cg_gun_x/y alternatively very quickly to simulate the viewmodel moving from side to side?
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Could maybe use just the dvars cg_gun_x/y alternatively very quickly to simulate the viewmodel moving from side to side?

How could I use that?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I've heard that is a host only dvar, is that true?
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
How could I use that?

I don't script, but I made this little function for a gun before to move it back a bit -

Code Snippet
Plaintext
function name()
{
while(1)
{
currentweapon = self GetCurrentWeapon();
if( ( currentweapon == "portalgun" || currentweapon == "portalgun_upgraded" ) )
{
self setClientDvar( "cg_gun_z", -1.5 );
}
else
self setClientDvar( "cg_gun_z", 0 );
wait .1;
}
}

So you could basically add some checks for when a portal is closed and if the player is holding the Portal gun, then for example set the dvar "cg_gun_x", -2, then a wait of like 0.1, then "cg_gun_x", 2 (or w/e values, that might be too much) and repeat as necessary. That should make the viewmodel (and hands) look like they are moving quickly from side to side I'd imagine.

I've heard that is a host only dvar, is that true?

That I don't know actually, I assumed it was level wide but I could be wrong.
Last Edit: February 19, 2016, 07:44:10 pm by steviewonder87
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Really thanks, saved me from doing another animation on maya  :troll:
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
Really thanks, saved me from doing another animation on maya  :troll:

Idk how it is supposed to look (never played any of the Portal games) but honestly I think MakeCents suggestion about using 'earthquake' is the simplest and best solution.
broken avatar :(
×
broken avatar :(
Location: br
Date Registered: 10 December 2013
Last active: 4 years ago
Posts
159
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Linoxet's Groups
Linoxet's Contact & Social LinksTutizillalinoxetbanguela
Idk how it is supposed to look (never played any of the Portal games) but honestly I think MakeCents suggestion about using 'earthquake' is the simplest and best solution.

Portal is one of the best games ever  ;D


This "shaking" anim
broken avatar :(
×
broken avatar :(
Remington R5
Location: gbBarnsley
Date Registered: 18 January 2015
Last active: 5 years ago
Posts
742
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
paypal.me/RT275
Signature
paypal.me/RT275
×
Rorke's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Rorke's Contact & Social Linkswormnationhickle.meddowsandrewshaworiginal_rorke
I often wonder how dual mags would be done so its not "bottomless"

 
Loading ...