fryakatkop Posted August 13, 2017 Share Posted August 13, 2017 Logic Gate for A16.3 + SDX 0.7.1 Intro Hello fellow survivors, I love the new Powersystem TFP introduced in A16. After tons of hours in A16 exp and stable, i found there is missing something to make the fancy circuits i'd like to have. imagine a triggerplate you can stand on or a motionsensor to temporary disable your electrofences while you are in the Area. So we need some kind of NOT Gate, this raised the idea in my Head. Idea One main logic block which you can add input gates as you need. It will have 3 possible AND inputs: place a Gate Block, then add a input gate in front, this will be your first AND input. Standing on the gate block, you can add now your 2nd or 3th input left or right of the first input gate Any AND input will have up to 3 OR inputs: add a input gate in row of a AND input, this will be logic OR with other input gates inline The output (continue wire from main logic block) and any InputGate can be toggled to be ActiveLOW or ActiveHigh. Download not yet available, sorry Repository https://github.com/FrYakaTKoP/7dtd-SDX-LogicGates About i'm a electronic technician with some little C# experience. With +1500 hrs ingame and some simple XML modding i like to go the next step into modding this awesome game. But don't expect this to complete quickly, it's done when it's done Development Status - under development / not released Still got some unsolved problems/questions/todo: - how to restrict placeing at side of a block (so it can only be place on ground) - is it possible to have unlimited AND or OR input gates? - find the Bug causeing the output to not update children with activeHigh outputmode - implement inputGate code - implement OR functionallity any suggestions are welcome FrY Link to comment Share on other sites More sharing options...
AnsontheToad Posted August 15, 2017 Share Posted August 15, 2017 Love this idea. The game really needs the ability to setup more complex circuits. This would add so many possibilities. Link to comment Share on other sites More sharing options...
fryakatkop Posted August 15, 2017 Author Share Posted August 15, 2017 thanks @AnsontheToad still trying to understand the powersystem i can connect wire to my custom block BlockLogicGate : BlockPowered (it consums power from the generator too) but still didn't find the right event to start my script. ILSpy, NPP++ and SDX seems not to be the optimal reverse engineering environment, i would almost die for live debugging (or API docu). Link to comment Share on other sites More sharing options...
fryakatkop Posted August 27, 2017 Author Share Posted August 27, 2017 small update... like you may see in the video the output changes to OFF (watch lamps) when the 2nd input changes as it should. If i turn it back on my code change the color and output state as it should, but the consumers don't notice. I need to Interact (player) with anything in the PowerNet to update the output state. strange thing is that onBlockActivated (Player interact with block) seems to update the state too. But i removed all related "power" code in there. Seems that there is something before or after which invokes the update. (nope calling it from my script does not update it) Anybody got some insight how to update the isPowered state of childrens TileEntityPoweredTrigger? ** Updated OP Link to comment Share on other sites More sharing options...
fryakatkop Posted September 24, 2017 Author Share Posted September 24, 2017 dev diary update... [video=youtube_share;e2jOox98sfo] a list of things you may see in the video... - 3 AND inputs are working (normal wire relays still -> no OR Gates and ActiveLow) - Power indicator is working - Toggle activeHigh / Low outputMode incl. indicator is working - Output indicator is working - Output is working when activeLow outputMode (still a bug where the children did not receive power correctly) if you like to play arround with this, you can download it on github but there is still alot to change which will break savegames. ** updated OP ** update 26 Sept found a way to add light to the vanilla wirerelay model. Maybe there is no need for a custom model for the input. some eye candy: Link to comment Share on other sites More sharing options...
the_rad_pothead Posted September 27, 2017 Share Posted September 27, 2017 so im sure this is wut im thinking is this gonna be like a power controller so to speak ? if not is it possible to make a gate with that function??:/ Link to comment Share on other sites More sharing options...
fryakatkop Posted September 27, 2017 Author Share Posted September 27, 2017 I'm not sure what you mean with power controller? If you mean a power management controller, where is limiting/monitoring/managing power/consumption, no this isn't. Don't know atm., if this is even "possible", without changing the whole electricity system from TFP. This mod adds a method to logically connect two (or more) powerwires (or more exactly their state). Which means you could connect your bladetrap (or other powered blocks) so it would turn on if your Pressureplate and Trapwire are triggered, but turn back off if a camera triggers too. if your interested to learn more about logic gates :https://en.wikipedia.org/wiki/Logic_gate FrY Link to comment Share on other sites More sharing options...
the_rad_pothead Posted September 30, 2017 Share Posted September 30, 2017 I'm not sure what you mean with power controller? If you mean a power management controller, where is limiting/monitoring/managing power/consumption, no this isn't. Don't know atm., if this is even "possible", without changing the whole electricity system from TFP. This mod adds a method to logically connect two (or more) powerwires (or more exactly their state). Which means you could connect your bladetrap (or other powered blocks) so it would turn on if your Pressureplate and Trapwire are triggered, but turn back off if a camera triggers too. if your interested to learn more about logic gates :https://en.wikipedia.org/wiki/Logic_gate FrY sorta but wut I meant was like ur gates but with different input n output for wires and power and read and act like one of us is there sorta like afk switches but a controlled sequence - - - Updated - - - n nvm I take that back exactly like ur gates but like an auto read on the cable sorta thing Link to comment Share on other sites More sharing options...
the_rad_pothead Posted September 30, 2017 Share Posted September 30, 2017 or a gui on the device nothing fancy just a more controlled version of a gate and multiple ins and outs :/ but might be harder than sayin :/ Link to comment Share on other sites More sharing options...
fryakatkop Posted September 30, 2017 Author Share Posted September 30, 2017 with different input n output for wires and power and read and act like one of us is there sorta like afk switches but a controlled sequence May a advanced "timerrelay" with programable sequence? I need to think about this a little more, but obvious a new mod or atleast i need to finish the main- and inputgate first. or a gui on the device nothing fancy just a more controlled version of a gate and multiple ins and outs already thought about a small ui but more the simple version where you still have alot of variety but only one config per 'Gate' the ActiveLow/High input-/outputMode. I will definitely look into ui modding, but atm the simple "<E> toggle Output Mode" seems pretty nice. And with this Hardcoded 3 input AND Gate which any AND input can have 3 OR inputs, which are all switchable to inverse there activestate. You could do really heavy logical circuits, i can not see a limitation then performance . You could even build a CPU, since all you need are NAND gates, btw. speaking of future plans, i may look into: - remote controlled switchbox a switchbox where you can add inputs and give them a uniqe number. Then a second box else where in the world could be connected to it as remotecontrolled output. Byebye wire mess - chat spammer block a block where you can define a sentence to be sent to chat. Setup your sentence, select worldchat, place pressureplate, wireup and jump, jump, jump </OffTopic> ** I added the code for the 3 OR inputs and activeLow to the inputs. Got almost all features in, still alot code cleanup and improvement todo. And the output not receive power bug still persist FrY Link to comment Share on other sites More sharing options...
javysirius Posted January 30, 2019 Share Posted January 30, 2019 More updating? Please need this mod on my world xD Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.