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.1

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.1
File Size Uploaded Provenance
tfbscript-0.1.1.tar.gz 65.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 154.2 kB

Release files / tfbscript-0.1.1.tar.gz

Download URL tfbscript-0.1.1.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d6ab5c564a9c2d4b160ae38413969364e77b8747c3b4bced4ee7017a7998287d
BLAKE2b-256 checksum
How to use checksums
a1cd75d414a54d1b07a3be98e49e8ac4e39490b7ac95ae37f4d1b9f547d10ca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL tfbscript-0.1.1-py3-none-any.whl
Size 89.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
842ac45e84c6a2c556a3d87896d186fcf84d303b05fd73d13a56c12d22726416
BLAKE2b-256 checksum
How to use checksums
0edf6cba4d04c48b987427e4dc4b906e23f6922fe787bae61f46aae9e3d8b040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for tfbscript 0.1.1

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