Wire 2 should be able to do anything Wiremod can do and there will be a chip that can link a Wire 2 circuit to a Wiremod circuit so that you don't have to wait for things to be ported.
ICs are built by placing a blank PCB, building a circuit on it with normal chips, right-click on it with the PCB tool and either shift-click(sprint+fire) to place it as an IC or add it to the chip tools list and use that to spawn it. You include ports by adding port chips to the PCB, their name and location is used to place the actual ports when it is spawned as an IC.
The SVN will be at the same address except \wire2 instead of \wiremod. It checks out into addons\wire2 instead of just addons so it won't conflict with the current SVN.
I will most likely be adding rotate and snap to the chip tool. I'm thinking of making it so shift-clicking places using rotate and snap and normal clicking places instantly but using the previous rotation.
To hopefully answer everybodies coding questions, but mostly likely create more, here's an 8 port and gate scomponent:
and the constant value:Code:SCMP.Group = "Logic" SCMP.Name = "And (All)" function SCMP:Init() ****Wire2Lib.AddPort(self, 'Value', WT_BOOL, WD_OUT, 26, 0, self.CalculateResult) ****for y=0,3 do ********for x=0,1 do ************local name = string.char(string.byte('A') + x*4 + y) ************self.Inputs, Wire2Lib.AddPort(self, name, WT_BOOL, WD_IN, -26 + x*16, -24 + y*16, nil, true)) ************Wire2Lib.SetDepends(self, name, self.Ports.Value) ********end ****end end function SCMP:CalculateResult(port, cache) ****for _,p in pairs(self.Inputs) do ********if (!Wire2Lib.GetValue(p, cache)) then return false end ****end ****return true end
I'll be adding full type support to that last one soon. The interface is only 90% final at the moment but it shouldn't change too much.Code:SCMP.Group = "I/O" SCMP.Name = "Constant" if (CLIENT) then ****CreateClientConVar("scmp_constant_value", "0", true, true) end function SCMP:Init() ****Wire2Lib.AddPort(self, 'Value', WT_NUMBER, WD_OUT, 26, 0, self.GetValue) end function SCMP:Setup(ply) ****self.Value = ply:GetInfoNum("scmp_constant_value") end function SCMP:Save(save, dest) ****save(self.Value, dest) end function SCMP:Load(load, src) ****self.Value = load(src) end function SCMP:GetValue() ****return self.Value end function SCMP.BuildCPanel(panel) ****panel:AddControl("Slider", { ********Label = "Value:", ********Type = "Float", ********Min = "-10", ********Max = "10", ********Command = "scmp_constant_value" ****}) end


LinkBack URL
About LinkBacks







Reply With Quote





Bookmarks