Fixed bug where negative consts were not valid slang, revised build script to build the workshop folder to the release folder.

This commit is contained in:
2025-12-06 19:56:05 -07:00
parent d6548502cd
commit 0ea58e4921
7 changed files with 104 additions and 4 deletions

70
ModData/About/About.xml Normal file
View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>StationeersSlang</Name>
<Author>JoeDiertay</Author>
<Version>0.1.0</Version>
<Description>
Slang (Stationeers Language) is a high-level programming language that compiles directly into IC10 within the game.
Features:
- In-Game Compilation: Write C-style code directly in the IC editor.
- Automatic Register Management: Define variables with 'let' (e.g., let x = 10) without managing r0-r15.
- Standard Control Flow: Use if/else, while, loop, break, and continue.
- Functions: Define and call functions with arguments.
- Smart Editor: Real-time syntax highlighting and error checking (red text for errors).
- Persistent Source: Your high-level source code is saved inside the chip data, so you can edit it later.
- Constant Folding: Mathematical operations on constants are calculated at compile time to save instructions.
- Device Aliasing: Easy device mapping (e.g., device sensor = "d0").
Installation:
This is a StationeersLaunchPad Plugin Mod. It requires BepInEx to be installed.
Usage:
1. Open any IC10 housing or editor.
2. Write Slang code.
3. Press Confirm to compile and run.
</Description>
<Tags>
<Tag>Logic</Tag>
<Tag>Scripting</Tag>
<Tag>Code</Tag>
<Tag>BepInEx</Tag>
<Tag>StationeersLaunchPad</Tag>
<Tag>Quality of Life</Tag>
</Tags>
<InGameDescription><![CDATA[
<size=30><color=#ffff00>Slang - High Level Language Compiler</color></size>
A modern programming experience for Stationeers. Write C-style code that compiles to MIPS assembly instantly.
<color=#ffa500><b>Features</b></color>
- <b>In-Game Compilation:</b> Write high-level logic directly in the chip editor.
- <b>Automatic Registers:</b> Stop juggling <color=#add8e6>r0-r15</color>. Just use <color=#569cd6>let</color> variables.
- <b>Control Flow:</b> Full support for <color=#c586c0>if</color>, <color=#c586c0>else</color>, <color=#c586c0>while</color>, and <color=#c586c0>loop</color>.
- <b>Smart Editor:</b> Integrated syntax highlighting and real-time error checking.
- <b>Persistent Code:</b> Your Slang source code is saved with the chip, so you never lose your work.
- <b>Optimization:</b> The compiler automatically optimizes constant math (e.g., <color=#b5cea8>1 + 2</color> becomes <color=#b5cea8>3</color>).
<color=#ffa500><b>Example Code</b></color>
<color=#569cd6>device</color> sensor = <color=#ce9178>"d0"</color>;
<color=#569cd6>const</color> MAX_TEMP = <color=#b5cea8>300k</color>;
<color=#c586c0>loop</color> {
<color=#569cd6>let</color> temp = sensor.Temperature;
<color=#c586c0>if</color> (temp > MAX_TEMP) {
<color=#6a9955>// Do logic here</color>
}
yield();
}
<b><color=#ffff00>Installation</color></b>
This is a <color=#ffa500>StationeersLaunchPad</color> Plugin Mod. It requires BepInEx to be installed.
See: https://github.com/StationeersLaunchPad/StationeersLaunchPad
Source Code: https://github.com/dbidwell94/stationeers_lang
]]>
</InGameDescription>
<Dependencies>
<Dependency>IC10Editor</Dependency>
</Dependencies>
<LoadAfter>IC10Editor</LoadAfter>
</ModMetadata>