• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=LosttSpacee;47548197]I found out the string wasn't loading because my init file has an error somewhere but I don't understand where. I backed up my gamemode then I I made new files with just the code I need but I still get an error. [B] Server Side[/B] Client [CODE]include( 'shared.lua' ) function makecombine() net.Start("SpawnRequest") net.WriteString("Soldier") net.SendToServer() print(os.time()) end function checkostime() print(os.time()) end concommand.Add("makecombine", makecombine) --make the console command to make this menu popup concommand.Add("checkingostime", checkostime) --make the console command to make this menu popup [/CODE] [B]The error[/B] Sorry about the image didn't want to type that out [IMG]http://i.imgur.com/oMT9kht.png[/IMG][/QUOTE] The net.Receive in your serverside code should look like this: [CODE]net.Receive( "SpawnRequest", function( length, client ) local data = net.ReadString() if data == "Soldier" then SpawnCombineS(client:GetEyeTraceNoCursor() HitPos+Vector(0,0,30)) end end)[/CODE] Remember that the entire function starting with function(length,client) is an [I]argument[/I] of net.Receive(), so the ) closing net.Receive() should be [I]after[/I] the function's end. edit: use james' version, he caught another problem that I didn't
Thank you so much for you guys help. I have no idea what I would have done without it
Looks like my question got buried, so I'll post it again. [QUOTE=swadicalrag;47543721]I'm at a loss here. I've been experimenting with NWVars and I can't get the NWVarProxies to work. After a quick search on the gmod github, I was introduced to the EntityNetworkedVarChanged hook. Through the gmod wiki, I copypasted and tested, on clientside, the example for the EntityNetworkedVarChanged hook: [CODE]hook.Add("EntityNetworkedVarChanged","print out everything",print)[/CODE] However, it doesn't work. Suspecting that it would be only accessible serverside (despite the hook being shared) I tried the same code serverside, but to no avail. Has anyone had this problem before with the EntityNetworkedVarChanged hook not being called at all, or are there any easy, non-hacky replacements I can use?[/QUOTE] This feature should have already been made available in the last update. Yet, it isn't getting called on my client nor server. I've checked/verified that my server is up to date.
[QUOTE=swadicalrag;47548583]Looks like my question got buried, so I'll post it again. This feature should have already been made available in the last update. Yet, it isn't getting called on my client nor server. I've checked/verified that my server is up to date.[/QUOTE] I'm probably wrong but I think that hook was made to work with the new network vars, since they were reverted it may no longer work at the moment. Try it on the dev branch, I believe they're testing the new network vars on there again.
[QUOTE=Jeezy;47548616]I'm probably wrong but I think that hook was made to work with the new network vars, since they were reverted it may no longer work at the moment. Try it on the dev branch, I believe they're testing the new network vars on there again.[/QUOTE] Ah, shame. I'll skip testing it on the dev branch for now. I don't want to use a hook that still isn't in the main branch, especially when I have no clue when the next update is coming. Thanks!
Can anyone give me a hand in meshes, a bit of an explanation? I know that a mesh is a series of connected vertices with a face, and that they're used in polygonal modeling. So far, I've only been able to recreate the example given on the global/mesh page of the gmod wiki, which uses a triangle mesh function or something. Looking at all the other functions seemslike there are other ways to create meshes, ex: mesh.begin, etc. Im not sure how I'd create a mesh from these other methods. Can a face use more than 3 vertices? Also, my triangle mesh wasnt showing a face when I switched the material from wireframe to something else. Well, I saw the face, it just had a missing texture. Im also curious to learn about tangents and bisectors, and how they will change the mesh Sorry for long post, there may be some typos, typed this out on a phone. Any and all help would be appreciated!
How can I make a parented prop collide with other props? It seems when I parent a prop_physics to another prop, it becomes completely no-collided. I've tried messing with collision groups, setting its solid, and haven't had anything work. This is my work so far, without any effort of allowing collision. [lua]local lab = ents.Create('prop_physics') lab:SetModel('models/props_lab/reciever_cart.mdl') lab:SetParent(self) lab:SetAngles(ang + Angle(0,90,0)) lab:SetPos(self:GetPos() + self:GetUp()*15 + self:GetRight()*-45 + self:GetForward()*5)[/lua] I'm really at a loss right now. Any help is greatly appreciated.
I have some entities that I want to spawn ones a weapons pack another a turret pack that's in the entities tab. I will leave the workshop links down below in case that matters, I am using network strings and a derma menu to spawn stuff Any and all help would be appreciated! Weapon Pack [url]http://steamcommunity.com/sharedfiles/filedetails/?id=180507408&searchtext=FAS[/url] Turrets and stuff [url]http://steamcommunity.com/sharedfiles/filedetails/?id=295680095&searchtext=J.I[/url]
[QUOTE=Karp;47549541]How can I make a parented prop collide with other props? It seems when I parent a prop_physics to another prop, it becomes completely no-collided. I've tried messing with collision groups, setting its solid, and haven't had anything work. This is my work so far, without any effort of allowing collision. I'm really at a loss right now. Any help is greatly appreciated.[/QUOTE] The point of a parented entity is specifically to disable physics on it and follow the motion of something else. It should only be used to attach detail props to something if you don't want the engine to have to calculate physics for it (except moving with the parent). AFAIK, there is no way to accomplish what you want using parents. [QUOTE=LosttSpacee;47549558]I have some entities that I want to spawn ones a weapons pack another a turret pack that's in the entities tab. I will leave the workshop links down below in case that matters, I am using network strings and a derma menu to spawn stuff Any and all help would be appreciated! [/QUOTE] If you would like the player to spawn it rather than it being magically created, you can do [code]scripted_ents.Get("super_cool_turret_entity_name"):SpawnFunction(client, client:GetEyeTraceNoCursor())[/code] where client is obviously the player doing the spawning
[QUOTE=Z0mb1n3;47549981]The point of a parented entity is specifically to disable physics on it and follow the motion of something else. It should only be used to attach detail props to something if you don't want the engine to have to calculate physics for it (except moving with the parent). AFAIK, there is no way to accomplish what you want using parents. If you would like the player to spawn it rather than it being magically created, you can do [code]scripted_ents.Get("super_cool_turret_entity_name"):SpawnFunction(client, client:GetEyeTraceNoCursor())[/code] where client is obviously the player doing the spawning[/QUOTE] I get an error with that code, Im trying to spawn an entity out of an addon [CODE][ERROR] gamemodes/warfare/gamemode/cl_init.lua:16: attempt to index global 'client' (a nil value) 1. unknown - gamemodes/warfare/gamemode/cl_init.lua:16 2. unknown - lua/includes/modules/concommand.lua:54[/CODE]
[QUOTE=LosttSpacee;47550030]I get an error with that code, Im trying to spawn an entity out of an addon [CODE][ERROR] gamemodes/warfare/gamemode/cl_init.lua:16: attempt to index global 'client' (a nil value) 1. unknown - gamemodes/warfare/gamemode/cl_init.lua:16 2. unknown - lua/includes/modules/concommand.lua:54[/CODE][/QUOTE] ...because you need to replace "client" with the player who is spawning the object. In this case, you would probably make it LocalPlayer() (I think? Not sure if you can call this from the client) EDIT: no you can't do that from the client so you'll have to send a net message to tell the server you want to create it.
I'm trying to make an entity fly upwards and out when spawned, this is working however upon using SetModelScale to modify the size, velocity no longer affects the entity when spawned? [code] local vel = VectorRand() * 50 vel.z = 500 phys:SetVelocity( vel ) [/code] Is what I've done to make it move.
You should use SetLocalVelocity.
How would I add a custom check to an entity like a money printer in DarkRP. I tried this: [lua] customCheck = function(ply) return ply:CheckGroup("vip") or ply:IsAdmin() end, CustomCheckFailMsg = "This is VIP only!" [/lua] but all it did was spew errors at me whenever I tried to use the entity.
[QUOTE=meowking1;47551369]How would I add a custom check to an entity like a money printer in DarkRP. I tried this: [lua] customCheck = function(ply) return ply:CheckGroup("vip") or ply:IsAdmin() end, CustomCheckFailMsg = "This is VIP only!" [/lua] but all it did was spew errors at me whenever I tried to use the entity.[/QUOTE] I've never seen the Player:CheckGroup() function, try this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url].
[QUOTE=James xX;47551377]I've never seen the Player:CheckGroup() function, try this [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Player/IsUserGroup]Player:IsUserGroup[/url].[/QUOTE] I changed ply:CheckGroup to Player:IsUserGroup and it broke the F4 menu.
[QUOTE=meowking1;47551518]I changed ply:CheckGroup to Player:IsUserGroup and it broke the F4 menu.[/QUOTE] Can you post the code? My guess is that you didn't replace "Player" with your player variable.
[QUOTE=James xX;47551561]Can you post the code? My guess is that you didn't replace "Player" with your player variable.[/QUOTE] You should really read into things before you post. I don't think a single one of your posts has been helpful at all. Just because ply:CheckGroup isn't a vanilla function doesn't mean it doesn't exist. As for the problem, if the code posted initially actually runs, then there is no syntactical problem meaning that you are probably using your CheckGroup function wrong. I can't really help more unless I know what admin mod you are using and what your groups are called.
If it spews errors, would you be so kind as to paste the error here? It might not be that code causing the problem.
Is there a way to get any sort of metadata from a Shoutcast stream with http.Fetch or http.Post?
Is it possible to add images to a RichText element? (Smilies, tags, that sort of thing?)
How does one draw a wireframe box around an entity? The following code is not working. I see nothing on screen. [CODE]function ENT:Draw() self:DrawModel() local pos = self:GetPos() cam.Start3D() render.DrawWireframeBox( pos , Angle(0,0,0), Vector(pos.x-100, pos.y-100, pos.z), Vector(pos.x+100, pos.y+100, pos.z+100), Color(255,0,0,255), false ) cam.End3D() end[/CODE]
[QUOTE=SeveredSkull;47552733]How does one draw a wireframe box around an entity? The following code is not working. I see nothing on screen. [CODE]function ENT:Draw() self:DrawModel() local pos = self:GetPos() cam.Start3D() render.DrawWireframeBox( pos , Angle(0,0,0), Vector(pos.x-100, pos.y-100, pos.z), Vector(pos.x+100, pos.y+100, pos.z+100), Color(255,0,0,255), false ) cam.End3D() end[/CODE][/QUOTE] I don't have much experience with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/cam/Start3D]cam.Start3D[/url] but have you tried moving the position into the argument of the function, and removing it from the vectors in the render.DrawWireFrameBox() ?
[QUOTE=James xX;47552851]I don't have much experience with [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG] [URL="http://wiki.garrysmod.com/page/cam/Start3D"]cam.Start3D[/URL] but have you tried moving the position into the argument of the function, and removing it from the vectors in the render.DrawWireFrameBox() ?[/QUOTE] Yes. I found this thread: [URL]http://facepunch.com/showthread.php?t=1333309[/URL] which shows a working solution in game. However, whenever I make a change to it by removing the use of the bounding box it stops rendering. I cannot figure out why. The wiki [B][I][U]shows that the 2 vectors are relative to the origin[/U][/I][/B], so I dont understand why it is not rendering correctly. Edit: Nevermind Im an idiot and not thinking right. The [B][I][U]answer is right there in front of me[/U][/I][/B].
Is there a way to make a player use an entity without having to network anything to the server?
[QUOTE=meharryp;47552958]Is there a way to make a player use an entity without having to network anything to the server?[/QUOTE] Just pass in the player to both of the arguments to the Use() function.
[QUOTE=SeveredSkull;47553143]Just pass in the player to both of the arguments to the Use() function.[/QUOTE] The use function is serverside though, I'm wanting to run it clientside.
[QUOTE=meharryp;47553210]The use function is serverside though, I'm wanting to run it clientside.[/QUOTE] You could always hook into when keys are pressed, check if the key is the bind for use, do a trace for entities, and run the entity's use function like that, though there's probably a better way of doing it.
[QUOTE=LUModder;47552555]Is there a way to get any sort of metadata from a Shoutcast stream with http.Fetch or http.Post?[/QUOTE] What specifically? All metadata or just current song? Also is this Shoutcast v1, v2 or both?
I want something that lets me place models on my player character in-game. Pointshop doesn't sound like a good option though. Basically, I want something similar to the SCK (Swep Construction Kit) except I can make armor. Also good would be the ability to make models in the real world using a similar system, just to get lua code to create them. I'm posting in this thread cus I'm 99.99% sure it exists, and was hoping someone could help me out with this problem I'm having trying to find this stuff.
Sorry, you need to Log In to post a reply to this thread.