https://github.com/technologicnick/scrap-mechanic-xms
A Cross Mod Scripting script for Scrap Mechanic
https://github.com/technologicnick/scrap-mechanic-xms
Last synced: over 1 year ago
JSON representation
A Cross Mod Scripting script for Scrap Mechanic
- Host: GitHub
- URL: https://github.com/technologicnick/scrap-mechanic-xms
- Owner: TechnologicNick
- License: mit
- Created: 2019-02-02T04:13:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-02T04:18:00.000Z (over 7 years ago)
- Last Synced: 2025-01-27T13:48:39.780Z (over 1 year ago)
- Language: Lua
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrap Mechanic XMS (Cross Mod Scripting)
## Can I use this in my mod?
Yes! You do not have to ask for my permission. It's free of charge.
## How it works?
All Userdata objects in lua have a bug where their items are shared:
```lua
Userdata_A.foo = "foo"
Userdata_B.foo = "bar"
print(Userdata_A.foo)
```
This will print `"bar"` because of the bug and because the item names are the same.
This works for every Userdata object and the items are only accessable for
the mod the script is running. However, a Userdata is special. For
some reason the items of the Userdata are shared between all mods.
This script uses that bug to allow other mods to use shared variables.