Perform your desired trace ( hull or normal ), setup a damageinfo object, and then do this:
[code]self.Owner:DispatchTraceAttack( dmginfo, trace_result, trace_result.Normal )[/code]
An example could be:
[code]local tr = { }
tr.start = self.Owner:GetShootPos( )
tr.endpos = tr.start + self.Owner:GetAimVector( ) * self.Reach
tr.filter = self.Owner
tr.mask = MASK_SHOT_HULL
tr.mins = Vector( -2, -2, -2 )
tr.maxs = Vector( 2, 2, 2 )
local res = util.TraceHull( tr )
--Do hull trace attack mabob thing
if res.Entity:IsValid( ) then
sound.Play( "Weapon_Crowbar.Melee_Hit", res.HitPos )
local info = DamageInfo( )
info:SetDamage( self.Primary.Damage )
info:SetDamageType( self.Primary.DamageType )
info:SetAttacker( self.Owner )
info:SetInflictor( self )
info:SetDamagePosition( res.HitPos )
info:SetDamageForce( res.Normal * self.Primary.Damage )
res.Entity:DispatchTraceAttack( info, res, tr.Normal )
elseif res.Hit then
sound.Play( "Weapon_Crowbar.Melee_HitWorld", res.HitPos )
end[/code]
Is it possible to render a halo around an entity hit by trace, then remove the halo when it no longer hits?
PreDrawHalos, simply add the entity in that hook during the trace. if the trace doesn't hit, don't add the entity...
[QUOTE=Acecool;46506981]PreDrawHalos, simply add the entity in that hook during the trace. if the trace doesn't hit, don't add the entity...[/QUOTE]
Thx
edit: Ah, I think was doing it completely wrong. I was playing around with displaying entity names in the HUDPaint hook and tried marking entites to render a halo within it
How can I get COLLISION_GROUP_PUSHAWAY to work? ([url]http://wiki.garrysmod.com/page/Enums/COLLISION[/url])
[QUOTE=HumbleTH;46505287]Sorry, I thought you could do that. Never mind what I said above, just tested it and what I suggested isn't possible.[/QUOTE]
It's possible, I've done it with many crowbars, but not with the swep construction kit.
First you need to parent the hook model to the crowbar bone (not sure what else to call it, it's the bone on the viewmodel which corresponds to the crowbar.)
Then use viewmodel:ManipulateBoneScale( crowbarbone, Vector(0.01,0.01,0.01) ) --basically something very small, so that the entire hook model obscures it
on the worldmodel you override SWEP:DrawWorldModel to hide the world model, then draw the hook model at the world model's position/angles
then it should look fine, I'll post the code for my version below, it replaces the crowbar model with a lead pipe.
Oh and the code is appropriated from TTT's crowbar code because i wanted the same functionality please don't sue me
[url]http://pastebin.com/WcukUanV[/url]
edit: I realised this only works because the hand is off-screen in the viewmodel, but it still moves with the crowbar's movements.
I notice most ViewModel functions support an ID, ( 0, 1, or 2 ), but how could I create a ViewModel for each index?
How can I set the alpha of a player?
[QUOTE=LUModder;46507534]How can I set the alpha of a player?[/QUOTE]
[code]
ply:SetRenderMode(RENDERMODE_TRANSALPHA)
local col = ply:GetColor()
ply:SetColor( col.r, col.g, col.b, 10 ) // Sets the alpha of player to 10
[/code]
I notice most ViewModel functions support an ID, ( 0, 1, or 2 ), but how could I create a ViewModel for each index?
Is there a way to reload gamemode files without replacing every version of GM with GAMEMODE
or
[code]
GMODE = GM or GAMEMODE
[/code]
[QUOTE=Pandaman09;46513615]Is there a way to reload gamemode files without replacing every version of GM with GAMEMODE
or
[code]
GMODE = GM or GAMEMODE
[/code][/QUOTE]
You don't need to rename anything as long as you are on windows, AddCSLuaFile properly and use the gamemodes/ folder.
[QUOTE=Robotboy655;46513737]You don't need to rename anything as long as you are on windows, AddCSLuaFile properly and use the gamemodes/ folder.[/QUOTE]
Error:
[url]http://puu.sh/cV9F4/e121aafebc.png[/url]
settings.lua:
[url]http://puu.sh/cV9Vl/0b068723d7.png[/url]
init.lua:
[url]http://puu.sh/cVa0B/a7f2251732.png[/url]
I have a vgui setup with draggable children, but after I drop something my cursor disables itself.
I've tried setting gui.EnableScreenClicker(true) in my PANEL:Receiver function but doesn't seem to work. Is there something I could do to stop the cursor from disabling itself?
edit: I ended up putting gui.EnableScreenClicker(true) inside a think function on a parent panel. If there's a better way let me know
For some reason, in my gamemode, my players don't have hands on viewmodels, do I need to do something different than ply:SetModel() or something?
[QUOTE=LUModder;46515493]For some reason, in my gamemode, my players don't have hands on viewmodels, do I need to do something different than ply:SetModel() or something?[/QUOTE]
[url]https://github.com/garrynewman/garrysmod/commit/36dd6581c61e733e782549278ca16e5db3fd0e19[/url]
Did some digging and this might help you.
(in case you want to start from the beginning: [url]http://facepunch.com/showthread.php?t=1286481[/url])
[QUOTE=Pandaman09;46514041]Error:
[url]http://puu.sh/cV9F4/e121aafebc.png[/url]
settings.lua:
[url]http://puu.sh/cV9Vl/0b068723d7.png[/url]
init.lua:
[url]http://puu.sh/cVa0B/a7f2251732.png[/url][/QUOTE]
It should auto-refresh when you save the file. You're getting errors because you're using lua_openscript.
[QUOTE=.\\Shadow};46515757]It should auto-refresh when you save the file. You're getting errors because you're using lua_openscript.[/QUOTE]
Yes, I know. I want to manually reload the files which is why I asked in the first place.
What are the names of the DarkRP scoreboard hooks so that I can use only my own scoreboard using hook.Remove("darkrpscoreboard")
[QUOTE=LUModder;46515493]For some reason, in my gamemode, my players don't have hands on viewmodels, do I need to do something different than ply:SetModel() or something?[/QUOTE]
ply:SetupHands() on PlayerSpawn
-Snip. Did something wrong above the code
-snip- what i was looking for was literally in the file i was reading, kill me
[QUOTE=DarthTealc;46517053]Some files on a server I administrate will not download from FDL. Yet they're on FDL and download in my browser, and other files on FDL download ingame (same server, same FDL). I get this error in console repeated for each failed file (both bz2 and non-bzipped variety). Replaced the domain as I'm not advertising.
[code]HTTP ERROR downloading http://fdl.example.com/materials/zombiesurvival/circlegradient.vtf.bz2[/code]
download_debug 1 didn't make a difference to the message.
Is there any way to make the error message more useful? An HTTP error code would help.
EDIT: The downloading issue was a Cloudflare issue which is now fixed but I'd still like to know if there's a way to make that error more useful just in case something happens again, and I'm sure it'd be helpful for others[/QUOTE]
Check the troubleshooting here and make sure FastDL is setup correctly: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/fastdl_setup_instructions.lua.html[/url]
Recursive resource loader: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url]
[editline]18th November 2014[/editline]
[QUOTE=Pandaman09;46518073]Yes, I know. I want to manually reload the files which is why I asked in the first place.[/QUOTE]
Take a look at how my system does it: [url]https://bitbucket.org/Acecool/acecooldev_base/src/master/gamemode/sh_init.lua?at=master[/url]
Problem with a Think function and some mouse position related math. Just for knowledge, mx/my are gui.MouseX() functions so I can get the mouse position. And minx/y and farx/y are just numbers.
This code only prints "ayy" and "re" once each then stops which is not what I need.
[code]
if mx > minx and mx < farx and my > miny and my < fary then
print("ayy")
if IsInCanvas(mx, my) then
print("Re")
SetShapeSize(id, mx - x, my - y)
end
end
[/code]
And this code prints "ayy" as many times, which is good, but my mouse position isnt being checked which is what I wanted.
[code]
if IsInCanvas(mx, my) then
print("ayy")
SetShapeSize(id, mx - x, my - y)
end
[/code]
My question is, why is comparing my mouse position a couple different times causing the Think hook to only print once? I have tested variations of that code and discovered that it is the mouse position comparing that is causing it, I just want to know why and how I can prevent it
[QUOTE=Acecool;46521427]Take a look at how my system does it: [url]https://bitbucket.org/Acecool/acecooldev_base/src/master/gamemode/sh_init.lua?at=master[/url][/QUOTE]
So all you are doing is setting GM as GAMEMODE again. That is a much more simple way to do it. Would I have to manually send the clientside files or is that done automagically with AddCSLuaFile? Also thanks for the help.
My system handles AddCSLuaFile and include without any input on my side. The loadgm console command is what triggers the includes to occur. You'd basically need to set up a function that has all of your includes, etc.. in there, and when you want to reload call it. If it isn't done by actual refresh then have the GM = GAMEMODE. Also, you can put GM = GAMEMODE in one of the files that are first to load ( if the game-mode has already loaded ), so when that file loads first, there won't be any issues.
Can someone inspect this dump file and see what may have caused the crash?
[URL="http://www.mediafire.com/download/gcole39jezal230/srcds_1678491_crash_2014_11_19T2_49_11C0.mdmp"]http://www.mediafire.com/download/gcole39jezal230/srcds_1678491_crash_2014_11_19T2_49_11C0.mdmp[/URL]
EDIT:
I'll just open it in Visual Studio, wish me luck!
EDIT EDIT:
WELP I got as far as I could go. I knew I would need something to debug.
Funny enough the dump told me the original location of where the pdb was.
c:\jenkins\workspace\gmod_do_build_client_windows\src\game\server\Release_garrysmod\server.pdb
I remember there being a site to send dumps but nowhere to be found. Can garry just release the pdb so we can debug ourselves?
Why are hands invisible in first-person spectator, and how can I fix this?
Sorry, you need to Log In to post a reply to this thread.