• What do you need help with? V3
    6,419 replies, posted
I usually call :SetNoDraw(true) in PrePlayerDraw to do that.
[QUOTE=ralle105;38460500]I usually call :SetNoDraw(true) in PrePlayerDraw to do that.[/QUOTE] Did that and it still shows the player performing no animations, only idle.
[QUOTE=Wolfo;38460476]How do I make the player invisible but still drawing entities bonemerged to it? If I don't draw the player, the entities aren't drawn as well and if I try to bonescale the player the entities bones scale too. Changing color doesn't even work for some reason.[/QUOTE] If you use pl:SetColor you have to use pl:SetRenderMode(RENDERMODE_TRANSALPHA) first
[QUOTE=Wolfo;38460585]Did that and it still shows the player performing no animations, only idle.[/QUOTE] Do you have any code to show us?
[QUOTE=Drakehawke;38460670]If you use pl:SetColor you have to use pl:SetRenderMode(RENDERMODE_TRANSALPHA) first[/QUOTE] Still doesn't change player's color though. I tried doing it at PlayerSpawn and Think clientside. [QUOTE=ralle105;38460723]Do you have any code to show us?[/QUOTE] [lua]hook.Add("PrePlayerDraw", "onlydrawparts", function(ply) ply:SetNoDraw(true) end)[/lua] cl_init of entity bonemerged [lua] include('shared.lua') function ENT:Draw() if ( self.Entity:GetParent() && self.Entity:GetParent():IsValid() ) then if ( self.Entity:GetParent() == LocalPlayer() ) then if ( !LocalPlayer():Alive() ) then return end end end self.Entity:DrawModel() self.Entity:DrawShadow( false ) self:ManipulateBoneScale( self:LookupBone("ValveBiped.Bip01_Head1"), Vector(0,0,0) ) end[/lua] init of entity [lua] AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( 'shared.lua' ) function ENT:Initialize() self.Entity:AddEffects( EF_BONEMERGE ) self.Entity:AddEffects( EF_PARENT_ANIMATES ) self.Entity:AddEffects( EF_BONEMERGE_FASTCULL ) end [/lua]
Hey Guys, I use to use this to make sure my files were downloaded to clients but now it just returns. [ERROR] lua/autorun/ttt_downloads.lua:2: attempt to call field 'FindDir' (a nil value) [lua] function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then // Don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find(dir.."/*", true)) do resource.AddFile(dir.."/"..v) end end AddDir("materials/vgui") AddDir("sound/ttt") [/lua] Any ideas?
How would I go about adding a horizontal scroll to a DTree?
How does the Player.GetEyeTrace() actually work? When i'm using gui.EnableScreenClicker(true) it will get the trace from you to "crosshair pos", instead of the mouse position, but when i'm using sandbox 'C'-menu, it will correctly return the trace from you to "cursor". Also where is the sandbox c-menu located?
[url]http://glua.me/bin/?keywords=GetEyeTrace[/url]
how do I animate surface.drawrect/poly ? i thought that there would be built in functions to fade, move, size these sorts of things! if anyone knows of a snippet that demonstrates something like this i'd appreciate it
[QUOTE=Kwaq;38463416]how do I animate surface.drawrect/poly ? i thought that there would be built in functions to fade, move, size these sorts of things! if anyone knows of a snippet that demonstrates something like this i'd appreciate it[/QUOTE] Just make your own 'framework' to adjust the position and color (including alpha) and tadaah, animations.
If you are using gui.EnableScreenClicker(true) then you need to use this [lua] local tr = util.TraceLine( util.GetPlayerTrace( LocalPlayer(),gui.ScreenToVector(gui.MouseX(),gui.MouseY())) ) [/lua] rather than LocalPlayer():GetEyeTrace(), because the gun is not moving. Damn that took a long time to figure out.
Can't you just use Player:GetEyeTraceNoCursor
[QUOTE=Banana Lord.;38464342]Can't you just use Player:GetEyeTraceNoCursor[/QUOTE] That would make it return the position from the middle of your screen, not from the cursor. When you enable screenclicker and move your mouse the gun doesn't move like in garry's c-menu, so LocalPlayer():GetEyeTrace() will just return the trace from the middle of your screen. So i had to come up with my redneck code.
oh sorry I was confused in what you were asking
How would I go about having DCollapsibleCategory auto-move down when a category above it is open. Sick of this overlapping.
Does anyone know how to use the OpeningURL functions? When i run this it renders the frame but i am getting nothing in the console. [lua] local HtmlFrame = vgui.Create("HTML") HtmlFrame:SetSize(500,500) HtmlFrame:SetPos( 10,10) HtmlFrame:OpenURL("http://facepunch.com/") HtmlFrame.FinishedURL = function (url) print("Loaded: "..url) end HtmlFrame.OpeningURL = function (url) print("Opening: "..url) end [/lua]
wouldnt it have 2 args for the callbacks? like the panel and whatever args are passed to it. i probably wont fix it, just saying.
[QUOTE=101kl;38471971]Does anyone know how to use the OpeningURL functions? When i run this it renders the frame but i am getting nothing in the console. [lua] local HtmlFrame = vgui.Create("HTML") HtmlFrame:SetSize(500,500) HtmlFrame:SetPos( 10,10) HtmlFrame:OpenURL("http://facepunch.com/") HtmlFrame.FinishedURL = function (url) print("Loaded: "..url) end HtmlFrame.OpeningURL = function (url) print("Opening: "..url) end [/lua][/QUOTE] That's only called once run it in a Tick hook... only [lua] HtmlFrame.FinishedURL = function (url) print("Loaded: "..url) end HtmlFrame.OpeningURL = function (url) print("Opening: "..url) end [/lua] With a pause script
I want to add a variable to an entity, and I want that variable to be accessible for clients. What's the best way to do this?
How to use "AddCSLuaFile" and "include" on shared.lua, init.lua and cl_init.lua?
[B]init.lua:[/B] AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") [B] cl_init.lua:[/B] include("shared.lua") [B]shared.lua:[/B] Nothing of interest
[QUOTE=Darkwater124;38474201][B]init.lua:[/B] AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") [B] cl_init.lua:[/B] include("shared.lua") [B]shared.lua:[/B] Nothing of interest[/QUOTE] I did this but it doesn't download the files from the server, if I try to join with a client. Yes sv_allowdownload is true.
I've been trying to reduce lag/crashing during collisions involving some custom built physics objects. One oddity I noticed is that the mesh created by the ENT:PhysicsFromMesh() function seems to double all the vertices. [code] print( "MeshBefore: "..table.Count(SomeCustomMesh) ) self:PhysicsFromMesh(SomeCustomMesh) print( "MeshAfter: "..table.Count(self:GetPhysicsObject():GetMesh()) ) [/code] Output for 36 vertex cube mesh: MeshBefore: 36 MeshAfter: 72 Am I missing something here, or do I just have to live with pointless double physics calculations for every custom object I make?
[QUOTE=Maxthekiller;38474305]I did this but it doesn't download the files from the server, if I try to join with a client. Yes sv_allowdownload is true.[/QUOTE] Then it's not a Lua-related problem I think.
[QUOTE=Darkwater124;38474787]Then it's not a Lua-related problem I think.[/QUOTE] What could it be else? I'm running a dedicated server with the hlds tool on my computer.
What convars have you changed? What is your folder structure? [editline]16th November 2012[/editline] Also, a quick answer on: [quote]I want to add a variable to an entity, and I want that variable to be accessible for clients. What's the best way to do this?[/quote] would be nice c:
[QUOTE=Darkwater124;38474938]Also, a quick answer on: would be nice c:[/QUOTE] The simplest way is to make it a networked variable with entity:SetNetworkedBlah(name,value) and entity:GetNetworkedBlah(name) where Blah is the type of the variable. It might or might not be the best way to do it depending on how you're using that variable. If it's never going to change just define it in shared.lua
[QUOTE=Darkwater124;38474938]What convars have you changed? What is your folder structure? [editline]16th November 2012[/editline] Also, a quick answer on: would be nice c:[/QUOTE] I didn't change any convars. Here's a link to the addon: [URL]https://dl.dropbox.com/u/17294708/vip_script.zip[/URL]
I have already tried asking for help in the Developments forum but so far I haven't got any responses. I have been experimenting with the new physenv.AddSurfaceData command to replace old surfaceproperties I used for vehicles in Gmod 12. So far I've managed to get the tire grip back up to the old values, however there is a problem I've discovered. In Source as far as I can tell there are 3 different friction values for vehicle wheels: the standard material, the braking material and the skid material. Depending on whether you are accelerating (pressing W), using the brakes (Pressing S) or the hand brake (Pressing SPACE) it switches between these different materials. For some reason I can apply custom friction values to the standard material and braking material using physenv.AddSurfaceData but then it will [b]always[/b] cause a crash to desktop if I use the handbrake, even if the skid material is set to use one of the default surfaceproperties such as 'slidingrubbertire' which is used by the Half-Life 2 Jeep. Do you have any idea why this may be happening or a way of fixing it? There's also a crash dump if it helps: [url]https://dl.dropbox.com/u/1162417/hl2...19_5_29C0.mdmp[/url]
Sorry, you need to Log In to post a reply to this thread.