ElectroMod - Artificial Numpad Input Control

http://img132.imageshack.us/img132/7762/electrologojpg.jpg

Do you love the powerful input control (vehicles, buttons, etc.) of addons such as WireMod, but hate the resulting huge load times? Would you prefer a lightweight, virtually lag-less, easier to use script? It is for this purpose I have created ElectroMod: using only four scripts (two autoruns, a tool, and an overwrite of the numpad script) I have been able to create powerful, modular input control, without the extra scripts and tools of other addons.

Where can I get it?
[release]


First Release: 0.95

http://www.garrysmod.org/img/?t=dll&id=79560

[/release]

How does it work?

ElectroMod uses a system of “Electro Sets.” These Sets are basically virtual numpads - all but set Zero, the default numpad, are unusable as numpad keys. However, they can be accessed through “ElectroBinds.” Binds can be created using the one and only tool of ElectroMod, the ElectroBind tool, and sets can be toggled through a slider in the tool’s context menu or console commands. You can always see what set you have active through the indicator on the right-hand side of your HUD. When a numpad-controlled device is spawned (including through duping) it is automatically placed into your currently selected ElectroSet. Through the ElectroSets and Binding, you can create many more devices than with just the numpad, buttons that don’t require a precious numpad key, and vehicle-input controlled contraptions.

Uhh… WTF… I still don’t get it?

Here’s a couple of simple tutorials that should further explain things:

Binding Turrets to a Jeep’s Primary Fire:

http://img134.imageshack.us/img134/4976/electro1h.jpg

http://img375.imageshack.us/img375/2164/electro2.jpg

[/media]

Creating a Soda-Machine Death Trap:
[media]

http://img32.imageshack.us/img32/9817/electro3.jpg

http://img20.imageshack.us/img20/6133/electro4.jpg

So, this works with all numpad-controlled devices?
Yes indeed, ElectroMod does not require any special setup for new numpad-controlled tools - it’s all part of the ElectroSet system. Certain less-than-optimally-coded tools may require an extension (all automatically loaded scripts, see the For Devs section) to re-register their numpad controls. New input devices (anything that can trigger a numpad output) also require a simple extension to the tool, which can be done through the extension system without actually modifying the tool itself.

What can I do to help?
For now, suggest added features, critique the HUD, and most importantly, suggest numpad-controlled tools and input devices (anything that can trigger a numpad output) for me to test and add support for, if necessary.

For Devs: Highly Modular
I recently finished up the “extensions” system, which allows files to be automatically loaded by the addon based on the prefix (“sv_” on server, “cl_” sent to the client, and “sh_” loaded on both.) There is also a “tool_” prefix which works like a shared file, but is used to distinguish between general shared files and those that modify the ElectroBind tool. The ElectroBind tool is built in such a way that it is easy to add functions to the left click, right click, and reload, and a custom Tool Control Panel allows the easy addition of tool options - all without actually modifying the original tool file. The Vehicle control script is actually included with the default download as an extension, as long with a simple HUD display ConVar toggle.

More Little Stuff:
-Full Duplication Support (however, all binds in an entity will be moved to your current set, so make sure your contraption doesn’t have multiple sets in it)
-Works when other players use your input device. (i.e. Player A makes and binds the vehicle, player B will trigger player A’s binds when using the vehicle.)
-To reiterate: numpad-controlled entities spawned while your ElectroSet is set to anything other than 0 (which will show on the HUD as numpad) can be used through binds-only. Entities spawned while your ElectroSet is 0 can be controlled normally through the numpad.

Please remember this is in no way associated with WireMod, nor is it intended to be a replacement - WireMod still has all the mathematical gates, displays, etc. Electromod is designed for clean input control (vehicles, buttons, etc.)

I like it. It’s the kind of mod that I would download to simply compliment my otherwise vanilla gmod.

Hey Buddy! =D Another awesome mod ;D looks cool, I love using Wiremod but I can’t stand the load times, this should be a good replacement for my server.

So this also includes a pod-controller-esque thing?

This would be perfect for those who don’t want Wiremod, or don’t know how to use it.

Are you interested in a “more advanced binding tool”? I have lately coded a “binding tool” which is able to bind nearly every single key on the keyboard.

want! :slight_smile:

Just out of interest, why is it called ElectroMod?

Thank you. Found it super-useful.

Wiremod bashing probably.

Yes it does. It’s built into the binding tool. The tutorial in the first post should explain things a bit.

Lack of creative naming on my part, actually. It was originally going to be CableMod, which would be a rip off WireMod, then ElectroCables, but it didn’t really make sense since no linear cables or wires were being created. And ElectroBinds sounds cool… right?

Sounds useful… PM with more info?

:golfclap: Very nice.

Edit: A rather fitting sentence fragment: The irony of someone clicking the dumb rating for a post with no idiotic response.
(Edited after the dumb x 3.)

Is this going to be released?

I’ve been working on it a bit recently actually, fixing up the Hud to be nicer and improving the “Mods” system.

Basically, it’s currently set up so that you can easily expand on the tool without actually modifying it - you can tack on functions to the left and right click and reload functions, and add options to a navigational menu in the Control Panel to keep things neat.

For example, the two basic Mods are Vehicle Control (which used to be hard-coded) and Hud Display. You simply choose an option from the Mods list (which is a Derma ListView) and it refreshes the view with options from that category - i.e., setting a vehicle key, or turning your Hud on or off.

In addition to those two mods, there is also a sample mod text file that will be packed into the release which has comprehensive instructions for making a mod and can be converted into a usable mod by renaming it to a “.lua” file.

I wrote some new globals as well as new subroutines in the surface library for helping me write a more native looking HUD to HL2; here’s the results for my ownership module which will be apart of GMP:

Considering that GMod doesn’t use a sprint limitation, that area of the HUD is unoccupied, I replaced it with an Owner notification.

Just a suggestion for HUD usage, not sure if you personally like the vanilla feel though. I think psychologically it’s better off, as the player doesn’t feel as if they’re drowning in another addon, but it’s a true extension to the game.

Here’s the main code for this specific branch of work -> http://code.google.com/p/gmodplus/source/browse/trunk/lua/autorun/client/gmpcl_owner_functions.lua

Best of programming luck to ya.

I’m glad to hear that its still alive :slight_smile:

Well, might as well not let this rot on my hard drive. Here’s the first official release, version 0.95, enjoy:

[release]
http://www.garrysmod.org/img/?t=dll&id=79560

[/release]

Also, for developers:

I recently finished up the “extensions” system, which allows files to be automatically loaded by the addon based on the prefix (“sv_” on server, “cl_” sent to the client, and “sh_” loaded on both.) There is also a “tool_” prefix which works like a shared file, but is used to distinguish between general shared files and those that modify the ElectroBind tool. The ElectroBind tool is built in such a way that it is easy to add functions to the left click, right click, and reload, and a custom Tool Control Panel allows the easy addition of tool options - all without actually modifying the original tool file. The Vehicle control script is actually included with the default download as an extension, as long with a simple HUD display ConVar toggle. Seems I left the Vehicle Control’s original hard-coding in the download, though, but it’s all commented out, so I’ll clean up the script for the next release.

(Oh by the way, the HUD’s purple and cyan now, thought it fitted the “Electro” theme fairly well.)

OH MAH GOD A RELEASE! Thank you, this is the alternative I’ve wanted to wire mod.
Wire mod is nice n all, but I do simple things that are amusing. Now I can do more!

Awesome!

why do you need to “overwrite the numpad script”?
didn’t you take a look at the gmod button code to see how that presses numpad keys?