• Problems That Don't Need Their Own Thread v5
    4,111 replies, posted
[QUOTE=cody1111;52231907]-snip-[/QUOTE] For the love of god do not use user messages; use net messages... It's 2017 I can't fathom why anyone would suggest to use umsg.
[QUOTE=RaptorJGW;52231724]You actually helped me to fix a different problem with this. The derma menus disappear now when you hit escape to go to the menu, which is good. But the chat is still behind the menu[/QUOTE] Are you still using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/MoveToBack]Panel:MoveToBack[/url]?
[QUOTE=NeatNit;52234287]Are you still using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/MoveToBack]Panel:MoveToBack[/url]?[/QUOTE] Yes, but I just found out that it didn't move the panel to back, because I also were using Panel:PopUp() Without it, it does move behind the chat, but I have no mouse on the screen now. Although I used Panel:SetKeyboardInputEnabled() and Panel:SetMouseInputEnabled()
[QUOTE=RaptorJGW;52234418]Yes, but I just found out that it didn't move the panel to back, because I also were using Panel:PopUp() Without it, it does move behind the chat, but I have no mouse on the screen now. Although I used Panel:SetKeyboardInputEnabled() and Panel:SetMouseInputEnabled()[/QUOTE] This is the point where my guesswork can no longer help you, hope somebody else comes along :P
I will try things out, still thanks man
So this is driving me up the wall, for some odd reason my material isn't working. No missing texture, no nothing, its just not there, even though it should be. [code] "UnlitGeneric" { "$basetexture" "yashirmare/yashi_pipboy2" "$translucent" 1 } [/code] and the texture: [t]http://i.imgur.com/0MMIjYa.png[/t] and the code (I tried the above method that is commented out too) [t]https://i.gyazo.com/f6e0f11c452730f7b46c57bcb14cedb9.png[/t]
You may want to try using a PNG instead of a VTF... sometimes they work better for material stuff
[QUOTE=MPan1;52235220]You may want to try using a PNG instead of a VTF... sometimes they work better for material stuff[/QUOTE] I tried that too, same result.
Hi, someone can help me with matrices? I have image of map and I'd like to transform his by player position on minimap and rotate, when player rotates his camera. I made code, but he doesn't work correclty. [CODE] zoom = 1 mapMatrix = Matrix() mapMatrix:Translate(Vector( (pos.x + 16384) / 16, (pos.y + 16384) / 16, 0 ) ) mapMatrix:Scale(Vector( zoom, zoom, 0)) mapMatrix:Rotate( -Angle(0, ang.y, 0) ) print("=====================================================================================================") print(mapMatrix) cam.PushModelMatrix(mapMatrix) surface.DrawTexturedRect( 0, 0, 2048, 2048 ) cam.PopModelMatrix()[/CODE] I'm on the x = 0, y = 0 coordinates [IMG]http://imgur.com/mvSaHOF.png[/IMG][img]http://i.imgur.com/Mmd8mb0.png[/img]
[QUOTE=TehBigA;52233983]For the love of god do not use user messages; use net messages... It's 2017 I can't fathom why anyone would suggest to use umsg.[/QUOTE] What's the difference?
[QUOTE=cody1111;52236391]What's the difference?[/QUOTE] Aside from the fact that it is unbelievably annoying to work with, it is more limited in terms of functionality and message length
[QUOTE=JasonMan34;52236423]Aside from the fact that it is unbelievably annoying to work with, it is more limited in terms of functionality and message length[/QUOTE] In the case of exchanging simple messages like integers and short strings, is it any slower that the net library? Also, I was wondering about NWInts and NWStrings, is there a better way to share that info or?
[QUOTE=cody1111;52236502]In the case of exchanging simple messages like integers and short strings, is it any slower that the net library? Also, I was wondering about NWInts and NWStrings, is there a better way to share that info or?[/QUOTE] Afaik using user messages is completely fine, the only difference I know of is that instead of networking right away they wait in a queue to be sent off the next tick. The reason for using net messages is they're more capable in sending large information, as well as the different types of information to send. There's no reason not to use net messages. NWVars (and NW2Vars) are completely fine for information you want tied to an entity, it's generally much easier to use.
[QUOTE=bigdogmat;52236638]Afaik using user messages is completely fine, the only difference I know of is that instead of networking right away they wait in a queue to be sent off the next tick. The reason for using net messages is they're more capable in sending large information, as well as the different types of information to send. There's no reason not to use net messages. NWVars (and NW2Vars) are completely fine for information you want tied to an entity, it's generally much easier to use.[/QUOTE] Net messages can be more efficient for entities if you don't need the data to constantly be verified, but that's at the exchange of having to handle prediction manually.
[QUOTE=bigdogmat;52236638]the only difference I know of is that instead of networking right away they wait in a queue to be sent off the next tick.[/QUOTE] That explains a lot. I could never figure out how to send a net message together with an entity that I've just created. Edit: actually, what IS the best way to do this? [lua]local newent = ents.Create("prop_physics") somehow_make_it_so_clients_know_to_run_some_custom_code_on_this_ent_before_its_even_drawn_once(newent)[/lua]
[QUOTE=Rocket;52237298]Usermessages are deprecated, that's the #1 reason not to use them. They might be removed at any point in the future.[/QUOTE] They won't. It's already been said somewhere that they'll just start using netmessages internally. Deprecated things don't get removed in Garry's Mod -- it's too dated at this point and too much code uses deprecated functions.
Does anybody know of a way to make the players active weapon disappear? I'd rather not strip the weapon as that causes a problem when you give it back to them sometimes. I tried changing the color to make it transparent, but that didn't seem to work. Anyone got any ideas? [code] if caller:GetActiveWeapon() ~= NULL then caller:GetActiveWeapon():SetColor( 0, 0, 0, 0 ) -- makes it invisible end [/code]
Add the EF_NODRAW flag to the viewmodel to make it invisible to the local player, or to the ActiveWeapon to make it invisible to others. Also, use :IsValid() instead of NULL a comparison.
[QUOTE=code_gs;52237998]Add the EF_NODRAW flag to the viewmodel to make it invisible to the local player, or to the ActiveWeapon to make it invisible to others. Also, use :IsValid() instead of NULL a comparison.[/QUOTE] Thanks, I'll give it a shot. :)
I'm loading a HD png through DImage and it's all pixelated when rendered, is there a solution to this?
[QUOTE=cody1111;52236502]In the case of exchanging simple messages like integers and short strings, is it any slower that the net library? Also, I was wondering about NWInts and NWStrings, is there a better way to share that info or?[/QUOTE] Iirc user messages are queued and sent over time and can be delayed, especially when a HUGE amount are sent to a connecting client. Net messages are somewhat instant and can transmit significantly more data. I remember on the |G4P| servers, before we switched everything to net messages and rewrote portions of the admin mod we used at the time to use the net library, some users had to wait for their clients to warm up essentially before the game would function properly. The net library was a much better experience. [editline]16th May 2017[/editline] [QUOTE=Kilgrave;52238540]I'm loading a HD png through DImage and it's all pixelated when rendered, is there a solution to this?[/QUOTE] Is your image size a power of two?
How do I remove the little bar when moving a panel on a DIconLayout? [vid]https://i.gyazo.com/2828650e7291d47d1554e3cd91ca9c3b.mp4[/vid]
[QUOTE=DahDestroyer;52238547]How do I remove the little bar when moving a panel on a DIconLayout?[/QUOTE] Short answer is that it's not an option. At least not by default. You could remove the hook, but then [I]none[/I] of the drop lines would work for your whole session. [code]hook.Remove('DrawOverlay', 'DragNDropPaint')[/code] For some reason it was baked right into the dragdrop.lua library ([I]lua/includes/extensions/client/panel/dragdrop.lua[/I]) as a lambda added straight to the DrawOverlay hook with no option. I'm sure if somebody made a Pull Request for a toggle that could be set on drop receivers it'd be accepted for the next update.
[QUOTE=Yashirmare;52235240]I tried that too, same result.[/QUOTE] Did you add .PNG to the end of the SetImage path? [editline]17th May 2017[/editline] [QUOTE=Kilgrave;52238540]I'm loading a HD png through DImage and it's all pixelated when rendered, is there a solution to this?[/QUOTE] Have you tried using noclamp and smooth? [CODE] local image = Material( "path/to/image.png", "noclamp smooth" ) [/CODE]
I'm working on a build system where the "ghost" prop that the player sees before its spawned on the server is simply a ents.CreateClientProp() and I have it to where Q and E to rotate left and right. The code for going left simply looks like this [code] if( input.IsKeyDown(KEY_Q) ) then self.ang = self.ang + Angle(0,1,0) end [/code] Only problem is that it seems with lower FPS the rotation is slow, anyone know how to make it the same speed on all systems no matter their FPS?
[QUOTE=47goon;52240321]I'm working on a build system where the "ghost" prop that the player sees before its spawned on the server is simply a ents.CreateClientProp() and I have it to where Q and E to rotate left and right. The code for going left simply looks like this [code] if( input.IsKeyDown(KEY_Q) ) then self.ang = self.ang + Angle(0,1,0) end [/code] Only problem is that it seems with lower FPS the rotation is slow, anyone know how to make it the same speed on all systems no matter their FPS?[/QUOTE] [lua] local speed = 300 -- Whatever feels right if( input.IsKeyDown(KEY_Q) ) then self.ang = self.ang + Angle(0,speed*FrameTime(),0) end [/lua] Basically [B]1/FrameTime()[/B] returns your FPS, so divide whatever speed is by your fps (If your FPS is 300, it will be for everyone like it was for you on 300fps) [quote]speed/(1/FrameTime()) = speed*FrameTime()[/quote] So if your fps is 300 it runs 300/300 times per frame = 1 time per frame X 300 fps = 300 times per second. If your fps is 100 it runs 300/100 times per frame = 3 times per frame X 100 fps = 300 times per second
[QUOTE=JasonMan34;52240363] Basically [B]1/FrameTime()[/B] returns your FPS, so divide whatever speed is by your fps (If your FPS is 300, it will be for everyone like it was for you on 300fps) [/QUOTE] Thanks man works perfect, took me a minute to figure out WHY it works but you explanation helped a bunch!
I can't figure out how to give an entity a proper name in the kill feed. That is to say if a turret kills someone in the feed, it will be Turret [icon] Player instead of #sentry_gun [icon] player.
How would I go about networking a variable bound to an entity? For example, using NWVars to set the rank of a player : [code]ply:SetNWInt("rank", 2)[/code] This would set the rank of the player and could be used both on the client and on the server. Is there a way without using NWVars for this kind of use? If the rank is set on the server as [code]ply.Rank = 2[/code] how can I send it to ALL the clients? Would this work? [code]//Server net.Start("Rank") net.WriteEntity(ply) net.WriteInt(ply.Rank, 32) net.Broadcast() //Client net.Receive("Rank", function() net.ReadEntity().Rank = net.ReadInt(32) end)[/code]
[QUOTE=toastvendor;52241503]I can't figure out how to give an entity a proper name in the kill feed. That is to say if a turret kills someone in the feed, it will be Turret [icon] Player instead of #sentry_gun [icon] player.[/QUOTE] language.Add("sentry_gun", "AAAAAAAAHHHHHHHHHHHH!!!!!!") IIRC [editline]17th May 2017[/editline] this system is I'm place for easy support of translation, but it's broken for addons because addon language files aren't loaded. You have to use language.Add, but you can only add one language this way. It's dumb.
Sorry, you need to Log In to post a reply to this thread.