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.
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))
Last edited by H3adSh07; 11-19-2009 at 12:45 PM. Reason: Added another suggestions
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.
New server IP: 89.238.160.17:27018
Hologram contraptions 1 Holo contraptions 2 EGP stuff Holo minigun Holo javelin rocket launcher
Unsmart: I doubt the intelligence of some people.
Drunkie: Nobody could have said that any better than Unsmart.
Unsmart: Solece, I totally did your mom yesterday
Solece: Who hasnt
Divran: there are more retarded people than there are clever people in this world
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.
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
D:
My example was just to give an idea of what it could be used for. :P
If it's been suggested several times, why hasn't it been done?
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))?
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 09: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
That would be fine with me.![]()
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
Bookmarks