Learn how to use the Command Center in Pixel Starships to program AI for your rooms and crew. Maximize your ship's strategy and efficiency with this guide.
So, you're looking to automate your ship and get your crew working smarter, not harder? That's where the Command Center comes in! It's a pretty crucial Support room that unlocks at Ship Level 4, and it's your gateway to programming AI for your rooms and crew. This opens up a whole new level of strategy for both offense and defense, and it's really the first step towards building a truly competitive ship.
### Mechanics
First things first, to even start programming AI, you'll need the Command Center installed on your ship. You won't see that 'Edit AI' button otherwise. Now, here's a little trick: once you're done coding your AI, you can actually remove the Command Center itself, and the AI will keep running just fine. So, it's a good idea to remove it after you've set up your programs to free up that space.
The Command Center gives you a limit on how many lines of AI script you can use. Upgrading the Command Center will increase this limit, capping out at 30 lines at its highest level. If you ever find yourself needing more lines (which is pretty rare!), there's a way to get an extra 25 lines. You can do this by purchasing the Computer Room when it pops up as a Special Offer. This can be a neat strategy if you want to stay at a lower ship level for a while but need more AI lines than your current Command Center provides.
### Programmable AI
It's important to know that the Command Center itself doesn't *create* the AI commands; that's the job of Python. But since they're so closely tied together in the game, we'll cover the AI commands here.
Below, you'll see icons that show what's needed to use certain AI commands:
| Icon | Prerequisite |
|---|---|
| [](https://pixelstarships.fandom.com/wiki/None "None") None | None |
| [![Room]()](https://pixelstarships.fandom.com/wiki/Room "Room") Weapon Rooms | Requires a Weapon Room |
| [![Power]()](https://pixelstarships.fandom.com/wiki/Power "Power") Powered Rooms | Requires a Powered Room |
| [![Ammo]()](https://pixelstarships.fandom.com/wiki/Ammo "Ammo") Built Ammo | Requires Built Ammo |
| [![Crew]()](https://pixelstarships.fandom.com/wiki/Crew "Crew") Crew | Requires Crew |
| [![PoisonGas]()](https://pixelstarships.fandom.com/wiki/PoisonGas "PoisonGas") Crew Ability | Requires Crew Ability |
### AI Conditions
Here are the conditions you can use to trigger your AI scripts. Use Ctrl + F (or Command + F on Mac) to search for keywords if you need to find a specific one quickly!
| AI Condition | Prerequisites |
|---|---|
| None | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Current HP < 100% | [![Crew]()](https://pixelstarships.fandom.com/wiki/Crew "Crew") |
| Friendly Room HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Engine HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Engine HP < 50% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Lasers HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Lasers HP < 50% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Missile Room HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Missile Room HP < 50% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Reactor HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Reactor HP < 50% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Shield Room HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Shield Room HP < 50% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Ship has Active Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Ship has Full Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Ship has no Active Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Ship has Full HP | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Your Ship HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Engine Room HP > 0% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Laser Room HP > 0% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Missile Room HP > 0% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Reactor HP > 0% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Shield Room HP > 0% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Room HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Ship has Active Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Ship has Full Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Ship has no Active Shield | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Ship has Full HP | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
| Enemy Ship HP < 100% | [![None]()](https://pixelstarships.fandom.com/wiki/None "None") |
### AI Actions
These are the actions your AI can perform. Remember to check the prerequisites!
| AI Action | Prerequisites |
|---|---|
| Target Condition Room | [![Crew]()](https://pixelstarships.fandom.com/wiki/Crew "Crew")[![Room]()](https://pixelstarships.fandom.com/wiki/Room "Room") |