Commander A.I. Version 1.7.1
Requires AMXModX 1.9 or higher
Original Author: Seather (Original Post)
Created by: CapITanJAC & Sandman[SA]
Special thanks: Noshadow & Random1, for providing extra code.
About: This plugins takes the place of a player commander, where the buildings spawn and weapons are dropped automatically. Optional features include: a resupply system (Noshadow), and alien buff.
This new version adds:
REAL player upgrades
Fluid Console variables
bug fixes
new effects
Version history:
Spoiler
Version 1.0 : Initial Release
Version 1.1 : Added health and ammo delivery
Added JP and HA delivery when protolab is built
Added dispensing of weapons when armory is built
Fixed plugin not disabling on combat maps
Fixed CVAR to enable/disable commai
Version 1.2 : Added advanced turretfactory when TF is built
Fixed bug that caused TF and Res to not electrify
Version 1.3 : Bugfix + various optimizations
Updated to support AmxmodX 1.8.1
Version 1.4 : Fixed crashing issue. Error: backward mins/maxes
Fixed bug that caused sieges to fail to activate if siege was built first
Added medpack call support
Added ability to pause commai when player enters comm chair
Fixed plugin not disabling on combat maps, again
More optimizations
Version 1.5: Added commander bot mode, spawn mode, and alien buff cvars
Alien buff: adds res every time an alien (or bot) dies.
30 res for 1 hive
20 res for 2 hives
10 res for 3 hives
*can be disabled using the cvar amx_commai_alien_buff_mode 0*
Changed methods to only work with bots so that REAL players are not affected while on marines
Added spawn effects like a real commander is dropping the buildings.
Tweaked the timing, so the buildings drop like a human would. further tweaking with cvar.
Optimizations for bots.
Version 1.6: Added pseudo-res bank and cost system. Uses res like a human.
Added whole new res cost system. buildings/upgrades etc...
Added cvars for electrifying and upgrading buildings for more flexibility.
Added cost for resupply option.
Fixed bug where resupply would not always work.
Added catalyst to resupply
Added pseudo upgrade system
Added regenerating armor like Nano armor from Extralevels 3
Changed Alien buff so that Aliens get res passively. (Limit 50 res, 100 for gorges).*Can be reverted to older style.
Added vote for CommAI at start of round
Cleaned up code
Version 1.7(5/13/2022): Added New weapon res reserve for marines
Added random angle for buildings like player commander
Added REAL upgrade system
Fixed advanced Turret Factory upgrades not working consistently
Added advanced Armory upgrade for advanced weapons
Changed Console Variables for readability
Removed varied resource gains
Version 1.7.1: Added upgrade animations for buildings
Bug fixes
CVARS
Code:
AI Command mode (amx_commai_comm_mode)
disabled, enabled, only weapons
hybrid: disabled when human is in command.
always: enabled whether or not human is in command.
default: hybrid
Resources management system (amx_commai_cost)
Makes buildings, upgrades, health, and weapons cost resources
disabled, enabled
default: enabled
Automatic Turret Factory Upgrade system (amx_commai_upgrade_tfs)
disabled, enabled
default: enabled
Automatic Electrical Defense systen (amx_commai_electrify_buildings)
disabled, enabled, RTs only, TFs only, both RTs and TFs, or all buildings.
default: both
Mode (amx_commai_electrify_mode):
One: Electrify one building at a time.
All: Electrify all eligble buildings at once.
default: one
Weapons, health & ammo
Players can spawn with random weapons (amx_commai_weapons)
disabled, enabled, or bots only
default: enabled
Psudo-resupply for NS (amx_commai_resupply)
disabled, enabled
default: enabled
time in between resupply (amx_commai_resupply_time)
default 5.0
Armor regeneration for NS (amx_commai_armor)
Armor regenerates half of resupply time
disabled, enabled
default: enabled
Aliens
To make up for resupply; aliens now get free resource buff (amx_commai_alien_buff_mode)
resources are gained gradully up to 50 (gorges 100) over time based on how many hives there are.
disabled, enabled
old: resources are added upon death based on hard-coded numbers.
default: enabled
1HIVE 30.0
2HIVE 20.0
3HIVE 10.0
Special Effects
Particals and sounds for :(amx_commai_effects)
Building spawns
Building spawn angles
building upgrades
electricity
Health/ammo spawns
Advanced Turret Factory Upgrade
disabled, enabled.
default: enabled
Random Delay in building spawns and supply distribution (amx_commai_delay)
Number is multiplied by the random factor of time.
Base is 1 - 5 seconds
default: 1.0
CMD amx_commai_restart For debugging amx_commai_save (admin 'A' required)
How to Use
Spoiler
I recommend that you have an empty listen server with only this plugin loaded.
To save building types and locations place any building(s) (*NOTE* all Resource Towers are built automatically). When you are satisfied with the result run 'amx_commai_save'. Doing so will save a .cmai file in the 'data' directory with all of the buildings in this order: