• gm_g15 - Garrysmod G15 Interface (Realtime)
    90 replies, posted
[release] [b][url=http://tezzanator.net/?p=4]Logitech g15 Garrysmod interface DLL[/url][/b] [b]Download:[/b] [url]http://www.tezzanator.net/download/click.php?id=5[/url] (839KB - Zip) (Includes the DLL, An extended DLL, BMP-to-Lua and source code and docs for everything!) Function Overview: [url]http://tezzanator.net/downloads/Lua/docs/gm_g15/[/url] [b]Just want to use your G15 without developing?[/B] Robert (Trebor on FP) is my partner on this project and has created a VERY awesome widget system for you to use! Thread: [url]http://forums.facepunchstudios.com/showthread.php?t=422348[/url] [/release] [release] [b]Requirments[/b] A Logitech G15 Garrysmod A shred of intelligence Logitech LCD Manager: [img]http://img216.imageshack.us/img216/6379/lcdmankh8.png[/img] [b]Screenshots:[/b] [img]http://tezzanator.net/images/gm_g15_1.JPG[/img] Pictures from lemming77: [img]http://img221.imageshack.us/img221/3089/dscf0262ee2.jpg[/img] [img]http://img229.imageshack.us/img229/543/awesometv4.jpg[/img] BMP-to-Lua: [img]http://img177.imageshack.us/img177/3331/bmptoluawh2.jpg[/img] [/release] This DLL provides a Coder-friendly interface to the logitech g15 LCD, It also supports the software emulator provided by logitech to test scripts. Usage (There's samples in the zip, This is a basic text example): [lua] local client = LocalPlayer() require("g15") --bEmulator: False -- SET TO TRUE IF YOU ARE TESING ON AN EMULATOR g15.createLCD(false, "Gmod: Basic health sample") -- Health Text -- ID: 1 -- Scrolling: False -- Size: 1 -> Small -- Alignment: 1 -> Left -- Width: 120 Pixels -- Lines: 1 g15.addtext( 1, false, 1, 1, 120, 1 ) -- ID: 1 -- X: 0 -- Y: 0 g15.settextorigin( 1, 0, 0 ) function onThink() if !client:Alive() then return end -- We are modifying the text we created at ID 1 g15.settexttext( 1, "Health: " .. client:Health() .. "%" ) -- Update the LCD to show the changes g15.updateLCD() end hook.Add( "Think", "updater", onThink ) [/lua] The buttons can also be polled!: [lua] local client = LocalPlayer() require("g15") g15.createLCD(false, "Gmod: Button input sample") function onThink() if !client:Alive() then return end if (g15.isbuttonpressed(0)) then client:ConCommand("say I pressed button 1 on my g15!") end -- Update the LCD g15.updateLCD() end hook.Add( "Think", "updater", onThink ) [/lua] Credits: Tezzanator92 - The script/coding Robert - Ideas, Lua help and various usefullness; And volunteering his g15 for testing! (I don't own one), And his great work on the widget manager.
Lua King'ed. Gmod stats on my G15! :D
Nice tezz! (too bad i don't have a G15... :argh:)
Is there a max amount of IDs you can have? I don't know how the G15 works, so is there a max amount of lines that can be displayed?
[QUOTE=UberMensch]Is there a max amount of IDs you can have? I don't know how the G15 works, so is there a max amount of lines that can be displayed?[/QUOTE] By default You can have: 64 texts 64 pbars 128 boxs 128 pxs (The Id system is part of my DLL) But you can recompile changing the size of the arrays for more (Though this may suck resources), I think these are decent values, 64 Pieces of text ;) The screen on the g15 is 160x43, So whatever you can fit on that (Also supports pages) The DLL also supports the Hardware buttons through lua (See samples) [highlight]I Accidently uploaded my Debug DLL. So if it doesn't work; REDOWNLOAD. Sorry, My bad :D[/highlight]
Just saying to hold on and take care of your G15's, they discontinued it and replaced it with this "new" G15 instead of calling it the G16 or something. I'm sure some people would like it, but I myself don't like the color orange or the lack of G keys, lets hope mines won't break. [img]http://www.logitech.com/repository/535/jpg/4715.1.0.jpg[/img] [url]http://www.logitech.com/index.cfm/keyboards/keyboard/devices/3498&cl=us,en[/url] [b]Edit:[/b] And the new Windows Vista Winkey! And the lack of that switch that disables it! :argh: [b]Edit:[/b] Oh god do you think it's possible to ever have a wiremod output that outputs to the G15 using this? It would be so awesome to have all my information such as airspeed, damage status, etc displayed on it.
[QUOTE=edberg] Oh god do you think it's possible to ever have a wiremod output that outputs to the G15 using this? It would be so awesome to have all my information such as airspeed, damage status, etc displayed on it.[/QUOTE] Entirly possible, Just use the DLL In an entity client side. It's up to developers to what they do, Practicly everything is possible! :) Infact i might code it, We will see!
That's very cool, but I'm left with one question that makes me feel stupid... How do you install it?
[QUOTE=lemming77]That's very cool, but I'm left with one question that makes me feel stupid... How do you install it?[/QUOTE] This is for developers, But the DLL goes in the usual Lua/Includes/Modules folder. The samples can be put in Lua/Autorun/Client (Only put one sample in at a time, They are seperate scripts. Hope it helps ;)
[QUOTE=Tezzanator92]This is for developers, But the DLL goes in the usual Lua/Includes/Modules folder. The samples can be put in Lua/Autorun/Client (Only put one sample in at a time, They are seperate scripts. Hope it helps ;)[/QUOTE] Thanks. :) [b]Edit:[/b] There seems to be a problem... I've tried a couple of your examples, and tried making my own script for it, but all of them crash the game with a "memory could not be read" error. Any idea what could be wrong?
[QUOTE=lemming77]Thanks. :) [b]Edit:[/b] There seems to be a problem... I've tried a couple of your examples, and tried making my own script for it, but all of them crash the game with a "memory could not be read" error. Any idea what could be wrong?[/QUOTE] They are working for me :S. Can you answer me these things so i can narrow it down? :) : Have you got the Logtech LCD manager software installed and running? [img]http://img216.imageshack.us/img216/6379/lcdmankh8.png[/img] Are you using a real or emulated G15? Did you get the version after I reuplaoded when I accidently uploaded my debug one (A few posts back)?
[QUOTE=Tezzanator92]They are working for me :S. Can you answer me these things so i can narrow it down? :) : Have you got the Logtech LCD manager software installed and running? [img]http://img216.imageshack.us/img216/6379/lcdmankh8.png[/img] Are you using a real or emulated G15? Did you get the version after I reuplaoded when I accidently uploaded my debug one (A few posts back)?[/QUOTE] No... I thought you meant that program on the disc that comes with the G15 that always runs in the background. :downs: Best give that a shot now. Yes, I have a real G15. Yes, I've got the non-debug version you uploaded. [b]Edit:[/b] Works beautifully now, thanks. :)
[QUOTE=lemming77]No... I thought you meant that program on the disc that comes with the G15 that always runs in the background. :downs: Best give that a shot now. Yes, I have a real G15. Yes, I've got the non-debug version you uploaded. [b]Edit:[/b] Works beautifully now, thanks. :)[/QUOTE] Good, Had me scared there a sec; Thought i'd buggered it all up :v:
[QUOTE=edberg]Just saying to hold on and take care of your G15's, they discontinued it and replaced it with this "new" G15 instead of calling it the G16 or something. I'm sure some people would like it, but I myself don't like the color orange or the lack of G keys, lets hope mines won't break. [img]http://www.logitech.com/repository/535/jpg/4715.1.0.jpg[/img] [url]http://www.logitech.com/index.cfm/keyboards/keyboard/devices/3498&cl=us,en[/url] [/QUOTE] That is the G15 Keyboard, the one with the 18 G keys is the G15 Gaming keyboard.
[IMG]http://i171.photobucket.com/albums/u301/lemming77/GarrysMod/DSCF0262.jpg[/IMG] Very nice work, I'm gonna have to play around with this more tomorrow. :D [b]Edit:[/b] [QUOTE=BloodShed]That is the G15 Keyboard, the one with the 18 G keys is the G15 Gaming keyboard.[/QUOTE] [url=http://www.logitech.com/index.cfm/gaming/pc_gaming/mice_keyboards/&cl=gb,en]I don't see a G15 Gaming Keyboard[/url]...
[QUOTE=lemming77][IMG]http://i171.photobucket.com/albums/u301/lemming77/GarrysMod/DSCF0262.jpg[/IMG] Very nice work, I'm gonna have to play around with this more tomorrow. :D [b]Edit:[/b] [url=http://www.logitech.com/index.cfm/gaming/pc_gaming/mice_keyboards/&cl=gb,en]I don't see a G15 Gaming Keyboard[/url]...[/QUOTE] Nice, Mind if i scale it down and put it on the OP?
Oh, awesomeness. Gold star for you my friend, as regards from my G15!
[QUOTE=Tezzanator92]Nice, Mind if i scale it down and put it on the OP?[/QUOTE] That's fine by me. :) Should have something [b]much[/b] better soon though... :D
Well, now the DLL to interface the G15 with GMod is out, I'm sure that someone who's eager to release something will make an all-singing, all-dancing G15 Applet for Gmod. It'd be cool for Zombie Survival!
Damn you pixel limit. :( [IMG]http://i171.photobucket.com/albums/u301/lemming77/GarrysMod/DSCF0263.jpg[/IMG] Well, I'm sure swapping some of the pixels in the G logo for squares will help. :)
I am running some tests to see what null array elements do to memory, If it does nothing i'll make all the limits really high ;) [b]Edit:[/b] Ok, well, A huge array of 4096 only used 4K of memory while null... Doesn't seem too bad? Because of this finding, Inside the zip there is another DLL with obscenely high limits (16384 of everything). It uses 65K More memory while null. Only use it if you need to as I don't know what other side effects it will have. Just redownload the zip to get it. A Little note: The pixels wern't really designed for extensive graphics, But it's a decent work around till I get BMP loading working. Probably never. [b]Edit:[/b] Ok, Here's a small program for generating Lua code from bitmaps! [url]http://www.tezzanator.net/download/click.php?id=7[/url] It's best you feed it black and white bitmaps ;) Source code is included [img]http://img177.imageshack.us/img177/3331/bmptoluawh2.jpg[/img]
[QUOTE=Tezzanator92]I am running some tests to see what null array elements do to memory, If it does nothing i'll make all the limits really high ;) [b]Edit:[/b] Ok, well, A huge array of 4096 only used 4K of memory while null... Doesn't seem too bad? Because of this finding, Inside the zip there is another DLL with obscenely high limits (16384 of everything). It uses 65K More memory while null. Only use it if you need to as I don't know what other side effects it will have. Just redownload the zip to get it. A Little note: The pixels wern't really designed for extensive graphics, But it's a decent work around till I get BMP loading working. Probably never. [b]Edit:[/b] Ok, Here's a small program for generating Lua code from bitmaps! [url]http://www.tezzanator.net/download/click.php?id=7[/url] It's best you feed it black and white bitmaps ;) Source code is included [img]http://img177.imageshack.us/img177/3331/bmptoluawh2.jpg[/img][/QUOTE] Sorta puts all the work I put into that logo to waste, I guess. :v: Ah well, a tool I'm sure will be extremely useful. Thanks. Oh, and thanks for increasing the limits. :D
I have no idea if that program works, But it looks like it would :downs: Not to mention, It'd be better optimized if you did it yourself (Using the filled boxes etc.) [b]Edit:[/b] [img]http://img201.imageshack.us/img201/3453/oohff5.jpg[/img] It worked :O
Strange, it didn't work for me... It just seemed to update the text box a billion times a second to show the same message every time, so I couldn't select and copy it fast enough. :v: [b]Edit:[/b] Most of the logo was missing when I used squares for it, so I went back to using individual pixels, and I'm still being held back by that limit. Even with the alternative dll. :(
[QUOTE=lemming77]1) Strange, it didn't work for me... It just seemed to update the text box a billion times a second to show the same message every time, so I couldn't select and copy it fast enough. :v: [b]Edit:[/b] 2) Most of the logo was missing when I used squares for it, so I went back to using individual pixels, and I'm still being held back by that limit. Even with the alternative dll. :([/QUOTE] 1) Wait till it finishes ;) 2) Strange... I'll check, one sec... Ok, Try this DLL: [url]http://www.tezzanator.net/gm_g15.dll[/url]
Same problem... Could just be that the old code is still in memory on my computer, so I'll try again after a restart. Though that won't be for a while to come.
That's weird :S [code] HANDLE texts[16384]; HANDLE bars[16384]; HANDLE boxs[16384]; HANDLE pixels[16384]; [/code]
The widget manager is pretty much finished now. I'm working at a way to manage multiple pages so you can still make complete widgets. I'll be away the next 6 days so don't expect a release before saturday. I'd give it to tazz if he was online but he isn't so you have to wait.
How do I install this...I've got a g15 gaming keyboard, but i've never installed any DLLs.
[QUOTE=Blynx6]How do I install this...I've got a g15 gaming keyboard, but i've never installed any DLLs.[/QUOTE] Put the DLL into Lua/includes/modules in your garrysmod folder (This is off memory, May be slightly different) Then put a sample script into lua/autorun/client. Then tweak it to your liking.
Sorry, you need to Log In to post a reply to this thread.