Product Chat / How to stop the zombies from reaching through doors and buildings?

Author
Message
RuckUp
2
Years of Service
User Offline
Joined: 30th Jun 2022
Location:
Posted: 21st Jul 2022 15:23
When the zombies are in rooms or buildings they are able to reach me and make cause player damage. I can not open a door without them being able to hit me. Please help
PM
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 29th Jul 2022 14:20
I would like to find an answer as well.
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 16th Aug 2022 02:37 Edited at: 16th Aug 2022 02:44
This comes down to the raycaster. But I'm assuming you might be able to get away with reducing the distance of melee attack and add an additional line to check if the player is actually in view. When fixing issues dealing with AI, it means unfortunately getting down and dirty into the Lua of the AI modules. The AI modules have gotten pretty complex over time, becoming harder to modify.. and even more difficult since any changes affect all the of the AI for all enemies.

Probably the area to correct this issue is around here, in module_combatcore.lua:

module_combatcore.detectplayer(e,AIObjNo,PlayerDist,CanFire,detectstate,combattype)
if (PlayerDist < AIGetEntityViewRange(AIObjNo) and (g_Entity[e]['plrvisible'] == 1 or ai_bot_coverindex[e] == -2)) or g_Entity[e]['activated'] == 2 then

I dont like to mess about the AI much myself since it turned into modules. I still use some of the much older AI scripts which were unique per character type. Easier to modify. But they also come with legacy issues.

If you are changing any of the stock scripts for experimenting, make sure to make a backup first.
Store Assets - Store Link
Free Assets - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-11-21 12:23:56
Your offset time is: 2024-11-21 12:23:56