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

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.2
File Size Uploaded Provenance
tfbscript-0.1.2.tar.gz 64.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 153.7 kB

Release files / tfbscript-0.1.2.tar.gz

Download URL tfbscript-0.1.2.tar.gz
Size 64.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9361f3b99fd1a804186d196b6e673976b0d90b1502463c06311b48bed64ce87e
BLAKE2b-256 checksum
How to use checksums
a9448969608dd89d0bb61d55a5978180bfa7c1979c8ee5a19d23caabb00752df
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.2-py3-none-any.whl

Download URL tfbscript-0.1.2-py3-none-any.whl
Size 89.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06bf36426bbe8ca9f17ff3da6a071ed796058bb3fd11e33817aa8c6410295cf9
BLAKE2b-256 checksum
How to use checksums
88fa67849da7fa31b5938c288a0bccb70be05f8f9b071afbc1275c8b9a66dde7
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.2

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