Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HoloAnim on TF2 sentry #29

Open
adosikas opened this issue Nov 29, 2014 · 6 comments
Open

HoloAnim on TF2 sentry #29

adosikas opened this issue Nov 29, 2014 · 6 comments

Comments

@adosikas
Copy link
Contributor

adosikas commented Nov 29, 2014

Enabling the fire animation not only flips the holo by 90 degrees, but also resets the facing set by holoSetPose, which makes it basicly pointless to use.

holoCreate(1,entity():pos(),vec(1,1,1),ang())
holoModel(1,"models/buildables/sentry3.mdl")
holoAnim(1,"fire")

(This affects all 3 levels of the sentry, but not all animations)
Is this something that can be fixed here, or is it how the model gets read by GMod? In TF2 it obviously works.

@thegrb93
Copy link
Contributor

Probably something in the holoAnim function causing it.

@thegrb93
Copy link
Contributor

@thegrb93 thegrb93 self-assigned this Jan 21, 2019
@thegrb93
Copy link
Contributor

@thegrb93 thegrb93 removed their assignment Feb 2, 2019
@Deboggle
Copy link

Deboggle commented Sep 16, 2021

Been working on this very briefly, but it seems that even with using AddGesture/AddGestureSequence poses still don't work as the gesture still overrides them.
I'm really not experienced much in GLua so I don't know if there's something that I've missed, but I get the nasty feeling that this is a limitation within Garry's Mod and the way it handles animations and poses rather than just using Gestures instead of Sequences.
Using AddGesture instead of ResetSequence yields the same results; the animation overrides the poses, regardless if the pose is set before, during or after the animation has played.

For reference, I modified lines 37-40 in the holoanim.lua as shown:

local gesture = Holo.ent:AddLayeredSequence(Animation, 1)
Holo.ent:SetLayerCycle(gesture, math.Clamp(Frame,0,1))
Holo.ent:SetLayerPlaybackRate(gesture, math.Clamp(Rate,0,12)) 

@thegrb93 You seem to be very knowledgeable in GLua - any ideas?

@thegrb93
Copy link
Contributor

There's a glua addon for Tf2 turrets that I read the code from. I'd suggest looking at that to see how it's done.

@Deboggle
Copy link

Deboggle commented Sep 16, 2021

I can't seem to find anything like that addon you mentioned despite a fair amount of digging - most addons I can find are just based off a generic standing turret NPC base and just have a remodel or visual change or whatever.

I had a quick look at Valve's own turret code, and whilst that is in CPP, the basic functionality is that it uses SetActivity which handles all the animations and sequences for the base turret NPC, a function which naturally is only callable on NPCs, though internally it should use the same functions for playing sequences so I don't see how it shouldn't work the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants