[QUOTE=Willox;47364871]It sounds like you're using LerpVector non-linearly. Show your code.[/QUOTE]
I figured it out
Anyone able to provide a guide or tips for creating inventories. I'm a little lost in terms of what needs to be done?
[QUOTE=Exho;47364881]I figured it out[/QUOTE]
Your video implies you're still using it wrong.
[QUOTE=Robotboy655;47361182]Is CS:S content actually mounted on the server?[/QUOTE]
Yep, it works if i use GAME. The reason i can't is because i want to detect where a model is coming from
I'm looking to add forcelimits to every single constraint there is, including elastics, hydraulics, muscle, sliders, winches, whatever.
Where should I be looking? Will I need to recreate the constraint library or add my own modules to the game?
[QUOTE=Willox;47363627]What makes you think any of it will lag?[/QUOTE]
Idk I'm unfamiliar with lua
Idk there's a lot of damage perks (~20 of them) and I think the structure would be a bit intensive because you're asking to change a table and then returning it around 20 times
[QUOTE=wauterboi;47359768]Why would this only draw a white square on the screen?
[code] function SWEP:DrawHUD()
local oldRT = render.GetRenderTarget( )
local rt = GetRenderTarget( "scopeRT", ScrH( ) / 3, ScrH( ) / 3 )
local rtMat = CreateMaterial( "scopeRTMat", "UnlitGeneric",
{
["$basetexture"] = "scopeRT"
} )
render.SetRenderTarget( rt )
render.SetViewPort( 0, 0, ScrW( ), ScrH( ) )
render.Clear( 0, 0, 0, 255 )
local CamData = {}
CamData.angles = LocalPlayer( ):EyeAngles( )
CamData.origin = LocalPlayer( ):EyePos( )
CamData.x = 0
CamData.y = 0
CamData.w = ScrW( ) / 3 * 2
CamData.h = ScrH( ) / 3 * 2
CamData.fov = 30
CamData.drawhud = false
CamData.drawviewmodel = false
CamData.dopostprocess = false
render.RenderView( CamData )
render.SetRenderTarget( oldRT )
render.SetViewPort( 0, 0, ScrW( ), ScrH( ) )
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial( rtMat )
surface.DrawTexturedRect( ScrW( ) / 2 - ScrH( ) / 3, ScrH( ) / 6, ScrH( ) / 3 * 2, ScrH( ) / 3 * 2 )
end[/code][/QUOTE]
Yo, I don't want to be a pest but I'm still lost with what's wrong with this and I need someone smarter than me to bestow the smarts.
Dont worry wauterboi, I too am also having problems with rendertargets and creating materials from them. Also apparently drawing a poly with a texture results in the poly not being drawn? I'll run some more tests and get some more conclusive evidence at some point.
[QUOTE=G4MB!T;47367102]Dont worry wauterboi, I too am also having problems with rendertargets and creating materials from them. Also apparently drawing a poly with a texture results in the poly not being drawn? I'll run some more tests and get some more conclusive evidence at some point.[/QUOTE]
If I remove the color, the poly doesn't draw. I'm assuming that the material isn't being manipulated and "saved" correctly, and so it just uses the color.
-snip-
If I do something like player.GetAll and it returns something like
[CODE]
Player [7] MPan
[/CODE]
would this value change if a new user joined the server, or an old user left, to something like
[CODE]
Player [5] MPan
[/CODE]
I really need to know, because with the thing I'm currently doing, I need the player type to remain the same so the function gets called on the right one, even if new players join or leave (note it won't matter if MPan leaves, it'll just prompt to choose a new player).
[QUOTE=MPan1;47370120]If I do something like player.GetAll and it returns something like
[CODE]
Player [7] MPan
[/CODE]
would this value change if a new user joined the server, or an old user left, to something like
[CODE]
Player [5] MPan
[/CODE]
I really need to know, because with the thing I'm currently doing, I need the player type to remain the same so the function gets called on the right one, even if new players join or leave (note it won't matter if MPan leaves, it'll just prompt to choose a new player).[/QUOTE]
The number indicates the entity's entindex which won't change.
Alright, thanks. Also, I'm trying to find out what the command is to clean up all props for a user, the string 'all' doesn't work, and 'everything' doesn't work, and I can't find the cleanup table on the Gmod Wiki. This is what I have, and note that 'ply' is an actual player.
[CODE]
cleanup.CC_Cleanup( ply, nil, "all" )
[/CODE]
Trying to mess around with the new Entity:GetSubMaterial but I've noticed there's no function on the wiki to get all the materials to see which I can change? Is there no GetSubMaterials in the same way there's bodygroups, etc.
[QUOTE=Adzter;47370542]Trying to mess around with the new Entity:GetSubMaterial but I've noticed there's no function on the wiki to get all the materials to see which I can change? Is there no GetSubMaterials in the same way there's bodygroups, etc.[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/GetMaterials]Entity:GetMaterials[/url]
[lua]
] lua_run PrintTable(player.GetByID(1):GetActiveWeapon():GetMaterials()) -- To get the Index. Returns the Non Modified paths. Good for restoring back to the original.
> PrintTable(player.GetByID(1):GetActiveWeapon():GetMaterials())...
1 = models/weapons/csgo/snip_ssg08
2 = models/weapons/csgo/snip_ssg08_scope
] lua_run player.GetByID(1):GetActiveWeapon():SetSubMaterial(0, "skinshop/scout/desersnow/v_desertsnow.vmt") -- Setting an Submaterial
> player.GetByID(1):GetActiveWeapon():SetSubMaterial(0, "skinshop/scout/desersnow/v_desertsnow.vmt")...
] lua_run print(player.GetByID(1):GetActiveWeapon():GetSubMaterial(0)) -- With GetSubMaterial you can get the modified material.
> print(player.GetByID(1):GetActiveWeapon():GetSubMaterial(0))...
skinshop/scout/desersnow/v_desertsnow.vmt
] lua_run PrintTable(player.GetByID(1):GetActiveWeapon():GetMaterials()) -- As you can see, the material is still the same, despite that i setted it to an different one.
> PrintTable(player.GetByID(1):GetActiveWeapon():GetMaterials())...
1 = models/weapons/csgo/snip_ssg08
2 = models/weapons/csgo/snip_ssg08_scope
[/lua]
I'm looking at the Fretta HUD and noticed it uses vgui.Create. Is it okay to make those sort of things in a HUDPaint hook/function?
Is it possible to make rollermines take damage from bullets?
[QUOTE=r0uge;47371138]Is it possible to make rollermines take damage from bullets?[/QUOTE]
definitely, this is something I've done before.
[code]function DamageRollers( target, dmginfo )
local damage = dmginfo:GetDamage( )
if target:IsNPC( ) then
if target:GetClass( ) == "npc_rollermine" then
if target:Health( ) - damage <= 0 then
target:Fire( "InteractivePowerDown" )
target:SetHealth( 0 )
else
target:SetHealth( target:Health( ) - damage )
end
end
end
end
hook.Add( "EntityTakeDamage", "DamageRollermines", DamageRollers )[/code]
This is how I did it, you're free to use this.
[QUOTE=NiandraLades;47371010]I'm looking at the Fretta HUD and noticed it uses vgui.Create. Is it okay to make those sort of things in a HUDPaint hook/function?[/QUOTE]
I would say only of it's creating it only when it doesn't already exist. Can you show/link the code you are taking about?
What am I meant to write for the args? (Note I want to cleanup ALL props from a client)
[CODE]
cleanup.CC_Cleanup( ply, nil, args )
[/CODE]
From the wiki:
[CODE]
cleanup.CC_Cleanup( Player pl, string command, table args )
[/CODE]
[QUOTE]Args - First and only arg is the cleanup type.[/QUOTE]
Where's the cleanup args table?
Does Garry's Mod support unicode characters in the PUA properly? I can't seem to make them work.
[QUOTE=wh1t3rabbit;47371393]I would say only of it's creating it only when it doesn't already exist. Can you show/link the code you are taking about?[/QUOTE]
[url]https://github.com/JetBoom/fretta13/blob/master/gamemodes/fretta13/gamemode/cl_hud.lua[/url]
Or more specifically
[url]https://github.com/JetBoom/fretta13/blob/master/gamemodes/fretta13/gamemode/cl_hud.lua#L184[/url]
[QUOTE=NiandraLades;47372033][url]https://github.com/JetBoom/fretta13/blob/master/gamemodes/fretta13/gamemode/cl_hud.lua[/url]
Or more specifically
[url]https://github.com/JetBoom/fretta13/blob/master/gamemodes/fretta13/gamemode/cl_hud.lua#L184[/url][/QUOTE]
That is called from RefreshHUD which includes a check for whether the HUD needs to updated or not so it's not being done every frame, only when needed.
Can someone tell me how to make a toggle key for sprint in a game mode?
In other words I don't want to always hold down left shift and would like a seperate key to toggle it always on or off.
Any help appreciated. Thanks
How could i call the spectate function from FAdmin in my menu?
[QUOTE=RedNinja;47373249]How could i call the spectate function from FAdmin in my menu?[/QUOTE]
Net library
There's probably a console command, would be easier.
[editline]22nd March 2015[/editline]
/spectate at a guess
[QUOTE=zerf;47350031]Is there any way I can get the server's current gamemode on the client while addons are still loading? I'm attempting to prevent gamemode-specific addons from loading when the gamemode isn't correct, but I can't get the client part figured out.
[QUOTE=swadicalrag;47352933][CODE]GetConVar('gamemode'):GetString()[/CODE]
or
[CODE]engine.ActiveGamemode()[/CODE][/QUOTE]
GetConVar():GetString returns the client's selected gamemode at the time.
engine.ActiveGamemode() returns base at the time.[/QUOTE]
bump
I am getting an error with my code that happens around line 11 where i first call surface.CreateFont
ERROR
[QUOTE][ERROR] addons/simple hud/lua/autorun/cl_init.lua:11: attempt to index global 'surface' (a nil value)
1. unknown - addons/simple hud/lua/autorun/cl_init.lua:11
[/QUOTE]
CODE
[QUOTE]Line 10: //CreateFonts Here
Line 11: surface.CreateFont( "SHPlayerName", { font = "DermaDefaultBold", size = 22, weight = 800 } )
Line 12: surface.CreateFont( "SHPlayerStats", { font = "DermaDefault", size = 22, weight = 400 } )[/QUOTE]
I feel like i am really being stupid not knowing what is wrong
[QUOTE=CreeperMoon2;47374654]I am getting an error with my code that happens around line 11 where i first call surface.CreateFont
ERROR
CODE
I feel like i am really being stupid not knowing what is wrong[/QUOTE]
You are trying to run clientside functions on server.
Sorry, you need to Log In to post a reply to this thread.