I decided to make my own wiremod,
Its designed for newbies at WireMod and will have comments everywhere and will feature some tutorials that link to youtube videos that hopefully will never get removed.
I finished the base of the wires so far, and by that I mean a button, a thruster, and a beam that emulates as a rope.
Currently designing the VGUI, here is what I'm currently working on:
[img]http://img34.imageshack.us/img34/4950/onpressed.png[/img]
[i]MY GAWWD, THIS MAN IS USING WINDOWS 98!!![/i]
You can't see it, but there's a mouse.
That menu has a fixed size and a scrollbar. When pressing the buttons you will send the concommand, "setswireoutput OUTPUTNAME"
Each output/input will have a definition that you can set.
SendHat is a filler output, it does nothing.
Just posting here to say what I'm doing.
Sounds pretty cool :)
At this point, I wish WireMod would become it's own game and separate completely from the GMod community.
I don't understand the hate towards wire. It makes the impossible, possible. There's so many things you can't do without wire.
[QUOTE=Skapocalypse;17926811]I don't understand the hate towards wire. It makes the impossible, possible. There's so many things you can't do without wire.[/QUOTE]
There's a few different sides to wire.
Wire mod does let you make some pretty cool stuff. It's nice to have automatic sliding doors that can easily be modified without re-doing the entire frame work. Example the standard Hydraulic stool to the wire version.
However it's when people to begin to depend on wire mod for the entire contraption. When I join a server, i'll look around to see what others are building, and half the time there's a small group just staring at a wire chip, and totally ignore you because they're too busy getting this particular prop to 0.001 accuracy as it rotates. Things get [i]too[/i] perfect.
Not to mention the amount of people that think they're smarter than you both in GMod and mathematically because they can use wiremod.
A better discussion of the whole thing can be found [b][url=http://www.facepunch.com/showthread.php?t=465720]here[/url][/b], and don't look at the ratings, there are some pretty good points made.
[QUOTE=Jamie Sharpe;10132509]...[b]IN FACT, I WANT A NEW MOD TO TAKE OVER! WIRE IS GETTING OLD FOR ME. MAKE SOMETHING BIGGER[/b](but less laggy)[b], BETTER, THAT EVERYONE CAN USE EASILY![/b]...
[/QUOTE]
I was planning on creating an [i]ENTIRELY NEW GAME[/i] because GMod is tainted with idiot circuitfaggots, I mean wiremodders.
The project was codenamed Lua: Source.
Garry's Mod Plus started out as a way for me to attempt to restore justice to GMod, however lately, I feel like disassembling the addon and leaving the community. I currently have too many issues to balance on top of programming.
[highlight](User was banned for this post ("Trolling / homophobia" - mahalis))[/highlight]
Don't ditch Gmod+ D=
[QUOTE=CptFuzzies;17927138].[/QUOTE]
Reason for that sentence is during the time of post, wire mod casted a sheet over all of GMod for contraption building. There was so little decent contraptions that weren't made by wiremod and everyone was circle jerking over their expression gates.
[QUOTE=JSharpe;17927503]everyone was circle jerking over their expression gates.[/QUOTE]
Was? Am I the only one that still does? D:
Yeah, there needs to be some totally awesome mod that emasculates, ostracizes, and completely owns wire mod....
Also, can these contraptions (automatic doors, etc.) be done outside of wire? I don't support it or anything, I can't even figure out how it works.
Guys, [url]http://www.facepunch.com/showthread.php?t=465720[/url]
Follow your little sheepy herd of wiremod ruining G-mod over to that thread as the kind yellow pedestrian has told so.
EDIT: OooOOooh LUA:Source eh?
I luabinded the source engine too. Even created my own custom functions for Vectors in C++ and binded it to lua. Very easy to do, takes less than a second. All you do is run luabind at gamerules.cpp
[QUOTE=CptFuzzies;17927138]However lately, I feel like disassembling the addon and leaving the community.[/QUOTE]
Release the sweps standalone first >:(
Reminds of the Gamemaker Events (On Key Pressed, On Key Released etc). Looking very nice.
Make the scroll wheel scroll the outputs.
This new wiremod thingy looks a lot neater and tidier than the other one.
I like it. I hope it doesn't get bloated.
I hope everything is explained a bit, just like in the screenshot. It'll help people get more interested in wire at the start, and then it'll keep them interested in it to create more complicated things.
[QUOTE=Skapocalypse;17926811]I don't understand the hate towards wire. It makes the impossible, possible. There's so many things you can't do without wire.[/QUOTE]
Nothing done in wire can't be done in Vanilla GMod. It's just a lot harder, and you feel better about making simpler contraptions.
[QUOTE=| FlapJack |;17934557]Nothing done in wire can't be done in Vanilla GMod. It's just a lot harder, and you feel better about making simpler contraptions.[/QUOTE]
Teleporting auto-aiming explosion bots can be made in Vanilla GMod?
I'm all up for a new wiremod. I'm sick and tired of having the wire keyboard run a console command every other frame even when it isn't on the map at all >_>
[QUOTE=Lexic;17934740]Teleporting auto-aiming explosion bots can be made in Vanilla GMod?[/QUOTE]
Fair point.
[QUOTE=Sippeangelo;17930914]Make the scroll wheel scroll the outputs.[/QUOTE]
It does that already. The buttons are just fancy-painted VGUI inside a DPanelList.
[QUOTE=That Ninja;17933904]I hope everything is explained a bit, just like in the screenshot.[/QUOTE]
I will hopefully comment every basic thing for a beginner to start wiremodding.
[QUOTE=Gbps;17934788]I'm all up for a new wiremod. I'm sick and tired of having the wire keyboard run a console command every other frame even when it isn't on the map at all >_>[/QUOTE]
A new wired keyboard could easily be done by hooking onto the gamemode's KeyPressed instead of concommands.
Edit: Nevermind, KeyPressed is for IN_'s only. I guess you could datastream :P
Ooh, that gave me an idea. I'll convert all my usermessages into datastreams. I feel that is easier to handle then making a bunch of overcomplicated tables and then converting them into strings and then sending them over to the client and finally to have them slowly parse it.
[QUOTE=pedroion;17929578]Back to the topic:
Are you re-doing the entire Wiremod from scratch?
If you are (IF), why don't you just add comments, while keeping the original Wiremod engine?[/QUOTE]
Here's the indicator made with SuperWiremod:
[lua]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
function ENT:WireInit()
self.Entity:CreateInput("Switch")
self.Entity:HookFunction("Switch",ChangeColor)
end
function ChangeColor(ent,arg)
if arg then
ent:SetColor(0,255,0,255)
else
ent:SetColor(255,255,255,255)
end
end
[/lua]
Here is normal Wire:
[lua]
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
ENT.WireDebugName = "Indicator"
function ENT:Initialize()
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )
self.a = 0
self.ar = 0
self.ag = 0
self.ab = 0
self.aa = 0
self.b = 0
self.br = 0
self.bg = 0
self.bb = 0
self.ba = 0
self.Inputs = Wire_CreateInputs(self.Entity, { "A" })
end
function ENT:Setup(a, ar, ag, ab, aa, b, br, bg, bb, ba)
self.a = a or 0
self.ar = ar or 255
self.ag = ag or 0
self.ab = ab or 0
self.aa = aa or 255
self.b = b or 1
self.br = br or 0
self.bg = bg or 255
self.bb = bb or 0
self.ba = ba or 255
local factor = math.max(0, math.min(self.Inputs.A.Value-self.a/(self.b-self.a), 1))
self:TriggerInput("A", 0)
end
function ENT:TriggerInput(iname, value)
if (iname == "A") then
local factor = math.Clamp((value-self.a)/(self.b-self.a), 0, 1)
self:ShowOutput(factor)
local r = math.Clamp((self.br-self.ar)*factor+self.ar, 0, 255)
local g = math.Clamp((self.bg-self.ag)*factor+self.ag, 0, 255)
local b = math.Clamp((self.bb-self.ab)*factor+self.ab, 0, 255)
local a = math.Clamp((self.ba-self.aa)*factor+self.aa, 0, 255)
self.Entity:SetColor(r, g, b, a)
end
end
function ENT:ShowOutput(value)
if (value ~= self.PrevOutput) then
self:SetOverlayText( "Color = " .. string.format("%.1f", (value * 100)) .. "%" )
self.PrevOutput = value
end
end
function MakeWireIndicator( pl, Model, Ang, Pos, a, ar, ag, ab, aa, b, br, bg, bb, ba, material, nocollide, Vel, aVel, frozen )
if ( !pl:CheckLimit( "wire_indicators" ) ) then return false end
local wire_indicator = ents.Create( "gmod_wire_indicator" )
if (!wire_indicator:IsValid()) then return false end
wire_indicator:SetModel( Model )
wire_indicator:SetMaterial( material )
wire_indicator:SetAngles( Ang )
wire_indicator:SetPos( Pos )
wire_indicator:Spawn()
wire_indicator:Setup(a, ar, ag, ab, aa, b, br, bg, bb, ba)
wire_indicator:SetPlayer(pl)
if wire_indicator:GetPhysicsObject():IsValid() then
wire_indicator:GetPhysicsObject():EnableMotion(!frozen)
end
if nocollide == true then
wire_indicator:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
local ttable = {
material = material,
pl = pl,
nocollide = nocollide
}
table.Merge(wire_indicator:GetTable(), ttable )
pl:AddCount( "wire_indicators", wire_indicator )
return wire_indicator
end
duplicator.RegisterEntityClass("gmod_wire_indicator", MakeWireIndicator, "Model", "Ang", "Pos", "a", "ar", "ag", "ab", "aa", "b", "br", "bg", "bb", "ba", "material", "nocollide", "Vel", "aVel", "frozen")
function MakeWire7Seg( pl, Model, Ang, Pos, Norm, a, ar, ag, ab, aa, b, br, bg, bb, ba, nocollide, Vel, aVel, frozen )
if ( !pl:CheckLimit( "wire_indicators" ) ) then return false end
local wire_indicators = {}
//make the center one first so we can get use its OBBMins/OBBMaxs
wire_indicators[1] = ents.Create( "gmod_wire_indicator" )
if (!wire_indicators[1]:IsValid()) then return false end
wire_indicators[1]:SetModel( Model )
wire_indicators[1]:SetAngles( Ang + Angle(90, 0, 0) )
wire_indicators[1]:SetPos( Pos )
wire_indicators[1]:Spawn()
wire_indicators[1]:Setup(a, ar, ag, ab, aa, b, br, bg, bb, ba)
wire_indicators[1]:SetPlayer(pl)
wire_indicators[1]:SetNetworkedString("WireName", "G")
pl:AddCount( "wire_indicators", wire_indicators[1] )
local min = wire_indicators[1]:OBBMins(wire_indicators[1])
Pos = Pos - Norm * min.x //correct Pos for thichness of segment
wire_indicators[1]:SetPos( Pos + Ang:Up() )
if wire_indicators[1]:GetPhysicsObject():IsValid() then
wire_indicators[1]:GetPhysicsObject():EnableMotion(!frozen)
end
if nocollide == true then
wire_indicators[1]:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
local ttable = {
pl = pl,
nocollide = nocollide
}
table.Merge(wire_indicators[1]:GetTable(), ttable )
local max = wire_indicators[1]:OBBMaxs(wire_indicators[1])
local angles = {Angle( 90, 0, 90 ), Angle( 90, 0, 90 ), Angle( 90, 0, 90 ), Angle( 90, 0, 90 ), Angle( 90, 0, 0 ), Angle( 90, 0, 0 )}
local vectors = {Vector( 1, (-1 * max.y), max.y ), Vector( 1, (-1 * max.y), (-1 * max.y) ), Vector( 1, max.y, max.y ), Vector( 1, max.y, (-1 * max.y) ), Vector( 1, 0, (2 * max.y) ), Vector( 1, 0, (-2 * max.y) ) }
local segname = {"B", "C", "F", "E", "A", "D"}
for x=2, 7 do
wire_indicators[x] = ents.Create( "gmod_wire_indicator" )
if (!wire_indicators[x]:IsValid()) then return false end
wire_indicators[x]:SetModel( Model )
wire_indicators[x]:SetPos( Pos + Ang:Up() * vectors[x-1].X + Ang:Forward() * -1 * vectors[x-1].Z + Ang:Right() * vectors[x-1].Y )
wire_indicators[x]:SetAngles( Ang + angles[x-1] )
wire_indicators[x]:Spawn()
wire_indicators[x]:Setup(cmin, ar, ag, ab, aa, cmax, br, bg, bb, ba)
wire_indicators[x]:SetPlayer(pl)
wire_indicators[x]:SetNetworkedString("WireName", segname[x-1])
if wire_indicators[x]:GetPhysicsObject():IsValid() then
wire_indicators[x]:GetPhysicsObject():EnableMotion(!frozen)
end
if nocollide == true then
wire_indicators[x]:SetCollisionGroup(COLLISION_GROUP_WORLD)
end
table.Merge(wire_indicators[x]:GetTable(), ttable )
pl:AddCount( "wire_indicators", wire_indicators[x] )
//weld this segment to eveyone before it
for y=1,x do
const = constraint.Weld( wire_indicators[x], wire_indicators[y], 0, 0, 0, true, true )
end
wire_indicators[x-1]:DeleteOnRemove( wire_indicators[x] ) //when one is removed, all are. a linked chain
end
wire_indicators[7]:DeleteOnRemove( wire_indicators[1] ) //loops chain back to first
return wire_indicators
end
[/lua]
[QUOTE=BoingBoing;17928376]
EDIT: OooOOooh LUA:Source eh?
I luabinded the source engine too. Even created my own custom functions for Vectors in C++ and binded it to lua. Very easy to do, takes less than a second. All you do is run luabind at gamerules.cpp[/QUOTE]
Wait what.
[QUOTE=Bletotum;17935635]Wait what.[/QUOTE]
Oh that is just nothing except me explaining how easy it is to bind lua to source.
The hard part is the order in running Lua files. It's off topic, though.
I would download this for that wiring tool :P
We'll talk privately about it later BoingBoing, it's not my wish to derail your thread.
Anywho, brilliant coding BoingBoing.
One of my major problems with Wiremod is how DISGUSTING their coding is. I'm sorry, but even my OCD gets a boner looking at that pile of crap.
[QUOTE=CptFuzzies;17936312]We'll talk privately about it later BoingBoing, it's not my wish to derail your thread.
Anywho, brilliant coding BoingBoing.
One of my major problems with Wiremod is how DISGUSTING their coding is. I'm sorry, but even my OCD gets a boner looking at that pile of crap.[/QUOTE]
Where is the "?" rating when you need one.
If you don't understand, then ask, or be quiet?
I must say that i am looking forward to this, the current wiremod just has to much shit in it.
I just realized that most people don't want to use a base entity for wires, so I made a little function that hooks onto the entity.
Functions have longer names, but are more efficient and can applied to any entity, even SWEPs! Except it won't do shit with SWEPs.
init.lua:
[lua]AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
function ENT:Initialize()
swire.RegisterEntity(self)
self.SuperWire:CreateInput("Switch")
self.SuperWire:HookFunction("Switch",ChangeColor)
end
function ChangeColor(ent,arg)
if arg then
ent:SetColor(0,255,0,255)
else
ent:SetColor(255,255,255,255)
end
end
[/lua]
shared.lua:
[lua]ENT.Type = "anim"
ENT.Base = "base_gmod"
ENT.PrintName = ""
ENT.Author = ""
ENT.Contact = ""
ENT.Purpose = ""
ENT.Instructions = ""
ENT.Spawnable = false
ENT.AdminSpawnable = false
[/lua]
cl_init.lua:
[lua]include('shared.lua')
function ENT:Draw()
self.Entity:DrawModel()
self.SuperWire:DrawRope()
end
[/lua]
Nice job Boing, and I'm quite interested to see how this plays out, but to defend wiremod a little:
Most of the bloat in wire ents can be explained. For example, every wire ent contains in its init.lua a MakeWireIndicator function, which would logically be inside the creation stool (I assume you're still using an entity-making-stool system?), but is instead in the init.lua for adv duplicator support. May I suggest deciding on a method of saving contraptions now, before you get too far in?
In your indicator example, you're just setting the colour, while the Wiremod equivalent also stores the variables for outputting. While it could just call GetColor when necessary, and your nice system of only outputting when necessary helps too, technically it would be slightly more efficient to recall the variables than GetColor each time.
Theres many upsides to the way Wiremod is coded, except virtually nothing is commented so its hell to realize. But most of the bloat does have its reasons.
Regardless, that is a DAMN short Sent you got there, nice job.
Sorry, you need to Log In to post a reply to this thread.