+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 10 of 27

Thread: [E2] Streaming sounds, closed comments, functions, and console screen color

  1. #1
    Wire Amateur H3adSh07 is on a distinguished road H3adSh07's Avatar
    Join Date
    Apr 2009
    Location
    Texas, United States
    Posts
    38

    Default [E2] Streaming sounds, closed comments, functions, and more

    Part 1: Streaming Sounds
    Could there be a possibility of streaming sounds from an E2 from the server using a DLL? Possibly using AzuiSleet's gm_bass module? For those who say it can't be done due to Garry blocking binary downloads, it can be added to the SVN so all that have updated wire can hear it.

    Commands:
    soundStreamPlay(<index>,<String path to file>)
    Streams a sound from the expression.

    soundStreamStop(<index>)
    Stops a sound that is streaming from the expression.

    soundStreamPitch(<index>,<N pitch>)
    Sets the pitch of a sound that is streaming from the expression.

    soundStreamVolume(<index>,<N volume>)
    Sets the volume of a sound that is streaming from the expression.



    Example:
    @name Streamtest
    if(first()|duped()){
    soundStreamPlay(1,"ravebreak.mp3")
    }

    The server could have a few convars and commands to limit this to where it can't be abused. Here are a few I have in mind (name is what is after wire_expression2_stream_):
    Name - Type - Description
    Server Cvars
    1. restrictionlevel - Number - If the input level is 0, everyone can use it, if 1, only admins can use it, if 2, only superadmins can use it.
    2. maxsounds - Number - The maximum amount of sounds that can be played at a time.
    3. enabled - Toggled - Is this feature enabled?

    Client Cvars
    1. cl_enabled - Toggle - Toggle whether you will hear sounds being streamed to you by this feature.

    Commands
    1. Userallow <name substring> - Allows a user access to the stream function.
    2. Userdeny <name substring> - Denies a user access to the stream function.
    3. Groupallow <usergroup> - Allows all members of a usergroup access to the stream function.
    4. Groupdeny <usergroup> - Denies all members of a usergroup access to the stream function.






    Part 2: Closed Comments
    This is a small thing that I wish E2 had ever since I started learning Lua. The ability to close comments. Here is an example of how to use it:
    @name Test
    if(first() #[If the expression was run for the first time]|duped() #[If the expression was spawned via duplication]){
    print("Expression loaded successfully!")
    }





    Part 3: Functions
    I think this is something that could revolutionize E2 and cut the code lengths down a lot. The ability to write functions in expression 2. By writing functions, I mean making functions like the ones in Lua.
    Use:
    Used for creating functions.
    functionCreate(<String Name of function>, <Variable with datatype for arguments in parenthesis (Optional)>){
    <Code for what the function does goes here>
    }


    Used for running the functions.
    function(<String Name of function>, <Arguments (Optional)>){
    <Code for what the function does goes here>
    }
    If you need more than 1 argument, just put a comma and another datatype (infinite flags like printColor())


    Example:
    @name Simple Entity Cloaking by H3adSh07
    @persist [T1, T2]:normal
    runOnTick(1)
    if(first()|duped){
    functionCreate("cloak",Ent(entity)){
    if(Ent!=noentity()){
    Ent:setColor(0,0,0,0)
    print("Entity cloaked.")}
    }
    functionCreate("uncloak",Ent(entity)){
    if(Ent!=noentity()){
    Ent:setColor(255,255,255,255)
    print("Entity uncloaked.")}
    }
    }
    T1 = owner():attack1()
    T2 = owner():attack2()

    if(T1&$T1){
    function("cloak",owner():aimEntity())
    }

    if(T2&$T2){
    function("uncloak",owner():aimEntity())
    }





    Part 4: Console Screen Color
    I think the console screen's way of coloring should be different, rather than using a 3 digit number, it should accept a 3d or 4d vector (3d for an RGB color, and 4d for an RGBA color)
    There's no need for an example or usage code, simply add to the console screen wirelink functions where you input a 3 digit number for color accept a 3 digit number, a 3d vector, and a 4d vector.



    Part 5: E2 Drawscreen (Edit 1)
    A screen for those who don't want to have to learn 2 very different languages just to draw a simple percent bar. Would be used with a wirelink on E2.

    A few commands to give you an idea of what it could be used for:
    XWL:drawRect(V2,V2,V4) - Draws a rectangle at the first argument with the 2nd argument's size and the 3rd arguments color.

    Example:
    Screen:drawRect(vec2(0,0), vec2(10,100), vec4(255,0,0,255))
    XWL:drawText(S,V2,N,N,V4) - Draws text at a point with the given string, fontnumber, size, and color.

    Example:
    Screen:drawText(vec2(0,0), "Hello world!", 1, 10, vec4(255,255,255,255))
    XWL:drawPoly(R) - Draws a polygon with the corners at the given points.

    Example:
    Points = array(vec2(0,0), vec2(10,10), vec2(10,90), vec2(0,100), vec2(0,0))
    Screen:drawPoly(Points, vec4(200,0,0,255))
    Last edited by H3adSh07; 11-19-2009 at 11:45 AM. Reason: Added another suggestions

  2. #2
    Wire Sofaking ryland is on a distinguished road ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    489

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    As much as I would like to have console screen color like that...
    I don't think its possible in the current model, because it would have to take up three memory cells instead of one.
    Or it could vary well be possible.

  3. #3
    Wire Sofaking Unsmart is on a distinguished road Unsmart's Avatar
    Join Date
    Dec 2008
    Location
    Slovakia OR BANland
    Posts
    932

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    Quote Originally Posted by ryland View Post
    As much as I would like to have console screen color like that...
    I don't think its possible in the current model, because it would have to take up three memory cells instead of one.
    Or it could vary well be possible.
    yeah, the current con screen is made for CPU hispeed crap, so E2 had to live with it


    ----
    stream: epic idea, but only if it was admin only

    -----
    functions: its a must, but the devs are working on this

  4. #4
    Spucatum Tauri
    Bull is a splendid one to behold Bull is a splendid one to behold Bull is a splendid one to behold Bull is a splendid one to behold Bull is a splendid one to behold Bull is a splendid one to behold Bull is a splendid one to behold Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    3,455

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    1. DLL's are not committed to the official wiremod SVN ever.
    2. Why would you want to do that? I looks very, very messy.
    3. Would be handy, but has been suggested a million times before.
    4. That's not just a matter of changing wirelink, that requires a total different memory layout for the console screen. ( You can't stuff 2 RGB values and boolean in one memory cell.) And it's a screen to output text/values, the 0-999 values are very well sufficient for that.
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That
    The Great Report Button Quiz.

  5. #5
    Wirezard


    Matte is a jewel in the rough Matte is a jewel in the rough Matte is a jewel in the rough Matte is a jewel in the rough Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    2,094

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    2. I think there is an option to comment selected text.
    3. Functions are already on the TODO-list.


    EDIT: Seems you can only comment blocks made up of whole lines.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr


  6. #6
    Wire Amateur H3adSh07 is on a distinguished road H3adSh07's Avatar
    Join Date
    Apr 2009
    Location
    Texas, United States
    Posts
    38

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    Quote Originally Posted by Bull View Post
    1. DLL's are not committed to the official wiremod SVN ever.
    D:


    Quote Originally Posted by Bull View Post
    2. Why would you want to do that? I looks very, very messy.
    My example was just to give an idea of what it could be used for. :P


    Quote Originally Posted by Bull View Post
    3. Would be handy, but has been suggested a million times before.
    If it's been suggested several times, why hasn't it been done?


    Quote Originally Posted by Bull View Post
    4. That's not just a matter of changing wirelink, that requires a total different memory layout for the console screen. ( You can't stuff 2 RGB values and boolean in one memory cell.) And it's a screen to output text/values, the 0-999 values are very well sufficient for that.
    Ahh, I didn't know CScreen was designed for CPU.. Why not make another screen for text that's designed for E2 wirelinks then? A cross between GPU and wire? Like Screen:drawRect(vec2(0,0),vec2(100,100))?

  7. #7
    Bug Buster

    TomyLobo has a spectacular aura about TomyLobo has a spectacular aura about TomyLobo's Avatar
    Join Date
    Feb 2009
    Posts
    2,772

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    1. soundStream? what is that supposed to stream from/to?
    you already have soundPlay, which plays sounds on all clients.
    and you can set up your server to send the sounds to all clients when they connect.

    2. has been discussed before but we couldn't agree on a syntax. yours looks nice, I'll discuss it with Syranide

    3. we already have a syntax for functions (which is a lot better than yours btw) the problem is that Syranide has to findenough time to implement them

    4. I could make an overload for the writeString function that automatically translates a given vector into the color number
    but it'd still only have those 10 values per channel

    PS: your sig is too large
    Last edited by TomyLobo; 11-19-2009 at 08:30 AM.
    "It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup

    Lífið læðist lúmskt áfram

  8. #8
    Wire Sofaking ryland is on a distinguished road ryland's Avatar
    Join Date
    Oct 2009
    Location
    Card bord box next to wal-mart.
    Posts
    489

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    That would be fine with me.

  9. #9
    Wire Amateur H3adSh07 is on a distinguished road H3adSh07's Avatar
    Join Date
    Apr 2009
    Location
    Texas, United States
    Posts
    38

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    Seeing as how console screen is so limited, I added another part suggesting a drawscreen for E2.

  10. #10
    Wire Sofaking Wizard of Ass will become famous soon enough Wizard of Ass will become famous soon enough Wizard of Ass's Avatar
    Join Date
    May 2009
    Location
    Germany Bremerhaven
    Posts
    818

    Default Re: [E2] Streaming sounds, closed comments, functions, and console screen color

    Instead of requesting a load of laggy functions.

    Why not learning GPU?

    EDIT: Also why you want ALPHA channel on a screen????
    seriously getting serious

+ Reply to Thread
Page 1 of 3
1 2 3 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 01-29-2010, 05:35 PM
  2. Color in Digital Screen
    By Mechanical433 in forum Wiremod General Chat
    Replies: 4
    Last Post: 02-09-2008, 06:48 AM
  3. Color screen
    By CCFreak2K in forum Ideas & Suggestions
    Replies: 6
    Last Post: 12-18-2007, 09:44 AM
  4. Wired CCD and Color Screen
    By Mad_Gouki in forum Ideas & Suggestions
    Replies: 7
    Last Post: 09-15-2007, 11:15 PM
  5. Streaming (Webcam) Video to a Wire Screen
    By eth0 in forum Ideas & Suggestions
    Replies: 13
    Last Post: 07-25-2007, 12:33 PM

Tags for this Thread

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