The Wiremod wiki merged with the Gmod wiki.
Hello, could someone show me a simple example of a stool that spawns a box with the input of something like "A" and an output of X,Y,Z and X,Y,Z are only set when A is above 0?
Its not that I really want to use it, but rather so I can actually understand the wire input and output functions for lua, as I am overly confused.
If not, can you at least point me in the right direction?
Off topic: what happened to the wiremod.com wiki?(wiremod.com/wiki)?
Earth ? God -∞ - 2012
Kittens ? God -∞ - 2010
------------------------
This is just part of the code needed to get this entity working (Remember you need more stuff in initialize like PhysicsInit and whatever)
Code:function ENT:Initialize() self.Inputs = Wire_CreateInputs( self.Entity, {"A"} ) self.Outputs = Wire_CreateOutputs( self.Entity, {"X", "Y", "Z", "XYZ [VECTOR]"} ) self.AllowChange = false end function ENT:TriggerInput( inputname, value ) if (inputname == "A") then if (value == 0) then self.AllowChange = false else self.AllowChange = true end end end function ENT:Think() if (self.AllowChange) then local pos = self:GetPos() Wire_TriggerOutput( self.Entity, "XYZ", pos ) Wire_TriggerOutput( self.Entity, "X", pos.x ) Wire_TriggerOutput( self.Entity, "Y", pos.y ) Wire_TriggerOutput( self.Entity, "Z", pos.z ) end end
SVN Tutorial
My SVN:Get dropbox and get 250 MB extra space: DropboxCode:http://divranspack.googlecode.com/svn/trunk/%20divranspack/
Ahh, thank you
that was very helpful, and I think if I look at some code, I should get the idea of everything else an entity needs![]()
Earth ? God -∞ - 2012
Kittens ? God -∞ - 2010
------------------------
Bookmarks