DrVrej / VJ-Base

An addon for Garry's mod that contains bunch of bases to make many different types of addons.

Home Page:http://steamcommunity.com/sharedfiles/filedetails/?id=131759821

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VJ Base RPG cannot hit shots at air NPCs

Jandro22 opened this issue · comments

The VJ Base RPG cannot connect/hit rockets when firing at air NPCs. A similar issue was found in the game itself a few years ago:

Facepunch/garrysmod-issues#3725

To quote the original report that fixed the default RPG:

"Citizens fire rockets away from gunships
In Half-Life 2, there is some leftover code for citizens to try to maneuver their rockets around npc_combinegunships to avoid getting shot down. I think this code is broken to begin with, but it's designed to be used with the RPG's laser guide, which citizens in Gmod don't use. (I assume there's a good reason for that unless it's just disabled by default) As a result, citizens almost never hit gunships with their rocket launchers, even if they're looking directly at one. This probably wouldn't be encountered in a regular Sandbox session since citizens don't attack gunships by default, but it's still a big issue for trying to get citizens to shoot down gunships in a NPC battle or something.

In Source 2013, the code for this can be found in CNPC_Citizen::GetActualShootPosition(). They do not use this behavior against hunter-choppers or dropships."

The VJ Base RPG, when given to a VJ Base NPC, seems to have the same issue as described here, but also extended to all other non-humanoid air NPCs (hunter chopper, dropship, gunship)

This could in fact be a separate issue that can't be fixed via the method used to patch the game itself, but nevertheless still exists

As a side note, the VJ Base RPG also seems to activate the explosion vfx when hitting the skybox, when the normal RPG does not

Tested with HL Resurgence NPCs

This is a long running issue and unfortunately no one has been able to find a proper fix without causing performance loss, such as running traces or radius search. This is an issue that should be fixed through the engine itself, until then I will be happy to apply a fix if someone figures out a way to do it without losing performance.

For the skybox explosion, it was up for debate previously in a Discord discussion. I got input from a lot of people that use VJ Base and majority agreed it's not worth the performance loss since some NPCs fire dozens of projectiles. To check if it hit an skybox, we have to run a trace, which is not something we want to do unless it is important. You can see how Valve did it for the HL2 rocket: Here, so for now I will leave it as it is.