Jump to content

Mods:Introduction

From Logic World Wiki
Revision as of 07:04, 16 March 2026 by FoxFireFive (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article is a stub. Please help expand it by adding content.

Logic World currently features unofficial first-party modification support. While the Logic World client / server will load and compile mods, it hasn't been fully implemented, and the API may undergo changes per update, which has a chance to break certain mods.

Of course, the probability of a mod breaking depends on how deep you are interfacing with the game. If you’re making simple components, updating the mod should be easy if it breaks.

There are currently two built-in ways of adding functionality to components in your mod:

C#

C# (C-sharp) is a programming language developed by Microsoft in 2002. It's similar to Java, which if you already know the language, can help you learn C#, and develop mods, if you don't already know how to program in C#.

Logic World is programmed primarily in C#, which is also the scripting language used by its current engine, Unity.

Almost all mods for Logic World are programmed in C#. Mods are distributed as source, and the game compiles them into DLLs that it caches in the cache folder. This allows you to edit nearly all of Logic World's code if you use Harmony, and thus there is almost no limit to what you can create.

While currently not fully supported, you can distribute your mod as a zip file with the lwmod suffix instead of the zip suffix.

If you are unfamiliar with C#, but have knowledge in other languages like C++, Python, or other OOP languages, it should be fairly easy to pick up the concepts. To help yourself learn C#, you can tweak an existing mod (like the ones from below) and pick up the language that way, or refer to other ways of learning C#, like using YouTube, W3Schools, or the C# documentation.

C# Mods to base your own mod on
Mod Name Description Link License
MHG (basemod) The Logic World base mod which contains most game content. Located in Logic World's GameData folder. All Rights Reserved
Basic Logic World Mod Adds a basic NAND Gate component to Logic World. https://github.com/FoxFireFive0135/Basic-Logic-World-Mod MIT
MorLogic Simple Logic World mod that adds XNOR, OR, NOR, and NAND gates. https://github.com/ru0wl/morlogic MIT
Dynamic Nand Gate Adds a basic NAND gate component that uses dynamic pegs. https://github.com/FoxFireFive0135/Dynamic-Nand-Gate MIT
TCP Bridge Adds a component supporting real-world TCP connections. Fairly complex, but shows off using threads within components. https://github.com/GHXX/LogicWorld-TcpBridge MIT

TODO: List more mods that perform various actions. e.g. one that adds custom UI; one for adding chat commands; one using Harmony to edit game code; etc...

To learn how to create your first mod, refer to the Bare Bones mod guide.


Logic Script

LogicScript is a built-in scripting language which you can use instead of C#. There is currently the issue with LogicScript that it is likely to be removed[1], but for now you can still make mods with it.

It is much less powerful than C#, and fairly complex.

A LogicScript script is executed sequentially from top to bottom. The script is composed of port declarations, constant declarations, and code blocks.


TODO: describe LogicScript better. Reference: https://github.com/pipe01/LogicScript/wiki/Syntax-reference

References

  1. LogicScript is likely to be removed.