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
- 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.
- maxsounds - Number - The maximum amount of sounds that can be played at a time.
- enabled - Toggled - Is this feature enabled?
Client Cvars
- cl_enabled - Toggle - Toggle whether you will hear sounds being streamed to you by this feature.
Commands
- Userallow <name substring> - Allows a user access to the stream function.
- Userdeny <name substring> - Denies a user access to the stream function.
- Groupallow <usergroup> - Allows all members of a usergroup access to the stream function.
- 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:
If you need more than 1 argument, just put a comma and another datatype (infinite flags like printColor())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>
}
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))


LinkBack URL
About LinkBacks




Reply With Quote












Bookmarks