This AI is still in early stages of development.
Babel on Warzone 3.1
- Aubergine
Overview
Babel fills any cracks it finds in the JS API, meaning that it will run fine without modification on Warzone 3.1.
Obviously, because Warzone 3.1 doesn't have chat() and eventChat() features, no messages will be sent or received – this is actually quite useful if you want to test what happens when nobody replies to messages sent by your AI
Constants
Some Warzone 3.1 releases don't provide all the JS API constants or object .type properties that Babel API requires, so it fills the cracks as and when it finds them.
The following constants and applicable missing .type properties are dealt with should Babel stumble upon them:
Fake Chat
Babel's tower is built on the chat() function, so it's a bit of a problem if it's not found!
Babel creates a fake chat function that works as follows:
- If the "to" parameter is me, eventChat() will be called as if the message you're sending has just been received from someone else.
- Otherwise, the message you're sending will be echoed to the console().
Should you need to, you can check if the chat() function is fake as follows:
if (chat.name == "fakeChat") { // chat messages won't get sent! }
Contents
Jump to:
Babel API
Topics:
- Data types — Babel supports most types of data...
- Error Dialect — A specific dialect for reporting errors within Babel...
- Babel on Warzone 3.1 — Babel handles Warzone 3.1 gracefully...
- Position-like Objects — If your data has {x, y} properties, Babel treats it like a Position object...
- chat.toBabel() — Compiles a Babel format message, ready for sending to your AI buddies...
- chat.isBabel() — Quickly determine if a received message is in Babel format...
- chat.fromBabel() — Converts a Babel format message in to an array...
- Handling Dialects — Some ideas on how to handle multiple dialects...