Skip to content

donutteam/mfk-to-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MFK To Lua

A tool to convert MFK or CON files from The Simpsons: Hit and Run to Game.lua scripts.

Prerequisites

How to use

Usage: MFKToLua [options] <MFKPath>

Options:
  -?, --help                        Show this help message and exit
  -o, --output <path>               Set the output path
  -f, --force                       Force overwrite the output path if it exists

Useful scripts

A selection of example scripts to run all MFK or CON files in a directory through the tool.

Powershell:

$root = Read-Host "Enter root script path:"

if (-not (Test-Path $root)) {
	Write-Error "The specified path does not exist."
	exit 1
}

Get-ChildItem -Path $root -Recurse -Include *.mfk, *.con -File | ForEach-Object {
	$inputFile = $_.FullName
	$outputFile = [System.IO.Path]::ChangeExtension($inputFile, ".lua")

	Write-Host "Processing: $inputFile -> $outputFile"

	& ".\MFKToLua.exe" -o $outputFile $inputFile
}

Batch:

@echo off
setlocal enabledelayedexpansion

set /p root="Enter root script path: "

if not exist "%root%" (
	echo The specified path does not exist.
	exit /b 1
)

for /r "%root%" %%f in (*.mfk *.con) do (
	set "inputFile=%%f"
	set "outputFile=%%~dpnf.lua"

	echo Processing: !inputFile! -> !outputFile!

	".\MFKToLua.exe" -o "!outputFile!" "!inputFile!"
)

endlocal
pause

Bash:

#!/bin/bash

read -p "Enter root script path: " root

if [[ ! -d "$root" ]]; then
	echo "The specified path does not exist."
	exit 1
fi

find "$root" -type f \( -iname "*.mfk" -o -iname "*.con" \) | while read -r file; do
	output="${file%.*}.lua"
	echo "Processing: $file -> $output"
	./MFKToLua -o "$output" "$file"
done

About

A tool to convert MFK or CON files from The Simpsons: Hit and Run to Game.lua scripts.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors