• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
Is there a way to change the lighting origin of an entity created using ClientsideModel? I'm doing stencil work and the things I'm drawing are outside of the map, so light can't reach them. At the very least, is there a way to make a dynamic light that only lights them up? I tried render.SetLocalModelLight and that gave me weird results.
[QUOTE=Z0mb1n3;49169559]Is there a way to change the lighting origin of an entity created using ClientsideModel? I'm doing stencil work and the things I'm drawing are outside of the map, so light can't reach them. At the very least, is there a way to make a dynamic light that only lights them up? I tried render.SetLocalModelLight and that gave me weird results.[/QUOTE] Try [url]http://wiki.garrysmod.com/page/render/SuppressEngineLighting[/url]
My code for reading a json .txt file ain;t working like it should. It spawns the object's but all in one pos. Code: [lua]function GM:InitPostEntity() local read = file.Read( "simplerpg/" .. string.lower( game.GetMap() ) .. "_json.txt", "DATA" ) local config = util.JSONToTable( read ) for k,v in pairs( config ) do if v[1] then for c,d in pairs( v ) do if k == "point_base_cops" then function spawnentity() local ent = ents.Create( k ) ent:SetPos( d ) ent:Spawn() end timer.Simple( 5, function() spawnentity() end ) end end end end end[/lua] The Json File [lua]{"point_base_cops":{"1":"[5.530015 -555.378906 -146.891373]","2":"[-2.144687 -350.373993 -146.890488]","3":"[95.893425 17.936914 -146.888580]","4":"[366.544434 358.352081 -146.902420]","5":"[775.693481 445.117218 -142.890366]"}}[/lua]
This is more of a general programming question but whatever I want an image to move up until it hits a certain point then move back down to its original location This is what I have so far, but it just shakes back and fore, which is not what I want: [code] image.Think = function() print(image.y) if image.y < 5 and image.y > 0 then image.y = image.y - 1 else image.y = image + 1 end end [/code] What would be the logic/maths behind moving it how I'd like?
Use panel move [editline]23rd November 2015[/editline] [url]http://wiki.garrysmod.com/page/Panel/MoveTo[/url]
Oh my fucking God, I forgot that existed - will definitely be easier
[QUOTE=guigui;49170273]Try [url]http://wiki.garrysmod.com/page/render/SuppressEngineLighting[/url][/QUOTE] Not really what I meant. I'm suppressing engine lighting, but I want to use the lighting functions (SetModelLighting and such) to fake the light that should be coming in from outside. The problem is that every functions I use still gives that fullbright feel, and it doesn't look at all natural.
[QUOTE=Z0mb1n3;49172102]Not really what I meant. I'm suppressing engine lighting, but I want to use the lighting functions (SetModelLighting and such) to fake the light that should be coming in from outside. The problem is that every functions I use still gives that fullbright feel, and it doesn't look at all natural.[/QUOTE] [code] function rb655_FixModelLighting( ent, pos ) render.SuppressEngineLighting( true ) render.SetLightingOrigin( pos ) local colAmbientLight = render.GetLightColor( pos ) render.ResetModelLighting( colAmbientLight.x, colAmbientLight.y, colAmbientLight.z ) ent:DrawModel() render.SuppressEngineLighting( false ) end[/code] Here's what I used for a SENT that suffered from similar or same problem. It isn't perfect, but it's something at least.
How does ents.FindInBox() work?
[QUOTE=zippy36jr;49174581]How does ents.FindInBox() work?[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/ents/FindInBox]ents.FindInBox[/url] Although it doesn't need another, here is a quick description. Anything within the lower corner of a box to the opposite upper corner of that box will be put into a table and given to you. By anything I mean entities like players, props, and cars.
hey i have seen that darkrp use global config strings/numbers with config.darkrp.moneyrp or something like that how do i make that i would like to have a config file with global strings/numbers i can take in any file example from darkrp [CODE] // this is rp money default config.darkrp.defaultmoney = 100 // auto kicked when joining config.darkrp.autokick = true // bal bla bla config.darkrp.bla = "Hello" [/CODE]
[QUOTE=lucaspou;49176740]how do i make that i would like to have a config file with global strings/numbers i can take in any file[/QUOTE] I don't really know anything about DarkRP, but considering [URL="https://github.com/FPtje/DarkRP/blob/master/gamemode/config/config.lua"]this file[/URL] calls all the variables something like [CODE] GM.Config.Whatever [/CODE] without actually defining GM, so I think you could just do [CODE] GM.Config.variable = value [/CODE] in any old Lua file(?)
[CODE] Not running script LuaCmd - it's too short [/CODE] Having this occuring often in console. Anybody knows why?
[QUOTE=P4sca1;49178476][CODE] Not running script LuaCmd - it's too short [/CODE] Having this occuring often in console. Anybody knows why?[/QUOTE] One of your scripts maybe
[QUOTE=geferon;49178483]One of your scripts maybe[/QUOTE] I mean, when will this error shows up? What's LuaCMD in this context?
Nevermind solved
Is there a way to detect the "pre-load" state, like when map is about to change? Because gui.HideGameUI() called in PreDrawHUD() hook hides the loading screen
[quote][img]http://images.akamai.steamusercontent.com/ugc/400054947283435046/F8141DA2B1E90190BD2D015DCE3CC8A2BBB4E6B8/[/img][/quote] Anyone know how to fix this? I'm trying to render a "detail" type panel over the ones already showing. I tried MoveToFront but that didn't help.
[QUOTE=P4sca1;49179155]I mean, when will this error shows up? What's LuaCMD in this context?[/QUOTE] The input to ply:SendLua or BroadcastLua is an empty string
[QUOTE=Willox;49180200]The input to ply:SendLua or BroadcastLua is an empty string[/QUOTE] Thanks, that is explaining the problem.
How can i get the name of a vehicle?
-snip i am as blind as a bat-
[QUOTE=jrj996;49180116]Anyone know how to fix this? I'm trying to render a "detail" type panel over the ones already showing. I tried MoveToFront but that didn't help.[/QUOTE] Try creating the detail panel after the main panel
Is there any good tutorial on how to make like good particles? Its just that i want to learn how to do them. But the good ones.
How can I get the object a player is currently holding?
[QUOTE=TFA;49193922]How can I get the object a player is currently holding?[/QUOTE] What do you mean with "the object"? [editline]27th November 2015[/editline] [QUOTE=geferon;49191482]Is there any good tutorial on how to make like good particles? Its just that i want to learn how to do them. But the good ones.[/QUOTE]
[QUOTE=geferon;49193932]What do you mean with "the object"?[/QUOTE] I'm guessing he means the prop a player is holding with the physgun. [QUOTE=TFA;49193922]How can I get the object a player is currently holding?[/QUOTE] If you are talking about that then these should help. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PhysgunPickup]GM/PhysgunPickup[/url] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PhysgunDrop]GM/PhysgunDrop[/url]
I mean with the E key Edit: Basically I want my SWEPs to properly holster and then +use after the animation is done
[QUOTE=TFA;49194102]I mean with the E key Edit: Basically I want my SWEPs to properly holster and then +use after the animation is done[/QUOTE] There is no built-in function that I know of to do this, so instead look into [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/AllowPlayerPickup]GM/AllowPlayerPickup[/url] and have it set a variable on the player retaining the entity they picked up. Then use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/DropEntityIfHeld]Global.DropEntityIfHeld[/url] on the entity with a check to make sure the player holding it is the owner of the gun.
Does anyone know of a way to draw a 3D2D panel with a HTML texture on it? Been searching for a way to make one but can't find anything. Thanks! :smile:
Sorry, you need to Log In to post a reply to this thread.