• Mods are now organized as resources. Use the Mods link above to browse for or submit a mod, tool, or prefab.

    The TFP Official Modding Forum Policy establishes the rules and guidelines for mod creators and mod users.

Logic Gates

I have a few questions, have not gone to nexus yet so I didn't see.
Does it remove all of the physical models for the connectors, and replace
them with blocks, that have a representative icon for the function? Also
does it remove the wires? The last what is the length that they can function,
and the load is it increased or decreased?

The reason why I asked, is because, if all of the topological models are replaced,
it not only is neater visually but it also would lower the amount of tris render in
an area.

Potential future
The second is a quest like expansion, a station that supplies a grid, gens heat, must
be protected, is a revolving intermittent quest, allows for plug and play connecting
to the grid. Promotes coal or other recycle fuel gathering to keep it running.
 
Last edited:
I have a few questions, have not gone to nexus yet so I didn't see.
Does it remove all of the physical models for the connectors, and replace
them with blocks, that have a representative icon for the function? Also
does it remove the wires? The last what is the length that they can function,
and the load is it increased or decreased?

The reason why I asked, is because, if all of the topological models are replaced,
it not only is neater visually but it also would lower the amount of tris render in
an area.

Potential future
The second is a quest like expansion, a station that supplies a grid, gens heat, must
be protected, is a revolving intermittent quest, allows for plug and play connecting
to the grid. Promotes coal or other recycle fuel gathering to keep it running.
Hi,

First of all thanks for the interest
It doesnt remove anything it just adds new system to bypass electricity 1 input limitaiton, so basicly it let's says adds new electricity system just for control signals. Code itself doesnt limit you regarding the lednght limit, but since its uinrealisitc I will likely set certain limit, regaridng load iI havent noticed any fps drop so far, but i didnt create nothing complex, most complex thing i built is 2 bit calculator and SR latch, but i would like you to try it out and test it since its still in early development but should be usable, still I have to create proper models for them since I never created any models if there is someone willing to help with models i would appriciate it!

Remember when testing in order to "convert" vanilla electricity into signal use "Signal sensor" (it has to be placed on neighbouring block, same for signal power sources) then use signal it produces to connect it to the gates (hold E on them in order to connect and choose "Mark as source" than hold E on the element you wich conenction to go to and press "Link source here ), also to convert it back to the electricity use "Signal" power sources

Here is the showcase video of latest version:
 
I haven't tried it and probably won't just because I don't really need it, but I do like that you're trying to add logic gates to the game. I know it's a work in progress and you probably already have plans for improvement, but from watching the video, I think it would be a very good thing to create individual logic gate blocks for each gate type and simply connect power through those the way you would through anything else, like a relay. Having a bunch of special radial commands to link and unlink things will be very confusing for people to figure out. Just watching the video, I feel that I'd have to learn how to use this instead of it being obvious.

Consider the steps you're taking right now versus:

Place power source, place logic gate, place target item, use the wire tool to connect them together.

This would be obvious to anyone who has played the game as it's how everything already works for power. It just adds new logic gate blocks. But the way you have it would require figuring out how to do it and it would be less obvious.

Now, I don't know what's required to make working logic gates and maybe it's not so simple to make them as individual custom blocks that accept normal wire connections, but if it's something you can do, I'd recommend that.

Example NOT block:

Single 1x1 block with a NOT logic gate symbol on it (or whatever you want it to look like)
1+ inputs for wire connections
1+ outputs for wire connections

If power is supplied, change the power state for the output to no power.
If power is not supplied, change the power state for the output to powered.

I would assume this requires a DLL but that it is possible to grab the powered/unpowered state of the inputs and to flip the bit for them to the opposite when sending that state to the output.

Then just a similar thing for the other logic gates based on the gate type. You can then string gates together easily to do anything you want.


Anyhow, that's just feedback. I think you've done a good job already and this isn't meant to be a negative to what you've done. What you've done looks good.
 
I haven't tried it and probably won't just because I don't really need it, but I do like that you're trying to add logic gates to the game. I know it's a work in progress and you probably already have plans for improvement, but from watching the video, I think it would be a very good thing to create individual logic gate blocks for each gate type and simply connect power through those the way you would through anything else, like a relay. Having a bunch of special radial commands to link and unlink things will be very confusing for people to figure out. Just watching the video, I feel that I'd have to learn how to use this instead of it being obvious.

Consider the steps you're taking right now versus:

Place power source, place logic gate, place target item, use the wire tool to connect them together.

This would be obvious to anyone who has played the game as it's how everything already works for power. It just adds new logic gate blocks. But the way you have it would require figuring out how to do it and it would be less obvious.

Now, I don't know what's required to make working logic gates and maybe it's not so simple to make them as individual custom blocks that accept normal wire connections, but if it's something you can do, I'd recommend that.

Example NOT block:

Single 1x1 block with a NOT logic gate symbol on it (or whatever you want it to look like)
1+ inputs for wire connections
1+ outputs for wire connections

If power is supplied, change the power state for the output to no power.
If power is not supplied, change the power state for the output to powered.

I would assume this requires a DLL but that it is possible to grab the powered/unpowered state of the inputs and to flip the bit for them to the opposite when sending that state to the output.

Then just a similar thing for the other logic gates based on the gate type. You can then string gates together easily to do anything you want.


Anyhow, that's just feedback. I think you've done a good job already and this isn't meant to be a negative to what you've done. What you've done looks good.
Thank you on a reply,

Well yes you are right it would be ideal if it would be possible but unfortunatelly its not possible, since vanilla has limit of 1 input wire, so you cant set 2 wire as input into a realy,switch or any other element, there were several unsucessfull attemps all failed because of the same reason: "limit of 1 input wire", this is the reason I created completely new system to do logic, actully this is somewhat comparable with real life where you have control circuit and main circuit acting independetly, what I could do, maybe, is to set so connections in my system could use vanilla wire tool
 
I think it would be a very good thing to create individual logic gate blocks for each gate type and simply connect power through those the way you would through anything else, like a relay. Having a bunch of special radial commands to link and unlink things will be very confusing for people to figure out. Just watching the video, I feel that I'd have to learn how to use this instead of it being obvious.
This is what I was asking about. It is interesting, but the things to consider,
learning curve vs desire, and longevity of the mod's lifespan. A logic system
has long been desired and attempted multiple times. Most add more steps.

In the early alphas it would have been more highly accepted. But reading the
room, meaning the forum player base, the main contention point is convenience
and obvious, vs intricate and detailed now. For longevity I am comparing it to
the plethora of mods available. Look at the common denominator(s) for the ones
that are continuously used. There have been some overhauls that, are works of
pure imagination but the systems and subsystems, limited their shelf life.

I will draw a simple; meaning I will use mspaint with a Legend, to express visually
what I was writing about. But I still find the thought interesting.
Back in a bit.
 
Thank you on a reply,

Well yes you are right it would be ideal if it would be possible but unfortunatelly its not possible, since vanilla has limit of 1 input wire, so you cant set 2 wire as input into a realy,switch or any other element, there were several unsucessfull attemps all failed because of the same reason: "limit of 1 input wire", this is the reason I created completely new system to do logic, actully this is somewhat comparable with real life where you have control circuit and main circuit acting independetly, what I could do, maybe, is to set so connections in my system could use vanilla wire tool
I don't know what is possible with DLL mods with this game as I haven't programmed anything for the game and have only done simple XML mods, but there are often ways around problems when programming. I wouldn't give up entirely. Maybe there is a way to "trick" the game into multiple inputs. Maybe that does require a different connection than what you get with the wire tool, but if you have some form of connection between a source and a target, even if it's not a wire that is currently used for electrical, you may be able to not treat it as a new connection, but instead grab the data from the source (power state, amount of power available, etc.) and use it to manipulate the state on a target.

For example:

In vanilla, you have a power source that offers 100W of power and it connects to a relay and then to a light and the light draws the required power if the power state is on.

In a mod, you have a custom AND gate. It's just a block that doesn't really have inputs or outputs for power but does allow a special custom connection similar to what you're currently doing. If connected with the alternate "wire" (perhaps connected using a custom wire tool), the DLL reads the state of the sources connected to it (power state, amount of power, etc.) and then determines if all connected sources have a power state of on or not. If so, it sets the input power of the target equal to the power being supplied and sets the power state to on. If not, it sets the power state to off with no power. You're manipulating the values for the inputs and outputs of the electrical systems without really connecting multiple power sources to a single item. In the end, you don't really have a powered connection from the source to the target because there's no actual connection there. Instead, you're just manipulating the data for those inputs and outputs.

Now, there is a somewhat more complicated issue to consider. Power usage is related to how many items are being used (power draw). You would need to also find out what that power draw is and manipulate that value for the sources.

Here's a basic view of it:

Vanilla:
Generator > Relay > Light

Mod:

Generator 1 (not connected to anything directly, or if necessary to make it work, connected to its own relay)
Generator 2 (not connected to anything directly, or if necessary to make it work, connected to its own relay)

==> (connections from Generator 1 and Generator 2 are not made with normal wires but with a custom system that works like wires but doesn't actually use the input and output electrical connections)

Custom AND block

==> (connection from custom AND block to light made with the custom system instead of normal wires)

Light



In the above example, the mod reads the power state of Generator 1 and Generator 2 to see if they are on or off. If both are on (AND gate), it sets the power state for the input of the light to on. It checks the power draw of the light and anything else in the connection to see the total draw. It then compares that draw to the power available from the generators to see if there's enough power or not. If not, it works just like in the game when there's not enough power in a circuit. It also sets the power draw on the output of both generators (50% of total draw to each generator since there are 2 generators) so that the fuel usage changes the correct amount for the draw and so the draw is shown on the generators.

In the end, there isn't any real (vanilla electrical) connection through the AND gate but it's mimicked through data manipulation in the backrgound.

This *should* be possible, but like I said, I haven't programmed DLLs for this game and don't know what is available to use. Maybe they don't expose the input or output information or allow it to be changed. I don't know. But I'd say there could still be a way to make it work, that feels like normal electrical connections even if it's not. So don't give up. :)
 
@Rihno123

View attachment 39965
Here is the pic that I was writing about. The center area is the example area.
If I understood you correctly, you're suggesting some kind of wireless power transmission/communication system.


The idea itself sounds interesting as an alternative way of distributing power. What I might be able to try (though I can't promise it'll work) is creating a special Power Source that receives information about the available wattage from elsewhere and generates that same amount of power locally. It would still have to work fundamentally the same way as it does now (I already implemented the ability to use vanilla wire tool to connect logic circuit, alongside previous setup, it needs further testing but update should arrive very soon)


The main limitation is how the vanilla electricity system is designed. It expects a strict parent-child relationship, where the first parent must always be a power source. Components like switches, relays, timers, and lights don't know anything about the available wattage themselves,they simply receive power from their parent.


Because of that, I can't make a circuit like:


Generator -> Switch -> NOT Gate -> Light


where the NOT gate directly controls the light. The light still expects a generator (or another valid vanilla power source) somewhere upstream, by upstream I mean same circuit without bridging. The only thing I can realistically control is the power source itself, which is why I implemented the system the way I did.


What I can experiment with is transferring the available wattage information into that controlled Power Source so it mirrors the original generator's output minus it's load, but I can't guarantee it would work.
 
Yes, the reason I thought wireless is simplification, of tris, crossing multiple chunks,
the original way it was designed is more resource intensive than need be, most of
the original mechanics are.
What I might be able to try (though I can't promise it'll work) is creating a special Power Source that receives information about the available wattage from elsewhere and generates that same amount of power locally.
Your post above made me think even simpler, I am not thinking physically, only
representation. If you treat the map like one big block. You can build a power supply
on any tile or block, and have it set that as long as it has potential. Any on\off switch
in the game would work for the player.

To make it Controllable:

Tiered: a portable in the back pack could have a coverage range, of approx a small
POI. ""Bedrock to sky"" just like an LCB, the footprint is what matters. L and W.
So anything within the boundaries, that depends on electricity could be turned on and
off if a power supply with greater than 0 potential is placed within the boundary also.

Once again associated with the land claim property. Example: clone land claim,
call it power node or something else that fits. You may have to check the Lighting enabler
dll mod, I think it is one class that is changed to allow all lights to work in game.
But if it is associated with a custom power nod area. Then if placed and a T1 portable
generator Block is placed. The Generator and the Power node perimeter would work
together to make localized and player controlled versions of the Lighting enabler dll mod.
This block should have a rule like the regular blocks. so it can only be placed in a powernode
area only. It could look like 2 of the old 2 prong batteries, in a briefcase just as a visual.
The light still expects a generator (or another valid vanilla power source) somewhere upstream,
Not completely accurate. If that were the complete formula, the only lights that are on
in the game would be the lanterns, torches, and flashlights. Suspension of disbelief causes
this anomaly to be overlooked. There is no power to any the static lights they are just enabled.

For plausibility some generators were added, but mainly for quest support.

What I was suggesting is take advantage of that aspect, and base the power distribution
system on a system that does work, Which is what the Lighting enabler mod taps into vs one that
even the devs couldn't figure out.

The Other anomaly is: Unless the whole thing, meaning bomb/mutations/all but animals dead/
human bodies that are exsanguinated dried up husks/happened the day before. Then the torches,
liquid fueled lanterns, and most of the flashlights should have burned out. That is not semantics
or focusing on reality, that is inconsistency born of convenience and ease of enabling.
Simplification process abridged: Tiered Power node blocks for the various poi sizes. Controls the footprint
allowed to receive power create anywhere on the map by the player. Can be portable or perm depending
on tier. Power supplies, Portable rechargeable providing temp low power tiered up to permanent high yield.
The only way to transfer power would be if the Power supply were built or placed on a receiver power node
or if power supply were placed on a sender powernode a receiver power node area would need to be established.

The supporting mechanic derived from the Lighting enabler.

As a visual for a controlled area any one of the electronic connectors can be attached to the poi also, to enable
an area and make it a receptor. Solar farms would need wiring to connect to the banks, purely a visual for plausibility.
But basically to you it would simply be turning the entire map into an I\0 circuit. To everyone else it would be lights
work now. Also something like this if adapted by whomever is programming the game now could migrate to console.
 
Last edited:
I don't know what is possible with DLL mods with this game as I haven't programmed anything for the game and have only done simple XML mods, but there are often ways around problems when programming. I wouldn't give up entirely. Maybe there is a way to "trick" the game into multiple inputs. Maybe that does require a different connection than what you get with the wire tool, but if you have some form of connection between a source and a target, even if it's not a wire that is currently used for electrical, you may be able to not treat it as a new connection, but instead grab the data from the source (power state, amount of power available, etc.) and use it to manipulate the state on a target.

For example:

In vanilla, you have a power source that offers 100W of power and it connects to a relay and then to a light and the light draws the required power if the power state is on.

In a mod, you have a custom AND gate. It's just a block that doesn't really have inputs or outputs for power but does allow a special custom connection similar to what you're currently doing. If connected with the alternate "wire" (perhaps connected using a custom wire tool), the DLL reads the state of the sources connected to it (power state, amount of power, etc.) and then determines if all connected sources have a power state of on or not. If so, it sets the input power of the target equal to the power being supplied and sets the power state to on. If not, it sets the power state to off with no power. You're manipulating the values for the inputs and outputs of the electrical systems without really connecting multiple power sources to a single item. In the end, you don't really have a powered connection from the source to the target because there's no actual connection there. Instead, you're just manipulating the data for those inputs and outputs.

Now, there is a somewhat more complicated issue to consider. Power usage is related to how many items are being used (power draw). You would need to also find out what that power draw is and manipulate that value for the sources.

Here's a basic view of it:

Vanilla:
Generator > Relay > Light

Mod:

Generator 1 (not connected to anything directly, or if necessary to make it work, connected to its own relay)
Generator 2 (not connected to anything directly, or if necessary to make it work, connected to its own relay)

==> (connections from Generator 1 and Generator 2 are not made with normal wires but with a custom system that works like wires but doesn't actually use the input and output electrical connections)

Custom AND block

==> (connection from custom AND block to light made with the custom system instead of normal wires)

Light



In the above example, the mod reads the power state of Generator 1 and Generator 2 to see if they are on or off. If both are on (AND gate), it sets the power state for the input of the light to on. It checks the power draw of the light and anything else in the connection to see the total draw. It then compares that draw to the power available from the generators to see if there's enough power or not. If not, it works just like in the game when there's not enough power in a circuit. It also sets the power draw on the output of both generators (50% of total draw to each generator since there are 2 generators) so that the fuel usage changes the correct amount for the draw and so the draw is shown on the generators.

In the end, there isn't any real (vanilla electrical) connection through the AND gate but it's mimicked through data manipulation in the backrgound.

This *should* be possible, but like I said, I haven't programmed DLLs for this game and don't know what is available to use. Maybe they don't expose the input or output information or allow it to be changed. I don't know. But I'd say there could still be a way to make it work, that feels like normal electrical connections even if it's not. So don't give up. :)
I have to think about it futher, because the problem with this system is detection of available power generator provides and usage of it, so generator should detect the load otherwise we would just generate power on the point of conversion from my system to the vanilla one's out of nothing because genrator wouldnt be consumed and Ithink its possible only using vanilla electricity load (sensor,turret,switch etc,), but as i said i have few ideas but i cant guarantee it would work, but what i did manage to do is to enable using of vanilla wire tool for logic circuits so it should act the same except power transfer because its whole new problem to solve, to ilustrate the problem:

case 1 (your proposal)
generator1(produces 100w)\
and gate - ligh bulb -this cant work because light bulb expect vanila electricity pwoer source so i could do this
generator2(produces 100w)/
(both generator connected directly to the AND gate)

case 2
generator1(produces 100w)\
and gate - signal power source (controlled by signal) - ligh bulb - this is the only way it could work,
generator2(produces 100w)/
(both generator connected directly to the AND gate)

since case 2 is the only possible way my idea is to find a way to implement elemnt one the side of generator 1 and 2 (first main circuit) which would consume exactly is surplus of power they provide, in that way problem with consuming pwoer on genrator would be solved, but next problem is to transport power data to the signal power source and set it to produce exact same amount
 
Last edited:
Yes, the reason I thought wireless is simplification, of tris, crossing multiple chunks,
the original way it was designed is more resource intensive than need be, most of
the original mechanics are.
Your post above made me think even simpler, I am not thinking physically, only
representation. If you treat the map like one big block. You can build a power supply
on any tile or block, and have it set that as long as it has potential. Any on\off switch
in the game would work for the player.

To make it Controllable:

Tiered: a portable in the back pack could have a coverage range, of approx a small
POI. ""Bedrock to sky"" just like an LCB, the footprint is what matters. L and W.
So anything within the boundaries, that depends on electricity could be turned on and
off if a power supply with greater than 0 potential is placed within the boundary also.

Once again associated with the land claim property. Example: clone land claim,
call it power node or something else that fits. You may have to check the Lighting enabler
dll mod, I think it is one class that is changed to allow all lights to work in game.
But if it is associated with a custom power nod area. Then if placed and a T1 portable
generator Block is placed. The Generator and the Power node perimeter would work
together to make localized and player controlled versions of the Lighting enabler dll mod.
This block should have a rule like the regular blocks. so it can only be placed in a powernode
area only. It could look like 2 of the old 2 prong batteries, in a briefcase just as a visual.
Not completely accurate. If that were the complete formula, the only lights that are on
in the game would be the lanterns, torches, and flashlights. Suspension of disbelief causes
this anomaly to be overlooked. There is no power to any the static lights they are just enabled.

For plausibility some generators were added, but mainly for quest support.

What I was suggesting is take advantage of that aspect, and base the power distribution
system on a system that does work, Which is what the Lighting enabler mod taps into vs one that
even the devs couldn't figure out.

The Other anomaly is: Unless the whole thing, meaning bomb/mutations/all but animals dead/
human bodies that are exsanguinated dried up husks/happened the day before. Then the torches,
liquid fueled lanterns, and most of the flashlights should have burned out. That is not semantics
or focusing on reality, that is inconsistency born of convenience and ease of enabling.
Simplification process abridged: Tiered Power node blocks for the various poi sizes. Controls the footprint
allowed to receive power create anywhere on the map by the player. Can be portable or perm depending
on tier. Power supplies, Portable rechargeable providing temp low power tiered up to permanent high yield.
The only way to transfer power would be if the Power supply were built or placed on a receiver power node
or if power supply were placed on a sender powernode a receiver power node area would need to be established.

The supporting mechanic derived from the Lighting enabler.

As a visual for a controlled area any one of the electronic connectors can be attached to the poi also, to enable
an area and make it a receptor. Solar farms would need wiring to connect to the banks, purely a visual for plausibility.
But basically to you it would simply be turning the entire map into an I\0 circuit. To everyone else it would be lights
work now. Also something like this if adapted by whomever is programming the game now could migrate to console.
yes, i understand what you mean but i'm not sure if its feasible, first of all is if it's possible to transfer power without using vanilla electricity system, that is what i will test soon
 
(both generator connected directly to the AND gate)
Is it possible to have multiple And gates on the map using your process.
In order to allow transfer? One at source and one at destination.

I think it's because I am thinking of it, not as a power source. The reason why
goes back to the light enabler mod. If light is on at destination subtract over
time, if source = 0 then powered device shuts off.

The static lights, are not a traditional load. They do not connect to anything.
If the blocks are broken all around, they stay on, and plug into air. Air block is
the one universal block consistent across the map. Maybe the and property can
be added to the air block. It's illogical, but that is the only constant block that is
everywhere.

Without looking at it as power, I see it as just; if a 100W power supply is built, then
Light enabler would be activated for all lights, that normally would be considered
electrical. you push a switch and as long as the power supply is positive, light enabler
is active, if power supply hits 0 then light enabler shuts off. If that would work then it could expand
to other device types. Drain would then be the added draw of the devices over time.
At zero they all trip like a circuit breaker overload. so you don't get caught in a loop
of constant depletion.

Link please
 
Is it possible to have multiple And gates on the map using your process.
In order to allow transfer? One at source and one at destination.

I think it's because I am thinking of it, not as a power source. The reason why
goes back to the light enabler mod. If light is on at destination subtract over
time, if source = 0 then powered device shuts off.

The static lights, are not a traditional load. They do not connect to anything.
If the blocks are broken all around, they stay on, and plug into air. Air block is
the one universal block consistent across the map. Maybe the and property can
be added to the air block. It's illogical, but that is the only constant block that is
everywhere.

Without looking at it as power, I see it as just; if a 100W power supply is built, then
Light enabler would be activated for all lights, that normally would be considered
electrical. you push a switch and as long as the power supply is positive, light enabler
is active, if power supply hits 0 then light enabler shuts off. If that would work then it could expand
to other device types. Drain would then be the added draw of the devices over time.
At zero they all trip like a circuit breaker overload. so you don't get caught in a loop
of constant depletion.

Link please
I'll take a look into the light enabled mod first than i will see
 
Cool, you replicated the motion sensor trigger in the stores.

The light enabler defies power logic, and overrides the gated on off triggering.
We used the older one to adjust light color as well. But over time it was just reduced
to on off, in the code. Give me a sec I may still have an old snap.
 
Yeah, OCB's light enabler mod might be a good example of changing the state directly on the lights without looking at the power input. That should work the same way I was talking about, at least as far as changing the power state on the targets. But it should also be a similar method to change the power draw on the source.

this cant work because light bulb expect vanila electricity pwoer source so i could do this
I think this isn't necessarily correct. As with the light enabler mod, you can manipulate the light (or other target) to think there is power going to it when there isn't. You're just changing the power state yourself rather than letting the normal electricity connection control that. Maybe it's not possible, but I think it could be.

Btw, I really like using the light enabler mod and am missing it in 3.0 since it isn't updated yet. And I wish it still had the older version's color and intensity controls, though just turning lights on and off is still a plus.
 
Back
Top