tModLoader WireMod

I've gone back and changed a bit how areas are sent between devices, so you can now choose an area with an If device.

I'm trying to decide between two options for the TilePaster:

a) The TileCopier stores all the data needed to paste (old method).
b) The TileCopier only stores tile locations, then the TilePaster simply copies from those coordinates (current method).

The latter is better in every case - way easier to code, less data, everything 'blends' nicely together, etc. The only thing it can't do is to paste tiles onto the same area it copied from, so you have to keep an untouched version to copy from - any damage to this 'original' version will be replicated in the new copy.

My question is simply: does this matter? Personally I'd prefer to be able to paste in the same place, but I'm unwilling to go through the effort to get it to work if I'm the only one who would actually care.
 
Well, I actually love both methods almost equally, but I like the old method a little bit more:
The current method makes us able to modify the new thing to paste in a wysiwyg way easily, while the old method will force us to maybe paste the old data somewhere to modify it, then copy it again. It could be also used to create some kind of "Mirror biome" or some weird labyrinth features.

The old method is a little more complex to make it work, but it is a lot more powerful. For example, my "Fort boyard gold coins shower" requires 3 tileCopier, with the current method, plus the fact that (i guess for now?) only square and circle areas exist, it takes a lot of space, and forces me to copy and paste the shower multiple times. In some "tight" areas, you might be forced to have the copies far away from the original, making it kind of difficult to wire them, especially during nights and those *****ng blood moons.

I'm not sure but, the old method might be able to store the alternate sprite number to make those blend properly too, at the cost of 16 or 32 bits added per tile ?

(Also ... the old method could be easier to hijack to make it read data in files/url by some crazy modders that could need to modify a running server from the outside, or in the opposite side, send the world modifications of an area to an external website for some reasons [Even if it's obvious that this kind of reasons lives outside of what this mod is meant for, having the ability to stay close to its implementation and to use the same datatypes makes it way better])


_____________________________

About the hitwire being unable to get called on empty coordinates, I can see two solutions, one that is a workaround that might be either totally unsafe or needing a lot of work to be safe, and one that feels both intuitive and weird for some reasons, so i'm not sure.

The workaround would be to check at pins positions if there is a tile behind, and if there is none, place an invisible ModTile at this location, i guess during both the moment where you place vanilla wires, and the moment where you place devices, but it would get messy once you start placing tiles on top of the device (i guess you'll need to delete the modtile), and when you kill tiles at this coordinates (you'll need to place back the modtile), which might be complex when tiles are bigger than 1² I guess.

The other way would be to create either a new tile, or an object copied from the actuator that would live on the same layer, and would act like a trigger device. It would stay invisible like other devices and actuators, but would require a tile to live on and would get destroyed if the tile gets killed. Placing those would require a different workflow and would look like a bit different than other devices, but I feel like it fits well as it is a vanilla to mod converter, and might even feel more natural to have to do something different to make it work than having stuffs that just magically work (On top of that, I didn't find how to make the devices appear on screen while placing vanilla wires). In my head, placing a vanilla wire on a pin feels way too weird, and might lead to people (me) placing vanilla wires on devices by mistake, thinking that it shouldn't interact one with each other.


Could the double call to HitWire be caused by the fact it somehow gets called both on the tile behind, and on the pin, while you check for every hitwire that happens at those coordinates ?
 
Yeah, I'm also leaning more towards the old method, as annoying as it is to implement. I may try to find a way of encoding the data to use less space - just hovering over a TileCopier now gives you a ridiculously wide debug window; with the old method it's ten times worse. I do also really like being able to copy and paste in the same place. I'm pretty sure that just saving each tile's frameX and frameY would keep the correct tile sprite, so I'm not worried about that. Well, there go my hopes for doing things the easy way... T_T

As for changing the values from outside the game, I don't know if that would work - the data is saved to the World's ModData, and the world file is locked by the server process as long as the world is loaded and active.

There is one bug I've noticed since getting the gold coin drops to work - now placed tiles like workbenches, lamps etc. "explode" into items as soon as they're copied, so I may have to make a list of tile types to update: coins, sand and the like.

I'd really like to avoid having to resort to invisible backing tiles if at all possible, as that way leads only to madness. I probably just need to dig deeper into the code and use a lower-level method. The HitWire method I'm using doesn't see pins at all (they're not at all linked to anything built in), and it triggers twice for everything - I toggle a switch, and get two calls to the method with the same coordinates for the part of the switch with a wire. This is probably also fixed by digging deeper.

Devices not appearing on screen when placing vanilla wires is because I haven't yet found how to add 'visibility toggles' in the top-left corner of the screen like you get for wires, actuators, rulers, etc. The code to set the device/wire visibility is basically all there, I just need the UI for it. If you have any idea, or even know of an open source mod that adds one, please let me know.
 
Uh, i guess workbenches now explode maybe because they are placed before the game knows there is a tile under them, maybe it should be done in two frames or something alike.
Maybe the value displayed by the debug window would only require to tell how much solid tiles it holds, as it's hard to tell from watching the numbers which ID it refers to anyway, or a simplified list like "ID330:54,ID665:15" etc, to be able to casually check if the number of blocks seems okay.
 
They explode even if there's already a floor in place - copying and pasting twice for example. I don't think there are too many tiles which obey gravity, so I'll probably just add a list of applicable tile IDs.

The debug window just shows the output value, so what the user sees is what the TilePaster sees. Hiding it just for the TileCopier and TilePaster to replace it with a more user-friendly but computer-useless value would be both difficult and inelegant. Ideally, hovering over would display a visual preview of the copied tiles, but that's waaaay further down the road. For now I may just add some line breaks after every row of tiles, so it should be a bit easier to see which 'sub-value' corresponds to which tile.
 
Could you upload the compiled mod file here? It would allow people to download the mod while the browser is down, and if it ever goes down in the future.

Thanks! :)
 
[Here is a compiled version from github] (tmodloader v 0.11.5)
However some of the features are still wip. Most of the stuffs should work just fine, it doesn't include the latest stuffs Djago made. The link will last for 14 days, hoping for the browser or Djago to come back.

If something doesn't work, let me know, I might be able to get an older release.
 
Hey! I've been checking out the mod, but honestly have been running in to a lot of issues, one primarily being that the place where I have to put my cursor to interact with the gates is way off. I'm not sure if it's one of my mods, but I am hoping there is a fix since the mod looks really cool.
 
I've been trying to figure this out for a few hours now, but how would I be able to take in a vanilla wire signal. It's mentioned in the thread that the Trigger is the only one that can recieve it, but I don't see how that could be used to actually translate that to a usable signal. Specifically, my use case is with MechTransfer and trying to only allow 24 pulses on a vanilla wire output on a single pulse on a vanilla wire input, as I need to make sure that 1 of the 25 items created when autocrafting remains in the chest.
 
I have noticed that using the time sensor for long periods of time causes increasingly laggy effects in the game, causing Terraria to take up a majority of my cpu/memory
 
Have you ever considered making a countdown timer device of sorts? and if not, is there a way i can functionally create one using what is already there? as im making a metroid style adventure map, and timers and such would be useful for puzzles and escape sequences.

Edit: Ive attempted to make something to spawn kraid, and it seems to never spawn anything even if im within the radius.
1657091568715.png

1657091674555.png
 
Last edited:
Dear Devs, I was looking to host a major playthrough with this mod, do you have any idea when/if this will ever be ported to current version?
 
Dear Devs, I was looking to host a major playthrough with this mod, do you have any idea when/if this will ever be ported to current version?
While I am not a developer for this mod, I find it unlikely that the developers will port it to 1.4, as the last commit to the GitHub repository was in 2019 and the creator of the mod hasn't been seen on this forum since 2020. Someone else might be willing to take up the mantle, but I'm not sure if that will happen.
 
Dev here - between work, life and waiting for tModLoader to support 1.4, I haven't had a chance to come back around to this in quiiiiite a while - but I certainly haven't forgotten about it.

In all likelihood, given the long absence and sweeping changes in 1.4, I will probably be restarting from scratch as I locked myself into several design choices early on that ended up being somewhat limiting (mostly around pin placements, which could be solved procedurally - among other things).

No promises that I'll be able to work on it right away, but I'd welcome a list of wanted features to help give some direction / plan for the future / avoid more limiting early design choices.
 
Dev here - between work, life and waiting for tModLoader to support 1.4, I haven't had a chance to come back around to this in quiiiiite a while - but I certainly haven't forgotten about it.

In all likelihood, given the long absence and sweeping changes in 1.4, I will probably be restarting from scratch as I locked myself into several design choices early on that ended up being somewhat limiting (mostly around pin placements, which could be solved procedurally - among other things).

No promises that I'll be able to work on it right away, but I'd welcome a list of wanted features to help give some direction / plan for the future / avoid more limiting early design choices.
How about this:
A sentry that is controlled by a player-made AI, and can use player given weapons, and maybe tools too, perhaps even an electronics manual?

It sounds like a rabbit hole though, with questions like "how does it get the mana needed for magic weapons?", "can it destroy itself with a pickaxe?" and "Do they count as extra players when calculating boss health?"
 
Back
Top Bottom