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

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.3
File Size Uploaded Provenance Actions
tfbscript-0.1.3.tar.gz 64.3 kB Without provenance Details for tfbscript-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 152.7 kB

Release files / tfbscript-0.1.3.tar.gz

Download URL tfbscript-0.1.3.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e8b58e5293c1ffceb01047b5d65b97c290f873667f8ddbb199267dd5f6c3fbc1
BLAKE2b-256 checksum
How to use checksums
993a07add6110d261123922c005756d58f517115e672f9f85919acffa988f85a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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.3-py3-none-any.whl

Download URL tfbscript-0.1.3-py3-none-any.whl
Size 88.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d33df634094a051d4ff3ef6361a748a9e4dec2e55e786ace5e3b5b1f8518211
BLAKE2b-256 checksum
How to use checksums
d3d4e3ab60165a0f5fb076bd2efe8138430a790855a32bde5dec99f0b6c97303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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.3

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