Portalgun animation question

Avatar
BenVlodgi
633 Posts
Posted Mar 30, 2012
Hey everyone,
I wanted to know if there was a way I could trigger certain portalgun animations to happen, while I was hold the gun, so I would like to know if there is a console command or some targetname + animation name I could trigger to make this happen
thanks :biggrin:
Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Mar 31, 2012
Replied 6 hours later
Technically the portal gun the player is holding is just weapon_portalgun, therefore you can trigger any outputs etc. you can do on a weapon_portalgun on the ground.
Avatar
CamBen
973 Posts
Posted Mar 31, 2012
Replied 4 hours later

chickenmobile wrote:
Technically the portal gun the player is holding is just weapon_portalgun, therefore you can trigger any outputs etc. you can do on a weapon_portalgun on the ground.

also, if you need the firing anim, just make the I/O so:

when this happens, fire orange portal 0.50

when this happens (same thing), activate an invisible fizzler/portal detecter that kills portals that is parented to the gun, in front of the gun. 0.00

Avatar
gallardo
85 Posts
Posted Sep 22, 2013
Replied 1 year later
does it still work?
I tried giving a name to the portalgun on ground, but after being grabbed, I/O dont work.
Avatar
FelixGriffin
2,680 Posts
Posted Sep 22, 2013
Replied 1 hour later
This is an old topic, but...

ChickenMobile wrote:
Technically the portal gun the player is holding is just weapon_portalgun, therefore you can trigger any outputs etc. you can do on a weapon_portalgun on the ground.

No you can't. The weapon_portalgun is destroyed and replaced by a viewmodel entity, which as far as I can tell accepts every input a prop_dynamic does EXCEPT the ones to run animations. That's why I use prop_dynamics for the Multitool; I can SetModel the viewmodel to something else, but I can't make it animate.

Avatar
gallardo
85 Posts
Posted Sep 22, 2013
Replied 36 minutes later
I was more interested in making the portalgun fire when I say so.
Parenting another one to the player? maybe, but I bet it will be difficult to pair the aim direction.
Avatar
ChickenMobile
2,460 Posts
Posted Sep 22, 2013
Replied 11 minutes later
Use a point_clientcommand in that case buddy.
Avatar
gallardo
85 Posts
Posted Sep 22, 2013
Replied 18 minutes later
thanks mr wolf
Avatar
josepezdj
2,386 Posts
Posted Sep 23, 2013
Replied 17 hours later

gallardo wrote:
thanks mr wolf

:biggrin: like in Pulp Fiction?

FelixGriffin wrote:
No you can't. The weapon_portalgun is destroyed and replaced by a viewmodel entity, which as far as I can tell accepts every input a prop_dynamic does EXCEPT the ones to run animations. That's why I use prop_dynamics for the Multitool; I can SetModel the viewmodel to something else, but I can't make it animate.

Correct, as far as I've tested the weapon_portalgun stops being so after it's grabbed by the player, becoming the viewmodel version and sort of part of the player herself... that's why I haven't ever been able to use the SetModel function with it... so, Felix, what exactly are you suggesting to use the SetModel function with the viewmodel gun?

Avatar
FelixGriffin
2,680 Posts
Posted Sep 23, 2013
Replied 2 hours later
I was playing around and discovered that typing "ent_fire viewmodel " will (unlike with most classnames) make Portal 2 suggest a list of inputs. I tried RunScriptCode self.SetModel(something); and it worked.
Avatar
josepezdj
2,386 Posts
Posted Sep 23, 2013
Replied 3 minutes later
Nice! Thanks for sharing, mate :thumbup: I'll play around with it.
Avatar
FelixGriffin
2,680 Posts
Posted Sep 23, 2013
Replied 11 minutes later
No problem. But remember that you can't embed strings in RunScriptCode, the full code I used was longer and involved calling a function added through RunScriptFile. I abbreviated for simplicity.
Avatar
BenVlodgi
633 Posts
Posted Sep 23, 2013
Replied 2 minutes later
yah, I never got this to work, if anyone has any viable solution I am still interested :smile:
Avatar
FelixGriffin
2,680 Posts
Posted Sep 23, 2013
Replied 1 hour later
Sorry, I don't think there is. VALVe didn't expose the generic SetAnimation function from the CBaseAnimating class to Squirrel, so I can check if it's finished its main animation and change its bodygroups but not start a new sequence playing. :sad:
Advertisement
Registered users don’t see ads! Register now!
Avatar
Tmast98
210 Posts
Posted Sep 23, 2013
Replied 3 hours later
Hey,

By animate do you mean the pick up/take off GLaDOS animations from the offical campaign?