Alright let’s do this. Its time to mod the squad.
In this first tutorial we’re going to learn how to issue commands to BombSquad as it is running, which is very useful for modding and tinkering purposes.
What you’ll need:
- BombSquad version 1.3.15 or newer (the version number is visible at the bottom right of the screen when you launch the game) Grab an update from the Mac/OUYA/etc app store if you’re out of date.
- Python scripting knowledge. BombSquad’s game logic is written in Python, so you’ll need to be familiar with the language. It’s pretty nifty and useful outside of the game too; go to python.org to learn about it. BombSquad uses Python 2.7.
Option 1: The In-Game Console
If you are running BombSquad on Mac, Windows, or Linux, you can simply press backquote (`) or F2 to bring down the system console which will let you issue Python commands directly to the game. This is convenient, though functionality is a bit basic at the moment (no copy/paste, etc). For that reason you may still want to opt for option 2 even on these OSs.
Option 2: Telnet
The second option for talking to BombSquad is via a telnet client from your Mac/PC/etc. This is handy when you’re running BombSquad on a machine without a keyboard attached, such as an OUYA. Macs and Linux machines should have command-line telnet clients installed already; on Windows you may have to download a client such as ‘Putty’. Note that BombSquad’s telnet support is pretty rudimentary, so you may need to configure your client to connect in the most simple way possible to avoid strange errors.
Telnet Step 1: Find the game host’s IP address
We’ll need to know where to connect our telnet client to. If you’re running BombSquad on an OUYA, go to MANAGE->SYSTEM->CONSOLE INFO to find its IP Address. If you’re running BombSquad on the same machine you’ll be telneting from, you can just use ‘localhost’ as your address.
Telnet Step 2: Connect
Make sure BombSquad is running on your OUYA/Mac/etc, and then open a terminal on your computer and type the following to connect to the game, replacing ‘192.168.1.5’ with the address you found in the previous step:
telnet 192.168.1.5 43250
This will attempt to establish a telnet connection to the game on port 43250. If this works, you should see a message pop up on your BombSquad game asking if you want to allow the telnet client to connect. Hit ‘Allow’.
You should now see a prompt such as this:
Ok, you’re connected; now say hello.
At this point you can enter python commands for the game to run. As an example, type the following and hit return:
This will print a list of everything in the ‘bs’ module, which contains bombsquad’s core functionality. To learn more about something, you can use the builtin Python help. For instance, type the following to learn about the ‘bs.screenMessage’ function:
As you can see via help, this function lets us print stuff to the screen. Let’s give it a whirl by typing the following:
When you hit return you should see that message pop up in BombSquad. Ta-da!
And that’s it for our first tutorial. In the next tutorial we’ll build on that by looking at BombSquad’s internal scripts and starting to modify them for our nefarious purposes. Cheers!