DRKV
Wall of Flesh
In my opinion, there is one big issue with wiring. You can’t really SEE what is actually going on. Everything happens instantly once you flip the switch. This isn’t a big deal if you just want to build simpler door mechanisms or traps, but when you have a huge chain of logic gates, things will quickly become rather confusing… To resolve this problem, I have created MechScope, a TModLoader mod that can pause and visualize the wiring execution process.
How does it work?
There are 4 hotkeys you can use to control MechScope. They can be remapped in the vanilla controls menu.
Mouse indicator
The small squares next to your cursor indicate the state of the mod.
While the wiring system is paused, additional wire triggers will be queued up, and will only run once the current wire iteration has finished. Timers will also be paused.
Mode
The mode setting determines when the wring gets paused during the execution process.
Visuals
The source of the wire signal that is currently being processed is marked with a red border. In single mode, the tile that is currently being examined will also have a similar border. Triggered wires will be marked with a square with the same color as the wire.
I listed these markers in the order in which they are drawn. If a tile has two different markers on it, only the one further down the list will be shown.
Auto-step rate
This number indicates how many frames have to pass before an automatic step happens. A setting of 30 means one step will happen once every half a second.
Compatibility
This mod does not affect the way wiring actually works, so all wiring devices should function as normal, unless they rely on other game aspect, such as HOIK actors. This mod should also be compatible with other wring related mods. MechScope currently does not work in multiplayer. I don't really see many people interested in this feature, but if there's a demand for it, I can probably make it work.
Technical details
So, you might be asking, how is this even possible in TModLoader? To make this mod, I used a library know as Harmony. Harmony can apply patches to managed code at any point during runtime. It can even interoperate with other instances of itself, allowing multiple mods to patch the same methods. Harmony is commonly used to mod various games based on the Unity engine.
Download
As usual, the mod can be downloaded from the TModLoader Mod Browser or from GitHub, where you'll also find the source code.
https://github.com/DRKV333/MechScope/
How does it work?
There are 4 hotkeys you can use to control MechScope. They can be remapped in the vanilla controls menu.
Toggle (NumPad1)
Activates or deactivates MechScope. While active, any wire trigger will be intercepted and paused. The state of the wiring system will be displayed based on the visual settings.
Step (NumPad2)
Advances the wiring system by one step. The granularity of the steps depends the mode setting.
Auto-step (NumPad3)
Activates or deactivates the automatic step timer. When active, a step will happen once the number of frames indicated by the auto step rate have passed.
Settings (NumPad5)
Opens the settings menu.
Mouse indicator
The small squares next to your cursor indicate the state of the mod.
- Yellow square: MechScope is active
- Red square: MechScope is active, and wiring is currently paused
- Green square: auto-step is active.
While the wiring system is paused, additional wire triggers will be queued up, and will only run once the current wire iteration has finished. Timers will also be paused.
Mode
The mode setting determines when the wring gets paused during the execution process.
Wire
Stage
Visuals
The source of the wire signal that is currently being processed is marked with a red border. In single mode, the tile that is currently being examined will also have a similar border. Triggered wires will be marked with a square with the same color as the wire.
Wire skip
Marks tiles, that have been explicitly flagged to skip wire activations on, with a red ‘X’. This usually happens when multi tile objects are triggered, such as statues. (There is currently a bug in the game, that causes certain objects to not skip wires, if a previous wire color has already executed.) Wire skip marks will only work in Single mode.
Gates done
Marks gates with a white ‘X’ if they have already triggered during the current wire iteration. If triggered again, these gates won't emit a signal, they will only make a puff of smoke.
Upcoming gates
These are the gates that had their state changed, and are currently waiting for their turn to output a signal. They are marked by a red ‘O’.
Triggered lamps
These lamps, marked by an orange ‘?’, were triggered, but the state of their gate has not been evaluated yet. This will not display in Stage mode.
Triggered teleporters
A white number will show next to activated teleporters, indicating which wire they were triggered by.
- 1 = red
- 2 = blue
- 3 = green
- 4 = yellow
These numbers also tell you what order the teleportations will happen in. This only works in Source or Stage mode.
Triggered pumps
Numbers pumps based on the order they were activated in. Red is input, green is output.
I listed these markers in the order in which they are drawn. If a tile has two different markers on it, only the one further down the list will be shown.
Auto-step rate
This number indicates how many frames have to pass before an automatic step happens. A setting of 30 means one step will happen once every half a second.
Compatibility
This mod does not affect the way wiring actually works, so all wiring devices should function as normal, unless they rely on other game aspect, such as HOIK actors. This mod should also be compatible with other wring related mods. MechScope currently does not work in multiplayer. I don't really see many people interested in this feature, but if there's a demand for it, I can probably make it work.
Technical details
So, you might be asking, how is this even possible in TModLoader? To make this mod, I used a library know as Harmony. Harmony can apply patches to managed code at any point during runtime. It can even interoperate with other instances of itself, allowing multiple mods to patch the same methods. Harmony is commonly used to mod various games based on the Unity engine.
Download
As usual, the mod can be downloaded from the TModLoader Mod Browser or from GitHub, where you'll also find the source code.
https://github.com/DRKV333/MechScope/
Last edited: