GMod - What are you working on? November 2015 (#51)
264 replies, posted
[QUOTE=Melted Bu11et;49195314]To not make it choppy, you need to increase how much it thinks per second. I think the function is Ent:NextThink.[/QUOTE]
Set NextThink to CurTime and you should be good to go.
[QUOTE=CGHippo;49191423]
I finished my knockout script.[/QUOTE]
Wait, didn't you just buff the fists SWEP a lot?
[QUOTE=MPan1;49195579]Wait, didn't you just buff the fists SWEP a lot?[/QUOTE]
nope
[CODE]
function GM:PlayerHurt( victim, attacker )
if ( attacker:IsPlayer() ) and ( attacker:HasWeapon("weapon_fists") ) and ( victim:GetHitBoxBone( 0, 0 ) ) then
local pos = victim:GetPos()
victim:CreateRagdoll()
victim:SetRenderMode(RENDERMODE_TRANSALPHA)
victim:SetColor( Color(0, 0, 0, 0 ) )
victim:Freeze( true )
victim:GodEnable()
victim:SetCollisionGroup( 20 )
timer.Simple( 2, function()
victim:Respawn()
victim:SetPos( pos )
SafeRemoveEntity( victim:GetRagdollEntity() )
victim:SetRenderMode( 0 )
victim:SetColor( Color(255, 255, 255, 255) )
victim:Freeze( false )
victim:GodDisable()
victim:SetCollisionGroup( 0 )
end )
end
end
hook.Add( "PlayerHurt", "Knockout", PlayerHurt )
[/CODE]
Not a lot. Only took me like 10 minutes to make.
I just ran into some problems during the coding of it. So if you saw help threads on this thats why.
[QUOTE=CGHippo;49197751]nope
Not a lot. Only took me like 10 minutes to make.
I just ran into some problems during the coding of it. So if you saw help threads on this thats why.[/QUOTE]
It still seems ridiculous to get knocked out for every head shot
[QUOTE=CGHippo;49197751]nope
[CODE]
function GM:PlayerHurt( victim, attacker )
if ( attacker:IsPlayer() ) and ( attacker:HasWeapon("weapon_fists") ) and ( victim:GetHitBoxBone( 0, 0 ) ) then
local pos = victim:GetPos()
victim:CreateRagdoll()
victim:SetRenderMode(RENDERMODE_TRANSALPHA)
victim:SetColor( Color(0, 0, 0, 0 ) )
victim:Freeze( true )
victim:GodEnable()
victim:SetCollisionGroup( 20 )
timer.Simple( 2, function()
victim:Respawn()
victim:SetPos( pos )
SafeRemoveEntity( victim:GetRagdollEntity() )
victim:SetRenderMode( 0 )
victim:SetColor( Color(255, 255, 255, 255) )
victim:Freeze( false )
victim:GodDisable()
victim:SetCollisionGroup( 0 )
end )
end
end
hook.Add( "PlayerHurt", "Knockout", PlayerHurt )
[/CODE]
Not a lot. Only took me like 10 minutes to make.
I just ran into some problems during the coding of it. So if you saw help threads on this thats why.[/QUOTE]
You're using the wrong hook for this.
You should be using ScalePlayerDamage, because PlayerHurt does not pass information to the function that says which bone was hit.
Currently, you're using GetHitBoxBone, which isn't doing what you're thinking it is.
GetHitBoxBone is simply returning the number of the bone you are asking for with '0, 0', rather than telling you if that was the bone that was hit.
Also, you're using HasWeapon, which means even if the weapon I have equipped isn't fists, I can still knock them out. Coupled with the other thing I mentioned, I could shoot someone in the foot with a pistol and knock them out.
[QUOTE=Z0mb1n3;49198550]You're using the wrong hook for this.
You should be using ScalePlayerDamage, because PlayerHurt does not pass information to the function that says which bone was hit.
Currently, you're using GetHitBoxBone, which isn't doing what you're thinking it is.
GetHitBoxBone is simply returning the number of the bone you are asking for with '0, 0', rather than telling you if that was the bone that was hit.[/QUOTE]
I know this. But I'm not sure because it was not working for me.
[QUOTE]
NOTE: This is not called for all damage a player receives ( For example fall damage or NPC melee damage ), so you should use GM:EntityTakeDamage instead if you need to detect ALL damage.
[/QUOTE]
Saw that note on the wiki for ScalePlayerDamage so thats why I thought it wasn't working. Or I wasn't reading it right.
Another tiny slice of story mode that I'm still working on (now from the greedy side):
[media]https://www.youtube.com/watch?v=qU4f-o48PZU[/media]
I really wanted to make a Black Friday expansion for The Bronx this thanksgiving but ugh not enough time :c
[QUOTE=Nak;49101648]Revived my taunt-framework .. thingy.
Not sure if I should turn it into a pointshop addon or how people should chose their taunt.
You press H to play/toggle a taunt.
[video=youtube;T51FtYkEoOg]http://www.youtube.com/watch?v=T51FtYkEoOg[/video]
(The buttons are an edited gmod_button that run lua: ply.SelectedTaunt = '<tauntname>')[/QUOTE]
What is the last taunt/animation called? ( little late for the bandwagon but I like the animation )
Updated my buff system, now in the inventory you can tell how many buff slots an item has by looking at the amount of boxes in the weapon icon.
Black outline + Green box = Upgrade slot that can never be changed
White outline + Grey flashing box = Slot that can be upgraded
Black outline + X in middle = Slot that can't be used ever
Upgrading your weapon changes it's name depending on how much the buff increases that weapons stat, it gathers all the points added by buffs and changes it's name.
[video]https://youtu.be/idpwT2DN5ZU[/video]
I'd like to have buffs names be generated by the amount of effect it's stat creates and change the color of the name of the buff depending on the type of effect it creates. Possibly change the color of the slot in the inventory depending on it's level, what do you guys think?
I like jetpacks. Gonna make a HUD icon to show the delay before the next jump is ready.
Recharge delay disabled for video purposes.
Trying to get the model of the jump pack from Battlefront to use with this, but until then, no model.
[video=youtube_share;4p_GLWsfP5I]http://youtu.be/4p_GLWsfP5I[/video]
Direction of thrust depends on which way you're moving, and if you're not moving it defaults to forwards.
[QUOTE=Z0mb1n3;49202587]Direction of thrust depends on which way you're moving, and if you're not moving it defaults to forwards.[/QUOTE]
That is amazing and such a nice touch to it, one of my biggest gripes with jetpack scripts is that if you're not moving when you use it, it's impossible to gain momentum and move around afterwards in mid-air.
[QUOTE=Z0mb1n3;49202587]I like jetpacks. Gonna make a HUD icon to show the delay before the next jump is ready.
Recharge delay disabled for video purposes.
Trying to get the model of the jump pack from Battlefront to use with this, but until then, no model.
[video=youtube_share;4p_GLWsfP5I]http://youtu.be/4p_GLWsfP5I[/video]
Direction of thrust depends on which way you're moving, and if you're not moving it defaults to forwards.[/QUOTE]
How does it look in 3rd person?
[QUOTE=Alig96;49207518]How does it look in 3rd person?[/QUOTE]
As I said in the post, I'm trying to get the jump pack model from the new Battlefront, so until then there's nothing but a dynamic light attached to the player.
[QUOTE=Z0mb1n3;49202587]I like jetpacks. Gonna make a HUD icon to show the delay before the next jump is ready.
Recharge delay disabled for video purposes.
Trying to get the model of the jump pack from Battlefront to use with this, but until then, no model.
[video=youtube_share;4p_GLWsfP5I]http://youtu.be/4p_GLWsfP5I[/video]
Direction of thrust depends on which way you're moving, and if you're not moving it defaults to forwards.[/QUOTE]
HUD Looks good.
It has depth, and innovation.
Simplistic and has great use of surface.DrawPoly.
Grenade looks totally awesome.
Jetpack is awesome too.
[QUOTE=EthanTheGreat;49208258]HUD Looks good.
It has depth, and innovation.
Simplistic and has great use of surface.DrawPoly.
Grenade looks totally awesome.
Jetpack is awesome too.[/QUOTE]
even though the HUD wasn't the point of the video, which may be what it looks like, I'm glad you like it.
It also doesn't use drawpoly, they're a bunch of textures.
[img]http://puu.sh/lDahO/15f897e7b4.jpg[/img]
I don't even know anymore
ah, that was my idea lol
added new sounds to one of my sweps on my server, as well as adding animation to some of the parts. i really wish there was a way to make my own animations using lua for viewmodels
[video=youtube;PSWTnMkBI78]http://www.youtube.com/watch?v=PSWTnMkBI78&feature=youtu.be[/video]
[t]https://dl.dropboxusercontent.com/u/17839069/C_398.jpg[/t]
Finally got around to adding player models for driving. :V
Made the sights pop up when you aim down them, as well as added some reflex sights using intersectraywithplane to get a 100% accurate position
[video=youtube_share;9fe2tZU5WlU]http://youtu.be/9fe2tZU5WlU[/video]
Made a nice HUD indicator for jetpack recharge time.
After much trial and error, I proudly gave up on using stencils for this effect, due to the fact that stencils don't obey transparent pixels in a texture.
In the style of the new Battlefront's UI, too.
[video=youtube;Bu62BR_5k4g]http://www.youtube.com/watch?v=Bu62BR_5k4g[/video]
And no, the recharge time is not controlled by the client. The server keeps track of jetpack recharge time.