diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..1e3cccb --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,14 @@ +{ + "recommendations": [ + "khahn.lua", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-python.python", + "ms-python.debugpy", + "ms-python.vscode-python-envs" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ebc295b..c7504ac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,28 @@ "Sound", "UnitBlueprint", "CreateSlider", - "WaitFor" - ] + "WaitFor", + "moho" + ], + "Lua.runtime.version": "Lua 5.1", + "Lua.runtime.path": [ + "?.lua", + "?/init.lua", + "/?" + ], + "Lua.completion.showWord": "Disable", + "Lua.runtime.special": { + "import": "require", + "doscript": "require" + }, + "Lua.runtime.nonstandardSymbol": [ + "!=" + ], + "Lua.completion.requireSeparator": "/", + "Lua.runtime.exportEnvDefault": true, + "Lua.runtime.plugin": "${3rd}/fa/plugin.lua", + "Lua.workspace.library": [ + "${3rd}/fa/library" + ], + "Lua.workspace.checkThirdParty": false } \ No newline at end of file diff --git a/mod_info.lua b/mod_info.lua index 0640a21..f131ff0 100644 --- a/mod_info.lua +++ b/mod_info.lua @@ -2,16 +2,25 @@ name = "Supreme Mech Commander 2" uid = "6ceff22d-b021-44d2-86a1-638c2af4ef95" version = 1 copyright = "GPL v3" -description = "Supreme Mech Commander 2 v1" +description = "Supreme Mech Commander 2" author = "Kamisama171 and FuegoTigre and CardboardBread" -url = "https://example.com" +-- url = "https://example.com" icon = "/mods/Supreme Mech Commander 2/Mini_icon.jpg" -selectable = true -enabled = false +-- selectable = true +-- enabled = false exclusive = false ui_only = false -requires = {} -requiresNames = {} -conflicts = {} -before = {} -after = {} +-- requires = {} +-- requiresNames = {} +-- conflicts = {} +-- before = {} +-- after = {} + +-- Conversion Notes +-- +-- 1 Hex in BT is 30 meters +-- BT Structure and Armor are summed for a Max HP value +-- One unit in SupCom is 19.525m, we'll round to 20m +-- Threat level is just BV, build cost is BV or BV*10 +-- +-- Damage conversions between BT and SupCom are 1:30, battlemechs have 30 times the HP as in tabletop diff --git a/notebook.ipynb b/notebook.ipynb new file mode 100644 index 0000000..57e586e --- /dev/null +++ b/notebook.ipynb @@ -0,0 +1,183 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "48125b87", + "metadata": {}, + "outputs": [], + "source": [ + "import glob\n", + "import re\n", + "import pprint\n", + "\n", + "files = glob.glob('units/*/*_unit.bp')\n", + "pprint.pprint(files)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "100d0de8", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in files:\n", + " file = open(filename, 'r')\n", + " lines = file.readlines()\n", + "\n", + " for idx, line in enumerate(lines):\n", + " check = re.match(\"^(\\s*)(Health) = ([0-9]+),$\", line)\n", + " if check is not None:\n", + " white = check.group(1)\n", + " label = check.group(2)\n", + " value = check.group(3)\n", + " num = int(value)\n", + " lines[idx] = f\"{white}{label} = {num * 30}, -- ({value}) * 30\\n\"\n", + "\n", + " file.close()\n", + "\n", + " out = open(filename, 'w')\n", + " out.writelines(lines)\n", + " out.close()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f1a0bbd2", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in files:\n", + " file = open(filename, 'r')\n", + " lines = file.readlines()\n", + "\n", + " for idx, line in enumerate(lines):\n", + " maxcheck = re.match(\"^(\\s*)(MaxHealth) = ([0-9]+),$\", line)\n", + " if maxcheck is not None:\n", + " white = maxcheck.group(1)\n", + " label = maxcheck.group(2)\n", + " value = maxcheck.group(3)\n", + " num = int(value)\n", + " lines[idx] = f\"{white}{label} = {num * 30},\\n\"\n", + "\n", + " file.close()\n", + "\n", + " out = open(filename, 'w')\n", + " out.writelines(lines)\n", + " out.close()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63e82c8d", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in files:\n", + " file = open(filename, 'r')\n", + " lines = file.readlines()\n", + "\n", + " for idx, line in enumerate(lines):\n", + " typecheck = re.match(\"^(\\s*)(ArmorType) = '(\\w+)',$\", line)\n", + " if typecheck is not None:\n", + " white = typecheck.group(1)\n", + " value = typecheck.group(3)\n", + " lines[idx] = f\"{white}ArmorType = 'Normal', -- '{value}'\\n\"\n", + "\n", + " file.close()\n", + "\n", + " out = open(filename, 'w')\n", + " out.writelines(lines)\n", + " out.close()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0e1a79be", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in files:\n", + " file = open(filename, 'r')\n", + " lines = file.readlines()\n", + "\n", + " for idx, line in enumerate(lines):\n", + " damcheck = re.match(\"^(\\s*)(Damage) = (.+),$\", line)\n", + " if damcheck is not None:\n", + " dncheck = re.match(\"^(\\s*)(DisplayName) = '(.+)',$\", lines[idx + 3])\n", + " if dncheck is not None:\n", + " white = damcheck.group(1)\n", + " value = damcheck.group(3)\n", + " num = \"\"\n", + "\n", + " dn = dncheck.group(3)\n", + " if dn is \"Particle Projector Cannon\":\n", + " num = \"30, -- (10) * 30\"\n", + " if dn is \"Medium Laser\":\n", + " num = \"150, -- (5) * 30\"\n", + "\n", + " lines[idx] = f\"{white}Damage = {num},\\n\"\n", + "\n", + " file.close()\n", + "\n", + " out = open(filename, 'w')\n", + " out.writelines(lines)\n", + " out.close()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2792e0e6", + "metadata": {}, + "outputs": [], + "source": [ + "for filename in files:\n", + " file = open(filename, 'r')\n", + " lines = file.readlines()\n", + "\n", + " for idx, line in enumerate(lines):\n", + " check = re.match(\"^(\\s*)(DamageType) = '(.+)',$\", line)\n", + " if check is not None and check.group(3) == \"BTCluster\":\n", + " white = check.group(1)\n", + " label = check.group(2)\n", + " second = re.match(\"^(\\s*)(DisplayName) = '(.+)',$\", lines[idx + 1])\n", + " if second is not None:\n", + " if second.group(3) == \"Long Range Missles\" or second.group(3) == \"Short Range Missles\":\n", + " lines[idx] = f\"{white}{label} = 'BTClusterMissile',\\n\"\n", + " if second.group(3) == \"LB 10-X Autocannon\" or second.group(3) == \"LBX5_rounds\":\n", + " lines[idx] = f\"{white}{label} = 'BTClusterBallistic',\\n\"\n", + " file.close()\n", + "\n", + " out = open(filename, 'w')\n", + " out.writelines(lines)\n", + " out.close()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv (3.11.3)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}