Garry's Mod

Garry's Mod

Rebel Enemy Animation Fix
46 Comments
ColdMoon  [author] 11 Jul @ 3:43am 
I added a limit so it only loops up to 10 times, so it won't keep generating the problem endlessly anymore.
ΆΛΦΑ 11 Jul @ 2:57am 
@Coldmoon it does appear every 10 to 15 sec, but i've had instance where it appears every 5 seconds
ColdMoon  [author] 10 Jul @ 5:34pm 
@ΆΛΦΑ That is a dummy used to obtain the activity ID. It will be removed once the ID is retrieved. If you notice this message appearing roughly every 15 seconds, please let me know—that means the code is failing to retrieve the ID correctly and is stuck in a loop.
ΆΛΦΑ 10 Jul @ 10:07am 
WARNING ! this addon causes the following error NPC npc_combine_s stuck in wall--level design error at (-128.00 -576.00 -22286.15) it spawns a combine NPC at random location outside the boundaries of maps which can make your game lag due to console overload
ColdMoon  [author] 10 Jul @ 12:05am 
@Male_09 Not for the gmod's default one.
Male_09 9 Jul @ 2:58pm 
who even has this error? is this supposed to be for garry's mod default hostile rebel or for addon ones? since gmod's default one is just a rebel that was coded to be an enemy, so it shouldnt shove when youre too close or dance when hit by bugbait.
ColdMoon  [author] 9 Jul @ 3:06am 
@Twilight They might use player animation, If there were sound effects when they reload. That means it really was this addon that fixed their inability to reload. But the root cause of the problem is that the NPC model creators didn’t properly apply the correct NPC animations during development—they just lazily used player animations instead.
Twilight 8 Jul @ 11:45am 
i have a problem with the npc's using the ar2 they can fire the weapon but T-pose after they use all the ammo and subscribed to this addon it fixed it somewhat but they still kinda do the T-pose and the reload animation looks all weird any idea why this happens? if anyone else has this issue how can i fix it?
ColdMoon  [author] 3 Jul @ 3:29am 
@Qöuji melee_fix_else 0 to turn off melee fix for npc_citizen and npc_metropolice
Qöuji 2 Jul @ 7:05pm 
causes occasional big lag spikes when there are many npc_citizens on the map
Twilight 27 Jun @ 3:11am 
this only somewhat fixes the ganyu, nilou & shenhe alternate outfits for the genshin alternate outfits they still sorta do the T-pose sad cause those 3 are my favorite characters
reecha1234567890 2 Jun @ 8:54pm 
Thank you for this
xFreemanEmer 8 May @ 4:55am 
Excellent addon, you deserve an award...
geoffreyallen1007 22 Apr @ 4:25pm 
how did u get it to be ur player modli
nope 21 Apr @ 2:37pm 
@ColdMoon sorry. i realized now this was just addon conflict. thanks for reply.
ColdMoon  [author] 21 Apr @ 1:10am 
@nope this addon disables crouching for the rebel enemy because it is highly error-prone. Rebel enemies should never crouch at all. Which NPC are you using? Give me a link so I can check it out.
nope 20 Apr @ 11:02pm 
when npc's holding shotgun, they will T-pose when crouch shot pose.
ColdMoon  [author] 17 Apr @ 8:20pm 
@Selever-天空皇帝束缚者 shotgunreplace 0 to turn it off, rebel enemy shotguner always stand still, will find a way to fix in the further, now replace their weapon instead.
strangely when you choose shotgun as npc‘s weapon it will become smg or pulse rifle
good
Ty4a 17 Apr @ 4:15am 
great
ColdMoon  [author] 17 Apr @ 4:12am 
@Ty4a I followed your advice and made the changes you suggested. Thanks for your guidance.
Декстер Морган 17 Apr @ 3:30am 
THANK YOU!
Ty4a 16 Apr @ 2:36pm 
Also you can use metatable optimization

local meta = FindMetaTable("Entity")
local GetPos = meta.GetPos

then GetPos(ent) is faster
Ty4a 16 Apr @ 2:35pm 
Use caching
Ex:
local CVar = CreateConVar(...)

CVar:GetBool()

or you can use cvars.AddChangeCallback

also create table for npcs and from hook EntityCreated EntityRemoved (as I remember) remove/write npc to table, its replacing finding entities in think hook

Use local pos = ent:GetPos() ; local wep = ent:GetActiveWeapon()

:steamhearteyes: good luck
ColdMoon  [author] 16 Apr @ 1:21pm 
The Think hook is optimized by only check when NPC activity changes, old one check every frames and cause lag
Ty4a 16 Apr @ 1:07pm 
I don't have any lags, but after reading the comments I checked the code and it turned out to be completely unoptimized :P
ColdMoon  [author] 16 Apr @ 1:04pm 
Maybe my PC configuration is pretty good, I will test it on my poor laptop and try my best to optimize
Ty4a 16 Apr @ 12:33pm 
useful, but code isn't really optimized
Oh no 15 Apr @ 10:09pm 
1 frames per sometimes
Oh I found it has some conflict with wos animation instead of the model problem
ColdMoon  [author] 15 Apr @ 2:01am 
@Selever-天空皇帝束缚者 That doesn't happen to me, which NPC are you using? Give me a link so I can check it out.
Why doesn‘t their melee attack cause any damage
Sam the big Toucan 14 Apr @ 5:42pm 
Nice fix, but tf is that npc bruh....
CherryBlossom 14 Apr @ 12:01pm 
so useful
Newman 13 Apr @ 11:20pm 
DEHYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
MMWWVVK 13 Apr @ 6:52am 
GOOD:steamthumbsup:
ColdMoon  [author] 12 Apr @ 10:14pm 
@The Celestial Should have been solved by adding a valid check, thanks for your feedback : )
The Celestial 12 Apr @ 2:48pm 
[Rebel Enemy Animation Fix] lua/autorun/missing_anim.lua:109: Tried to use a NULL entity!
1. GetActivity - [C]:-1
2. unknown - lua/autorun/missing_anim.lua:109
I got this error on start
ColdMoon  [author] 12 Apr @ 1:45pm 
@Soldier Dink that is the dummy to get correct activity id for fixing, for some reason the code loop while it fail to get the id. Definitely not a jumpscare,I am sorry the code when wrong that way. I will change the postion where the dummy spawn.
Soldier 12 Apr @ 1:26pm 
for some reason, this addon started creating a burning npc_combine_s entity directly on the player before immediately being deleted and repeating. what??
ColdMoon  [author] 12 Apr @ 12:53pm 
Which NPC are you using? Give me a link so I can check it out.
pep NOT!!! 12 Apr @ 11:57am 
It didnt change anything sadly
Hana 10 Apr @ 6:39pm 
Dehya Everywhere System
ColdMoon  [author] 10 Apr @ 10:54am 
They might use player animation, I add a fix function, can you try again and see if it work
pep NOT!!! 10 Apr @ 10:01am 
they t pose when they reload will you fix that too?