Garry's Mod

Garry's Mod

60 ratings
Custom Gmod Bot
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: NPC
Addon Tags: Fun
File Size
Posted
Updated
589.304 KB
Apr 30, 2023 @ 8:48am
Nov 17, 2024 @ 2:10pm
10 Change Notes ( view )

Subscribe to download
Custom Gmod Bot

Description
This mod is in *Beta*, there will be bugs, but constant updates with new features and fixes.

Special thanks to Zenlenafelex [PSF] for helping me with the pathfinding code for the bot.

Why I made this mod
I made this because I usually have to play Gmod alone and I also wanted to see what I could do with the nextbot system. This is also a base bot addon, I will use this addon to make bots for other gamemodes.

The addon was originally posted on GitHub: https://github.com/T-Rizzle12/Custom-Gmod-Bot
Link to addon Wiki: https://github.com/T-Rizzle12/Custom-Gmod-Bot/wiki

Basics on how to use this addon's console commands: https://github.com/T-Rizzle12/Custom-Gmod-Bot/wiki/Getting-Started

Commands
CommandName, CommandParameters, Example
TRizzleCreateBot botname followdist dangerdist meleedist pistoldist shotgundist rifledist healthreshold combathealthreshold playermodel spawnwithpreferredweapons
- TRizzleCreateBot Bot 200 300 80 1300 300 900 100 25 alyx 1
TRizzleBotCreateMenu
- Opens a derma menu that assists with creating a TRizzleBot.
TRizzleBotRegisterWeaponMenu
- Opens a derma menu that assists with registering a weapon.
TBotSetFollowDist targetbot followdist
- TBotSetFollowDist Bot 200
TBotSetDangerDist targetbot dangerdist
- TBotSetDangerDist Bot 300
TBotRegisterWeapon targetbot weapon weaponType hasScope hasSecondaryAttack secondaryAttackCooldown maxStoredAmmo ignoreAutomaticRange reloadsSingly
- TBotRegisterWeapon Bot weapon_crossbow Sniper true false 30.0 12 false false
TBotAddPreferredWeapon targetbot weapon
- TBotAddPreferredWeaponBot weapon_crossbow
TBotRemovePreferredWeapon targetbot weapon
- TBotRemovePreferredWeapon Bot weapon_crossbow
TBotClearPreferredWeaponList targetbot
- TBotClearPreferredWeaponList Bot
TBotSetMeleeDist targetbot meleedist
- TBotSetMeleeDist Bot 80
TBotSetPistolDist targetbot pistoldist
- TBotSetPistolDist Bot 1300
TBotSetShotgunDist targetbot shotgundist
- TBotSetShotgunDist Bot 300
TBotSetRifleDist targetbot rifledist
- TBotSetRifleDist Bot 900
TBotSetHealThreshold targetbot healthreshold
- TBotSetHealThreshold Bot 100
TBotSetCombatHealThreshold targetbot combathealthreshold
- TBotSetCombatHealThreshold Bot 25
TBotSetPlayerModel targetbot playermodel
- TBotSetPlayerModel Bot alyx
TBotSpawnWithPreferredWeapons targetbot 1 or 0
- TBotSpawnWithPreferredWeapons Bot 1
TBotSetModelSkin targetbot desiredskin
- TBotSetModelSkin Bot 1
TBotSetModelBodyGroup targetbot row number
- TBotSetModelBodyGroup Bot 0 0
TBotSetDefault targetbot
- TBotSetDefault Bot

ConVars
TBotSpawnTime
Default: 6.0
This is how long a bot must be dead before it can respawn.
TBotLookAheadRange
Default: 300.0
This is the minimum range a movement goal must be along the bot's path.
TBotSaccadeSpeed
Default: 1000.0
This is the maximum speed the bot can turn at.
TBotAimError
Default: 0.01
This is the maximum aim error the bot can have. This only affects the bot while it is trying to aim at an enemy.
TBotGoalTolerance
Default: 25.0
This is how close the bot must be to a goal in order to call it done.
TBotAttackNextBots
Default: 0.0
If nonzero, bots will consider every nextbot to be it's enemy.
TBotAttackPlayers
Default: 0.0
If nonzero, bots will consider every player who is not its Owner or have the same Owner as it an enemy.
TBotBallisticElevationRate
Default: 0.01
When lobbing grenades at far away targets, this is the degree/range slope to raise our aim.
TBotCheaperClimbing
Default: 0.0
If nonzero, bots will skip the expensive ledge jumping checks, only set this nonzero if you have to as it may cause the bot to get stuck.
TBotRandomPaths
Default: 0.0
If nonzero, the bot will pick random paths when pathfinding to a goal. It is not recommended to use this.

Current Features
- The bot is a player bot
- The bot can use ladders
- The bot has "smooth aiming" (Bot won't instantly aim at enemies)
- The bot can open doors
- The bot has an LOS, "Line of Sight," and can't see behind itself
- The bot remembers enemies it has seen recently
- The bot can "hear" noises created by enemies
- The bot will use its flashlight when in a dark area
- The bot will attack any NPC that is hostile them and its "owner" (The player that created it)
- The bot, if it has a medkit, will heal itself and any players nearby it, although the bot's owner is prioritized.
- The bot can enter the vehicle the bot's owner is in. This includes most modded vehicles and chairs. See "Issues"
- Support for most custom/modded weapons.

Bot Cheats
I know what you are thinking, but these are needed to make the bot fun and easy to use.
- The bot will slowly regenerate ammo for its weapons when not in combat. This prevents the player from having to "give" the bot ammo or it having to be programed to "find" ammo. (Collect it from dead enemies)

Issues
- The bot doesn't know if a Nextbot is hostile or friendly.
- The bot has very basic driving support.
- The bot can't tell the difference between projectile and tracer, "bullet," weapons.

Planned Features

Help Wanted
I’m currently working on guide for how to make a proper navmesh and it would be nice to get some help creating it.
You can see what I need help with on this addon’s GitHub: https://github.com/T-Rizzle12/Custom-Gmod-Bot/issues/32
Popular Discussions View All (2)
1
Jan 18 @ 1:13pm
lambda bug
loganbarron
4
Dec 25, 2024 @ 6:29pm
PINNED: Issues (Unofficial)
Asdwasdasdas43
139 Comments
T-Rizzle  [author] Apr 18 @ 7:35am 
@Cereal
For changing the owner, that can be done. As for the mod, I can look into it, might be a fun side project.
Cereal Apr 18 @ 7:16am 
Cereal Apr 18 @ 6:25am 
T-Rizzle, can you make it so you can change the owner of the bot, it not mattering who spawned it?
T-Rizzle  [author] Apr 15 @ 4:33pm 
@upn240
I liked playing nZombies unlimited. I can look into making another version capable of playing it. “This addon is a bot base.” Although, I have been very busy lately so this may not happen for a while.
upn240 Apr 15 @ 4:30pm 
Dang.
T-Rizzle  [author] Apr 15 @ 4:24pm 
@upn240
I’m afraid the bots don’t have support for that Gamemode, although I can.
upn240 Apr 15 @ 4:14pm 
How do you make the bots Ready on nZombies Rezzurection. How.
EthanRailStudios Jan 26 @ 3:43pm 
how do you make the bots go against you? For example if you wanna do a 1v1 against a bot
T-Rizzle  [author] Jan 25 @ 10:10am 
@Cereal
Among us gamemode, hmm....it is possible since the bots are based off of the Player Class in the Engine, but I would need to make sure the bot acts realistic without being total idiots. This probably wouldn't be possible until I create a better text chat system for the bots, but I will reiterate THIS IS POSSIBLE.

As for NextBot run, that wouldn't be too hard to do actually. Although, It may be in another addon that requires this one. If you could go onto the addon's GitHub https://github.com/T-Rizzle12/Custom-Gmod-Bot and create issues regarding these additions, that would help me remember to add them in the future.
Cereal Jan 25 @ 12:49am 
add support to nextbot run and among us gamemode