+ Reply to Thread
Page 1 of 37 12311 ... LastLast
Results 1 to 10 of 361

Thread: E2 User Defined Functions

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

    Default E2 User Defined Functions

    Just so you know, Colonel Thirty Two is my in-game username.

    I have stopped working on this in favor of Starfall. It's in the same SVN.

    The SVN for v2 is at: https://col32swiremodaddons.googlecode.com/svn/
    The home page for it is at: col32swiremodaddons - Project Hosting on Google Code

    Wiki page for v2 (being written): Colonel Thirty Two's Wire Addons - GMod Wiki
    Last edited by Colonel Thirty Two; 11-17-2010 at 03:31 PM.

  2. #2
    Wire Sofaking N00bDud3's Avatar
    Join Date
    Jul 2009
    Location
    Error: Unknown Location
    Posts
    1,252

    Default Re: Colonel Thirty Two's Wiremod Addons

    Function support?!?!?! If I try it and it works you are getting rep+



  3. #3
    has a custom title mattwd0526's Avatar
    Join Date
    Apr 2009
    Location
    Born Bostonian
    Posts
    2,652

    Default Re: Colonel Thirty Two's Wiremod Addons

    OH MY GOD THIS WHAT EVERYBODY HAS BEEN ASKING FOR FOREVER!

    (lowercase)

  4. #4
    http://somone77.net somone77's Avatar
    Join Date
    Jun 2008
    Location
    <Smart ass location>
    Posts
    614

    Default Re: Colonel Thirty Two's Wiremod Addons

    Is...Is it real?


    No matter how many Z's you put after Plz, you still spell as well as a piece of cheese.

    http://somone77.net

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

    Default Re: Colonel Thirty Two's Wiremod Addons

    Check it out and see

    I plan to edit the parser+compiler to support "calling" a variable.
    Last edited by Colonel Thirty Two; 05-16-2010 at 12:59 PM.

  6. #6
    Wire Sofaking jacoby6000's Avatar
    Join Date
    Feb 2008
    Location
    behind you when you aren't looking
    Posts
    792

    Default Re: Colonel Thirty Two's Wiremod Addons

    So UDF?!? But is it E2 udf, or do you write the lua of the function in the e2? Either way, AWESOME!!!!!!!!
    Quote Originally Posted by Garrysmod View Post
    Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here.
    I'm not stupid!
    In [his] experience that was a sentence never to be uttered except to prove its own inaccuracy
    --Orson Scott Card

  7. #7
    http://somone77.net somone77's Avatar
    Join Date
    Jun 2008
    Location
    <Smart ass location>
    Posts
    614

    Default Re: Colonel Thirty Two's Wiremod Addons

    Your documentation on the functions is, no offence, awful. I can't get the virtualizer to work at all. In the readme you say to use code:<something>, the E2 says that code needs to have () after it, when I do that it says no such function. Can you give an example code for these?


    No matter how many Z's you put after Plz, you still spell as well as a piece of cheese.

    http://somone77.net

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

    Default Re: Colonel Thirty Two's Wiremod Addons

    Okay, here's an example program for the virtualizer:
    Code:
    @persist Code:code
    runOnChat(1)
    
    if(chatClk(owner()))
    {
        TempCode = virtCompile(lastSaid())
        if(TempCode)
        {
            Code = TempCode
            Code:exec()
        }
        else
        {
            hint(virtLastError(),4)
        }
    }
    This will try to compile whatever you say in chat. Ex. If I said "entity():setColor(vec(0,0,0))" the chip will turn black. code:<whatever> just means that it is a method of code, like

    I'll put this in the readme.

  9. #9
    http://somone77.net somone77's Avatar
    Join Date
    Jun 2008
    Location
    <Smart ass location>
    Posts
    614

    Default Re: Colonel Thirty Two's Wiremod Addons

    Quote Originally Posted by initrd.gz View Post
    Okay, here's an example program for the virtualizer:
    Code:
    @persist Code:code
    runOnChat(1)
    
    if(chatClk(owner()))
    {
        TempCode = virtCompile(lastSaid())
        if(TempCode)
        {
            Code = TempCode
            Code:exec()
        }
        else
        {
            hint(virtLastError(),4)
        }
    }
    This will try to compile whatever you say in chat. Ex. If I said "entity():setColor(vec(0,0,0))" the chip will turn black. code:<whatever> just means that it is a method of code, like

    I'll put this in the readme.
    So are the inputs and outputs the same for the virtual code?


    No matter how many Z's you put after Plz, you still spell as well as a piece of cheese.

    http://somone77.net

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

    Default Re: Colonel Thirty Two's Wiremod Addons

    No, you give the inputs to the virtualized program via passing a table to the exec function, and get outputs by calling Code:getOutputs(). Inputs and outputs in virtualized code are defined by the @inputs, ect syntax in the code string.

    EDIT: Example static code:
    Code:
    String = "@inputs Stuff:vector \n"+
    "entity():applyForce(stuff)"
    
    Code = virtCompile(String)
    Args = table()
    Args["Stuff",vector] = vec(0,0,1000)
    Code:exec(Args)

+ Reply to Thread
Page 1 of 37 12311 ... 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