• I'm dropping my project, anyone interested?
    6 replies, posted
[img]http://cloud-4.steamusercontent.com/ugc/53250305647455980/6553EB6AA27948181B662890A7D95D41DA94731B/[/img] [url]http://steamcommunity.com/sharedfiles/filedetails/?id=381179245[/url] This is what I was working on, but since I'm a lua noob so can't make any progress. So, if you're interested, please take this. [url]http://pastebin.com/8e2LX98v[/url] <---client side [url]http://pastebin.com/QDVMcfnZ[/url] <---server side OR, you can just start a new project with this idea!(hoping this happens :o) Actually, I recommend making a new one because I'm not a decent developer, just a noob, so most of codes are hard-coded and weird. I'm not taking any credit for this lua, so feel free to use it, disassemble it, and evolve it. ------Features since this code: 4 independent cams(perspective, top, front, right) divided into 5 tabs(all, and each) controllable cams using "wasd" and mouse wheel select entities using mouse(bit glitchy, needs some tweaks) -Server Side [CODE]util.AddNetworkString("builderssight") util.AddNetworkString("builderssight_movement") function PropLocation(ply, mdl, ent) net.Start("builderssight") net.WriteEntity(ent) net.Send(ply) end function NpcLocation(ply, ent) net.Start("builderssight") net.WriteEntity(ent) net.Send(ply) end net.Receive("builderssight", function(len, ply) local ent = net.ReadEntity() local vec = net.ReadVector() ent:SetPos(vec-Vector(0,0,ent:OBBMins())) ent:SetAngles(Angle(0,0,0)) ent:GetPhysicsObject():EnableMotion(false) end) net.Receive("builderssight_movement", function(len, ply) local ent = net.ReadEntity() local vec = net.ReadVector() local ang = net.ReadAngle() if(ent:CPPIGetOwner() == ply)then ent:SetPos(vec) ent:SetAngles(ang) ent:GetPhysicsObject():EnableMotion(false) end end) hook.Add("PlayerSpawnedProp", "Builderssight", PropLocation) hook.Add("PlayerSpawnedEffect", "Builderssight", PropLocation) hook.Add("PlayerSpawnedNPC", "Builderssight", NpcLocation) hook.Add("PlayerSpawnedRagdoll", "Builderssight", PropLocation) hook.Add("PlayerSpawnedSENT", "Builderssight", NpcLocation) hook.Add("PlayerSpawnedVehicle", "Builderssight", NpcLocation)[/CODE] -Client Side [CODE]local build = 0 local focus = 0 local fov = 0 local spawnmenuoepn = 1 local startvec = Vector(0,0,0) local pz, rz, fz, uz = 100, 100, 100, 100 local uf, ur, fr, fu, rf, ru = 0, 0, 0, 0, 0, 0 local mx, my = gui.MouseX(), gui.MouseY() local panel, sheet, csmdl, pers, top, front, right, persfull, topfull, frontfull, rightfull local mid = Vector(0,0,0) local selection = {} local base = {} local mousehalo = {} local debugcl = {} local clk = 0 local mattbl = { ["$basetexture"] = "models/debug/debugwhite", ["$color"] = "[0 0 0]", ["$vertexcolor"] = 1, ["$vertexalpha"] = 1, } local screenrep = CreateMaterial("screenhide","UnlitGeneric", mattbl) local mattbl2 = { ["$basetexture"] = "models/debug/debugwhite", ["$color2"] = "[0 1 0]", ["$vertexcolor"] = 1, ["$model"] = 1, } local outpoly = CreateMaterial("bs_outpoly","VertexLitGeneric", mattbl2) local wireframe = Material("models/wireframe") local texture, wftexture ------------------------------------------------------------------------- ---------------PANEL PAINTOVER STUFFS------------------------------------ ------------------------------------------------------------------------- function Pers() local x, y = pers:LocalToScreen(0,0) local w, h = pers:GetSize() --Perspective View cam.Start3D(csmdl:GetPos(), csmdl:GetAngles(), 90, x, y, w, h) render.Clear(0,0,0,255,true,true) for k, v in pairs( ents.FindInSphere(csmdl:GetPos(),3000) ) do local mdl = v:GetModel() or "" if(!string.find(mdl, "/v_") && mdl != "models/dav0r/camera.mdl" && !string.find(mdl, "/c_") && v != LocalPlayer() && v != game.GetWorld() && !table.HasValue(selection, v))then v:DrawModel() end end game.GetWorld():DrawModel() render.MaterialOverride(outpoly) render.ModelMaterialOverride(outpoly) for k,v in pairs(selection)do if(IsValid(v) && v != nil && v != null)then v:DrawModel() end end cam.End3D() if(focus == 0)then surface.DisableClipping(true) surface.SetDrawColor(0,255,0) surface.DrawOutlinedRect(0, 0, w, h) end end function Top() local x, y = top:LocalToScreen(0,0) local w, h = top:GetSize() --Top cam.Start3D(startvec+Angle(0,0,0):Up()*uz+Vector(uf,ur,10), Angle(90,0,0), 90, x, y, w, h) render.Clear(0,0,0,255,true,true) render.MaterialOverride(wireframe) render.ModelMaterialOverride(wireframe) for k, v in pairs( ents.FindInSphere(startvec+Angle(0,0,0):Up()*uz+Vector(uf,ur,10),3000) ) do local mdl = v:GetModel() or "" if(!string.find(mdl, "/v_") && mdl != "models/dav0r/camera.mdl" && !string.find(mdl, "/c_") && v != LocalPlayer() && v != game.GetWorld() && !table.HasValue(selection, v))then v:DrawModel() end end render.MaterialOverride(outpoly) render.ModelMaterialOverride(outpoly) for k,v in pairs(selection)do if(IsValid(v) && v != nil && v != null)then v:DrawModel() end end cam.End3D() if(focus == 1)then surface.DisableClipping(true) surface.SetDrawColor(0,255,0) surface.DrawOutlinedRect(0, 0, w, h) end end function Front() local x, y = front:LocalToScreen(0,0) local w, h = front:GetSize() --Front cam.Start3D(startvec+Angle(0,0,0):Forward()*fz+Vector(0,fr,10+fu), Angle(0,180,0), 90, x, y, w, h) render.Clear(0,0,0,255,true,true) render.MaterialOverride(wireframe) render.ModelMaterialOverride(wireframe) for k, v in pairs( ents.FindInSphere(startvec+Angle(0,0,0):Forward()*fz+Vector(0,fr,10+fu),3000) ) do local mdl = v:GetModel() or "" if(!string.find(mdl, "/v_") && mdl != "models/dav0r/camera.mdl" && !string.find(mdl, "/c_") && v != LocalPlayer() && v != game.GetWorld() && !table.HasValue(selection, v))then v:DrawModel() end end render.MaterialOverride(outpoly) render.ModelMaterialOverride(outpoly) for k,v in pairs(selection)do if(IsValid(v) && v != nil && v != null)then v:DrawModel() end end render.ResetModelLighting(255,255,255) cam.End3D() if(focus == 2)then surface.DisableClipping(true) surface.SetDrawColor(0,255,0) surface.DrawOutlinedRect(0, 0, w, h) end end function Right() local x, y = right:LocalToScreen(0,0) local w, h = right:GetSize() --Right cam.Start3D(startvec+Angle(0,0,0):Right()*rz+Vector(rf,0,10+ru), Angle(0,90,0), 90, x, y, w, h) render.Clear(0,0,0,255,true,true) render.MaterialOverride(wireframe) render.ModelMaterialOverride(wireframe) for k, v in pairs( ents.FindInSphere(startvec+Angle(0,0,0):Right()*rz+Vector(rf,0,10+ru),3000) ) do local mdl = v:GetModel() or "" if(!string.find(mdl, "/v_") && mdl != "models/dav0r/camera.mdl" && !string.find(mdl, "/c_") && v != LocalPlayer() && v != game.GetWorld() && !table.HasValue(selection, v))then v:DrawModel() end end render.MaterialOverride(outpoly) render.ModelMaterialOverride(outpoly) for k,v in pairs(selection)do if(IsValid(v) && v != nil && v != null)then v:DrawModel() end end cam.End3D() if(focus == 3)then surface.DisableClipping(true) surface.SetDrawColor(0,255,0) surface.DrawOutlinedRect(0, 0, w, h) end end function PersFull() local x, y = persfull:LocalToScreen(0,0) local w, h = persfull:GetSize() --Perspective View cam.Start3D(csmdl:GetPos(), csmdl:GetAngles(), 90, x, y, w, h) render.Clear(0,0,0,255,true,true) local camvec = csmdl:GetAngles():Forward() for k, v in pairs( ents.FindInSphere(csmdl:GetPos(),3000) ) do local mdl = v:GetModel() or "" if(!string.find(mdl, "/v_") && mdl != "models/dav0r/camera.mdl" && !string.find(mdl, "/c_") && v != LocalPlayer() && v != game.GetWorld() && !table.HasValue(selection, v))then v:DrawModel() end end game.GetWorld():DrawModel() render.MaterialOverride(outpoly) render.ModelMaterialOverride(outpoly) for k,v in pairs(selection)do if(IsValid(v) && v != nil && v != null)then v:DrawModel() end
Looks Great I like this.
It's a pretty cool idea, but there's no way to enable an orthogonal projection mode with lua, at least not that I know of, and you need orthogonal projection for the right/top/front perspectives to work.
[QUOTE=helpmeimbored;47028106]It's a pretty cool idea, but there's no way to enable an orthogonal projection mode with lua, at least not that I know of, and you need orthogonal projection for the right/top/front perspectives to work.[/QUOTE] [url]http://wiki.garrysmod.com/page/Structures/ViewData[/url] See the ortho* entries.
[QUOTE=helpmeimbored;47028106]It's a pretty cool idea, but there's no way to enable an orthogonal projection mode with lua, at least not that I know of, and you need orthogonal projection for the right/top/front perspectives to work.[/QUOTE] Well, you should try the code first! I already made all views working. What the code needs are control parts, like PAC3 editor.
[QUOTE=jarari;47032067]Well, you should try the code first! I already made all views working. What the code needs are control parts, like PAC3 editor.[/QUOTE] PAC is open source you know, you could just look at the code there and try to apply it.
[QUOTE=LUModder;47032972]PAC is open source you know, you could just look at the code there and try to apply it.[/QUOTE] oooh.... I didn't know that! Thanks for the info :D
Sorry, you need to Log In to post a reply to this thread.