Skip to main content

Madagascar TFBTool

(uses outdated assumpsions about tfbscript) Parser and decompiler for TFB script (.ai) files, as used by Madagascar - The Game (2005).

Python >= 3.12

Contents

Requirements

  • Python >= 3.12 (uses typing.override, added in 3.12)
  • UV package manager
  • Dependencies from pyproject.toml: uv sync

Usage

CLI

python -m tfbscript example_scripts/Teleporter.ai
python -m tfbscript --no-color example_scripts/*.ai

Syntax coloring is auto-detected: on for a real terminal, off when piped or when NO_COLOR is set. Force it with --color / --no-color.

As a library

from tfbscript import ScriptFile

script = ScriptFile.from_path("example_scripts/Teleporter.ai")
script.print_tree()

Thanks

A HUGE thanks to the Skylanders reverse engineering Discord server and its members, especially maff, bone and nefarioustechsupport.

Another GIGANTIC ENORMOUS thanks to all the contributors to igRewrite8, and to this fork.

Opcode coverage

36 / 36 opcodes implemented.

  • comment
  • print
  • if/else
  • for each
  • loop value
  • create variable
  • find variable
  • set reference
  • check reference
  • set value
  • check value
  • inc value
  • dec value
  • slide value
  • spawn actor
  • teleport to
  • move to
  • move from
  • displace
  • turn to
  • reset
  • play animation
  • play sound
  • stop sound
  • cut-scene
  • check message
  • send message
  • set behavior
  • check fov
  • control
  • run as player
  • find subset
  • check membership
  • change membership
  • use camera
  • remove

Needs attention / TODOs

  • spawn actor::op-code - find out purpose of remaining byte
  • displace::op-code - confirm fields

Contributing

Contributions as issues, pull requests, or any other form are welcome and wanted.

Please run pytest after changes to verify against all scripts in example_scripts/, and pyright for type checking.

Metadata

Release files for tfbscript 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfbscript 0.1.0
File Size Uploaded Provenance
tfbscript-0.1.0.tar.gz 64.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tfbscript 0.1.0
File Interpreter ABI Platform
tfbscript-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 153.8 kB

Release files / tfbscript-0.1.0.tar.gz

Download URL tfbscript-0.1.0.tar.gz
Size 64.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9db87b80f1fcfa09ad7c58c7ff7166ea629887366ac257f4fe1ab0cb5dac9d6c
BLAKE2b-256 checksum
How to use checksums
66ddf7a72bd1d88307ab0ce3d36bbbf53b2ad33f8129acf0f4d0af4af1f2f984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / tfbscript-0.1.0-py3-none-any.whl

Download URL tfbscript-0.1.0-py3-none-any.whl
Size 89.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5354551d3104224e4bae400e97597dfaf7501dd8310f93669d7bd4cb5c7366de
BLAKE2b-256 checksum
How to use checksums
1ee578e3c6f85ccea52afc70e701619d0d88bb427ef882058efed593838ce1d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for tfbscript 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page