+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: WireNetwork PCMod2 addon

  1. #1
    Wire Sofaking immibis's Avatar
    Join Date
    Nov 2009
    Location
    Wellington, New Zealand
    Posts
    401

    Default WireNetwork PCMod2 addon



    What is this?
    This adds a simple program to PCMod 2 computers (servers only). The program uses an attached I/O Device to tunnel wire links over a PCMod network.
    You give it the IP address of another computer running the program, and it transmits data.
    Technically, it isn't a Wiremod addon because it doesn't interface directly with Wiremod (the attached I/O Device does), but since it's only useful in the context of Wiremod I'm posting it here.

    How do I install this?
    1. Extract this into garrysmod/addons/pcmod/
    2. Open garrysmod/lua/pcmod/sh_config.lua and find the line starting with "cfg.FullProgramList" (without quotes)
    3. Add ",wirenetwork" (without quotes) to the end of the list, before the last quote.
    4. Start GMod.

    How do I interface this with Wiremod devices?

    Input F is the clock. When input F changes from 0 to 2, the numbers in A-D are stored as the target IP address (A.B.C.D). When input F changes from 0 to 1, if there is a saved IP address it sends the values of inputs A-E to that IP address.

    Outputs 1-5 receive the values of A-E when a packet is received.
    Output 6 is the output clock. It toggles between 1 and -1 when a packet is received, 2 and -2 if a "net port locked" error is received (indicating that the port has been locked via the firewall), 3 and -3 if a "net port closed" error is received (indicating the other computer is not running the program).



    Also, this is my first Lua scripting and first garrysmod.org upload. I started this without even knowing Lua, but it seems to work. Just don't be too surprised (but do be a little bit surprised, because I did test it) if it doesn't work for you.

    0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f

  2. #2
    Banned Buggzie's Avatar
    Join Date
    Dec 2009
    Location
    Under your bed
    Posts
    281
    Blog Entries
    1

    Default Re: WireNetwork PCMod2 addon

    Isn't there already a PCMOD v2?

  3. #3
    Wire Sofaking emspike's Avatar
    Join Date
    Feb 2008
    Posts
    911

    Default Re: WireNetwork PCMod2 addon

    Quote Originally Posted by Buggzie View Post
    Isn't there already a PCMOD v2?
    Quote Originally Posted by immibis View Post
    This adds a simple program to PCMod 2 computers (servers only).
    Read first :P

    Didn't PCMod2 interfere with Wire? Or am I thinking of something else?

  4. #4
    Banned Buggzie's Avatar
    Join Date
    Dec 2009
    Location
    Under your bed
    Posts
    281
    Blog Entries
    1

    Default Re: WireNetwork PCMod2 addon

    Quote Originally Posted by emspike View Post
    Read first :P

    Didn't PCMod2 interfere with Wire? Or am I thinking of something else?
    PCMod2 doesn't use wire.

  5. #5
    Wire Sofaking nescalona's Avatar
    Join Date
    Apr 2007
    Location
    Shoreline, Washington
    Posts
    1,299

    Default Re: WireNetwork PCMod2 addon

    PCMod interfered with Wire, because of some filename overlap I think. This is no longer a problem in PCMod2 IIRC

  6. #6
    Wire Sofaking Grocel's Avatar
    Join Date
    Mar 2008
    Location
    Germany, NRW, Remscheid
    Posts
    751

    Default Re: WireNetwork PCMod2 addon

    Quote Originally Posted by emspike View Post
    Read first :P

    Didn't PCMod2 interfere with Wire? Or am I thinking of something else?
    Yes, it has, but it's pretty useless, it's like the wire debugger, but one you you have to wiring it up and refresh it manually, so far I know it only supports numbers.
    Quote Originally Posted by Wizard of Ass View Post
    The secret phrase in gmod is: Rusty bullet hole
    Im a molecule!

  7. #7
    Wire Sofaking immibis's Avatar
    Join Date
    Nov 2009
    Location
    Wellington, New Zealand
    Posts
    401

    Default Re: WireNetwork PCMod2 addon

    I am open to suggestions how this could transfer data other than numbers, given that the I/O Device only supports 6 numeric inputs and 6 numeric outputs. If it could transfer strings, it could interact with chat servers and printer servers.

    Edit:
    Just noticed Grocel was talking about PCMod2's built-in wire program, not this one. If you want to send strings, program an E2 to do it I suppose.
    I still can't think of any practical reasons to use this addon.
    Last edited by immibis; 07-19-2010 at 03:23 AM.

    0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f

  8. #8
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: WireNetwork PCMod2 addon

    Isn't there a "WireAdjustSpecialInputs" function or something?

  9. #9
    Wire Sofaking immibis's Avatar
    Join Date
    Nov 2009
    Location
    Wellington, New Zealand
    Posts
    401

    Default Re: WireNetwork PCMod2 addon

    Quote Originally Posted by initrd.gz View Post
    Isn't there a "WireAdjustSpecialInputs" function or something?
    Apparently not.

    What would this function do, anyway?

    0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f

  10. #10
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: WireNetwork PCMod2 addon

    Dug up from E2's init.lua:
    Code:
    	self.Inputs = WireLib.AdjustSpecialInputs(self.Entity, self.inports[1], self.inports[2])
    	self.Outputs = WireLib.AdjustSpecialOutputs(self.Entity, self.outports[1], self.outports[2])
    I am assuming it re-creates inputs/outputs based on the provided tables. First table is the names, second is the types.

+ Reply to Thread
Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots