Project Zomboid

Project Zomboid

Braven's NPC Framework
Showing 1-9 of 9 entries
Update: 19 Apr, 2024 @ 6:15pm

Version 1.8.0

Timer Improvement
Whenever the framework must delay events for a certain amount of time, this timer will no longer be tied to the game's framerate, which prevents it from running faster if the Player is running the game at higher than 60 FPS.

NPC Saving
The framework will now ONLY save NPC data when the Player quits the game normally. This addresses the issue with NPCs becoming naked sometimes when you sleep due to data overlapping, but now, of course, if the game crashes, the NPC will still reset.

KI5 Vehicle Fix
Whenever an NPC enters a Vehicle now, the framework will make the NPC invisible, thus the NPC will no longer be out of the vehicle regardless of whatever odd reason KI5's vehicles specifically caused that to happen.

Update: 13 Dec, 2023 @ 11:39pm

Version 1.7.0

Essential NPCs
You can now tag any NPC as Essential by using the property "isEssential".
This will make it so when the NPC gets to very low HP, they will be downed for some time, and then gradually recover, instead of outright dying.

Sadly, the NPCs become invisible when downed. I cannot prevent that, but they will return to normal after recovering.

No Needs
You can now make it so an NPC doesn't have needs, like hunger, or tiredness, by using the property "noNeeds".

Bug Fixes
  • Fixed ultra fast attack speed for certain melee weapons (Weird Vanilla mechanic 🙄)
  • Hid non invincible NPCs getting wound items (ANOTHER weird Vanilla mechanic?! 🙄).
  • Fixed errors when an NPC attempted to equip a backpack at game start.
  • Fixed a bug with ranged weapon sounds being delayed.
  • Fixed errors when an NPC needed to be teleported to the Player from very afar.

Update: 28 Nov, 2023 @ 2:49pm

Version 1.6.0

Vehicle Passengers
NPCs can now enter vehicles as passengers, just like in my Little Braven mod.
Notice that they still cannot drive, and likely never will, due to severe game limitations.

Properties
  • Added a new mode "Balanced" to Combat Modes.
  • Added a new property "Acknowledge Emote", which determines how (if at all) your character will react to orders.

Bug Fixes
Fixed all known bugs and issues.

Update: 27 Nov, 2023 @ 2:21am

Version 1.5.0

Command Modules
Added the module versions of the commands used in My Little Braven to the framework.
The new modules include, and manage:
  • Orders - Tell an NPC to equip or unequip an item, stop, follow, change combat stance, etc.
  • Trading - Give and take items from an NPC.

Adapt To Speed
You can now supply an argument "adaptToSpeed" (Boolean) to MyLittleUtils.DelayFunction().
This is true by default for any speech handled by the framework. Whenever DelayFunction is called with this boolean set to true, the tick rate will be calculated with the game's current speed in mind.

This basically means that if the Player speeds up the game, the framework will keep up with the new speed instead of lagging behind.
Previously, if you sped the game up, then speech would play out very slowly compared to the game speed.

Properties
  • Added the "Force Square" property, to force the framework to pick your spawn square instead of possibly an adjacent one.
  • Instead of having to provide 3 properties "hairColorR,G,B", you now provide a table hairColor { R = X, G = X, B = X }.

Improvements
  • NPCs will now correctly evade hostiles even in tight spaces, like interiors.
  • The hair color of NPCs is now completely random, if you don't set a fixed value.
  • Added a "Failure" return code if "SetupNPC" fails to fetch the NPC's stash.

Bug Fixes
  • Fixed the property "Face Obj" not working.
  • Fixed sometimes an NPC's dialogue being overriden.

Update: 24 Nov, 2023 @ 4:17pm

Version 1.4.0

Evasion Mechanic
The "flee" mechanic has been completely overhauled into an evasion mechanic!
NPCs are now much smarter about ranged engagements. They will actively scan their surroundings for the enemies.
If they feel like they cannot overpower the enemy, they will evade them until they feel they can attack again.
Additionally, they will now always run in the opposite direction.
Keep in mind this is a VERY complex mechanic and prone to the occasional failure and death of the NPC.

Improvements
  • When an NPC fires a weapon, it now emits a sound wave just like the Player.

Update: 23 Nov, 2023 @ 9:03pm

Version 1.3.0

New Function
Added the "SubscribeNPCToModules" function, which allows you to subscribe your NPC to specific functions.
That is, you can still subscribe to various modules with just one line of code, but now you can choose which ones you don't want.
Example: BB_NPCFramework.SubscribeNPCToModules(myNPCData, {false, true, false, true, true, true, false, true})

Improvements
  • Name Tags now smoothly disappear if the Player isn't looking at the NPC.
  • Greatly improved performance through caching.

Update: 22 Nov, 2023 @ 2:34pm

Version 1.2.0

Name Tag
You can now toggle whether the framework should render the name of your NPCs above their head!
This can be done through the property "Display Name", which is enabled by default, but can be disabled.

Unique IDs
When an NPC is generated through the framework, it will be given a unique ID.
This ID can be used to easily unsubscribe from any modules, and differentiate NPCs without complex data comparisons.

Changes
  • Greatly reduced the splash damage of guns.

Bug Fixes
Fixed all known bugs and issues.

Update: 20 Nov, 2023 @ 4:49am

Version 1.1.0

Flee Mechanic
You can now tell the framework to make the NPC flee in certain conditions!
This can be done through the property "Can Flee", which is enabled by default, but can be disabled.
Optionally, you can modify the property "Flee Distance" (Default is 5).
When this mechanic is enabled, if the NPC has a ranged weapon and a hostile gets too close, the NPC will flee to a nearby tile.
Do this to prevent the NPC from being overwhelmed by various zombies.

Health Regeneration
You can now tell the framework to regenerate the NPC's health passively!
This can be done through the property "RegenHealth", which is enabled by default, but can be disabled.
Admitedly, this mechanic is in place mostly to get around the limited capability of the AI while in combat.
With this mechanic, the NPC will passively regain HP, allowing them to survive for longer.

Multiple Target Attacks
When an NPC is equipped with a gun that fires more than one projectile at once, nearby zombies will take damage.
Zombies must be within 2 squares of the original target, and the damage will be significantly reduced.

New Properties
  • Ignore Bites - The NPC will instantly be healed from bites, extending their lifespan.
  • Faster Healing - The NPC will heal from wounds much more quickly.
  • Is Tough - Make the NPC be more resistant to enemy damage.
  • Dialogue String Prefix - The prefix for the dialogues. Example: "IGUI_MyNPC".
  • Aim Speed Multiplier- Makes the NPC aim (Shoot) faster or slower.
  • Infinite Ammo - The NPC won't spend ammo, or even require a magazine.
  • Resupply Ammo - The NPC will fire normally, but will never run out of ammo.
  • Is Female - Determines the NPC's gender. If not included, Male by default.
  • Speech Color - Determines the color of the NPC's speech bubble. White by default.
  • Speech SFX - The name of a sound clip to play when the NPC speaks.

Bug Fixes
Fixed all known bugs and issues.

Update: 19 Nov, 2023 @ 12:11am

PUBLIC RELEASE!