• What do you need help with? V3
    6,419 replies, posted
Ok, say I have a veiwport, and know the camera pos, direction, and have a 2d vector where I clicked on said viewport (a 3d model in a panel basically). How would I get a 3d position or direction from that?
[QUOTE=jdmmer;37736228]ENT:Draw()[/QUOTE] Shouldn't it be PreDrawHalos hook?
Porting Underdone to Garry's Mod 13.
No one seems to have an answer to this, but I'll try my luck here aswell: [url]http://www.facepunch.com/showthread.php?t=1213048&p=37729192#post37729192[/url]
Like, they are looking away from the direction they're shooting from?
Their playermodel looks like it's aiming somewhere the player isn't actually aiming. In that screenshot, I told them to aim at my head (I was in first person) [editline]21st September 2012[/editline] [url]http://cloud.steampowered.com/ugc/596982221209431657/AA80A5535733F17A540B27C79777FCCE8B0341A7/[/url]
why arent some ACT_VM* animations working? i made a weapon that was supposed to play a different animation upon firing, but it doesnt do anything. i even tried to lua_run the animation as so: [lua]lua_run Entity(1):GetActiveWeapon():SendWeaponAnim(ACT_VM_IRECOIL2)[/lua] but it results in nothing i checked the activity enumeration name and everything
The weapon model might not have the animation for it.
[QUOTE=Chessnut;37744477]The weapon model might not have the animation for it.[/QUOTE] [QUOTE=comet1337;37743500] i checked the activity enumeration name and everything[/QUOTE] i checked all the anims in HLMV and hammer is there any alternative way to animate view models other than SendWeaponAnim() ?
How can I prevent users from running certain console commands? The best I've found is disabling using bound keys, but not stopping console input. For instance, to stop the player from using +duck.
[QUOTE=Bletotum;37745110]How can I prevent users from running certain console commands? The best I've found is disabling using bound keys, but not stopping console input. For instance, to stop the player from using +duck.[/QUOTE] doesnt PlayerBindPress() do exactly this? if i remember correctly you can block both, keybound and console input commands with it.
I'm using "render.DrawQuadEasy" to draw a square texture onto the ground, however it is suffering from Z-Fighting (IE: It partly draws my texture, and partly draws the ground texture), to get around this, I draw the texture 0.05 off the ground, this causes the problem, where you can see under it if you try hard enough, is there a better way to combat Z-Fighting?
[QUOTE=comet1337;37745811]doesnt PlayerBindPress() do exactly this? if i remember correctly you can block both, keybound and console input commands with it.[/QUOTE] Yes, but returning true does not stop many commands from happening. [editline]21st September 2012[/editline] A way to detect when you have the menu or console open clientside would also be great, unrelatedly.
I have a problem which i find to be [B]VERY[/B] frustrating... I am working on a new Half-Life 2 Beta SNPC (The wasteland scanner) and i seem to have a problem with looping sounds... [CODE]function ENT:Initialize() loopingSound = CreateSound( source, "npc/waste_scanner/combat_scan_loop1.wav" ); loopingSound:Play(); if self:Health() <= 0 then loopingSound:Stop(); end end[/CODE] I get this error: [QUOTE]attempt to index global 'ENT' (a nil value)[/QUOTE] I've been trying to fix it via LuaPad but nothing has been successful... Sorry if the answer is so bleeding obvious that a five year old could solve it, but no matter what i try to do, it remains screwed... can somebody help me out here before I go angry German kid?
You can't use lua_openscript for entites, just type lua_reloadents in console instead.
[QUOTE=thejjokerr;37746424]When I create a HTML panel too soon after loading the gamemode, the size of the HTML content will turn to 256x256. Even though the panel is actually the size of the entire screen, the javascript and css in the panel will think it's 256x256. How do I fix this? Refreshing the panel, using OpenURL on it again and all won't work. What would be the first time to safely create the panel so this doesn't happen? [editline]21st September 2012[/editline] Just noticed the loading screen sometime has the some problem. [editline]21st September 2012[/editline] [img_thumb]http://i.imgur.com/zrA2R.png[/img_thumb][/QUOTE] Hey, I don't have a specific answer to your question, but I just want to let you know that HTML panels are all sorts of fucked up at the moment and there's no expecting any fix until GM13 (Awesomium), so really, don't bother with anything HTML related anymore until GM13 is out.
GM13 awesomium is bugged in that it locks up the image playback (it freezes) when certain content loads. There's an updated version of awesomium that should make it work properly; Garry said in the GM13 section that once it has mac support he will update to it. [editline]21st September 2012[/editline] Additionally, I have also gotten that loading screen problem, and inside of GM13. In fact, I assumed that's what his screenshot was from.
Hey, im drawing some 3d2d and i only want it to draw when you look at it. how would i do that? thanks for any help :)
Whenever I done something like that, I made a custom entity, and draw the 2D3D in its ENT:Draw function. If you set the render bounds correctly, then the engine will handle all the rendering for you.
Thank you, i will definetly try that out.
got the rendering when only looking at it working perfectly now, thank you. only problem i have is i cant seem to change the alpha of the entity to make it invisible, simply doing SetColor( Color( 10, 10, 10, 10 ) ) for example changes the color but no the alpha. i tryed setting the rendermode because thats what the color tool was doing. self:SetRenderMode( 1 ) but still no change. thanks for any help :)
htmlpanel:SetAlpha(#)
Re-posting as it's kind of crucial for what i am making currently. [QUOTE=101kl;37722851]I am having trouble with the FinishedURL callback. Code: [lua] local HtmlFrame = vgui.Create("HTML") HtmlFrame:SetSize(ScrW() - 10, ScrH() - 50) HtmlFrame:Center() HtmlFrame:OpenURL("http://google.com/") HtmlFrame:SetParent( Frame ) function HtmlFrame:FinishedURL(url) print("Loaded: "..url) end [/lua] Console output: [code] LoadURL: [http://google.com/] [/code] FinishedURL is being called, however its proceeding function is not. Any ideas?[/QUOTE]
[QUOTE=Bletotum;37753610]htmlpanel:SetAlpha(#)[/QUOTE] He was talking about the entity. I think replacing the ENT:Draw function would override the default draw, so the model will not draw. ( Or maybe it was ENT:RenderOverride() - i dont remember anymore )
I'm only about an hour into learning lua and I can't seem to find an answer to my question anywhere. I'm in singleplayer and looking to simply get the players health and put it into variable A, but it keeps telling me that LocalPlayer is a null value. [code]A = LocalPlayer():Health() print(A)[/code]
[QUOTE=a1steaksa;37757039] I'm in singleplayer and looking to simply get the players health and put it into variable A, but it keeps telling me that LocalPlayer is a null value. [/QUOTE] LocalPlayer() is client-side. Take a look [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexecc2.html"]Here[/URL] for what you need.
Is it possible to mirror a texture that is being drawn to the screen?
[QUOTE=vexx21322;37757963]Is it possible to mirror a texture that is being drawn to the screen?[/QUOTE] Example of what you're trying to do?
[QUOTE=101kl;37758019]Example of what you're trying to do?[/QUOTE] I found that surface.DrawTexturedRectUV is what I want. The function doesn't seem to work exactly how it should. The UV is based on width and height, not coordinates.
How could I make a scripted brush entity that derives from func_brush in GM13? Or is it impossible?
Sorry, you need to Log In to post a reply to this thread.