Does anyone know the ACT animation name for the player lying on the ground, I've seen it on a few servers before I just can't find the ACT ENUM for it ([url]http://wiki.garrysmod.com/page/Enums/ACT[/url]).
I figured my stuff out: DoImpactEffect( ) is what you need!
Now to figure out how to create a Particle Effect tracer that follows your gun...
[QUOTE=Adzter;47762640]Does anyone know the ACT animation name for the player lying on the ground, I've seen it on a few servers before I just can't find the ACT ENUM for it ([url]http://wiki.garrysmod.com/page/Enums/ACT[/url]).[/QUOTE]
ACT_DOD_PRONE_*
[QUOTE=polivlas;47762652]ACT_DOD_PRONE_*[/QUOTE]
I was under the assumption you're not able to use any DOD ACTs for player animations. Trying it out results in the playermodel just doing the T pose.
EDIT: Turns out the one I was looking for was: ACT_HL2MP_ZOMBIE_SLUMP_IDLE
How do you remove localized clientside models?
[QUOTE=wauterboi;47762925]How do you remove localized clientside models?[/QUOTE]
ENT:Remove() them within the scope? Is there a reason why you need to delete it outside of its local scope?
Anyone got ways to paint a DComboBox, making sure all of the elements of it are still displayed?
Does anyone have any good methods to overlay [URL="https://github.com/HandsomeMatt/3d2d-vgui"]Handsome Matt's 3d2d vgui[/URL] onto a view model? Angles are just not something that I entirely understand especially with view models
[code]
local client = LocalPlayer()
local frame = vgui.Create( "DFrame" )
frame:SetPos( 0, 0 )
frame:SetSize( 400, 250 )
frame:SetTitle( "Test" )
hook.Add( "PreDrawViewModel", "DrawSample3D2DFrame2", function( vm, ply, wep )
if ply != client then return end
if wep != self then return end
local fwd = client:GetForward()
local rgt = client:GetRight()
local pos = vm:GetPos()
local eyeAng = client:EyeAngles()
local vmAng = vm:GetAngles()
pos = pos + Vector( (fwd.x * 10) - (rgt.x * 2), (fwd.y * 10) - (rgt.y * 2), 0 )
local ang = Angle( 0, eyeAng.y - 90, 90 )
vgui.Start3D2D( pos, ang, 0.01 )
frame:Paint3D2D()
vgui.End3D2D()
end)
[/code]
[vid]https://giant.gfycat.com/PastelBadHyracotherium.webm[/vid]
[QUOTE=Adzter;47762656]I was under the assumption you're not able to use any DOD ACTs for player animations. Trying it out results in the playermodel just doing the T pose.
EDIT: Turns out the one I was looking for was: ACT_HL2MP_ZOMBIE_SLUMP_IDLE[/QUOTE]
After messing around today this anim seems to work but does anyone know why it's so inconsistent?
Here's what I mean:
[vid]http://zippy.gfycat.com/JadedRemoteFeline.webm[/vid]
Sometimes the player will get up using the animation, sometimes they'll just glide up and sometimes they'll slowly get up. Is it an issue with the animation not being reset or maybe there's multiple animations? I can't seem to find much on Google and it doesn't seem return much.
EDIT: Seems like it's got a pool of about 3-4 animations and one of them is instantly stand up, I can't find anything on how ACT works I'm just going off assumptions, is there maybe a way to force it to just use one animation?
[QUOTE=Busan1;47761694][url]http://wiki.garrysmod.com/page/Entity/GetPhysicsObjectCount[/url]
[url]http://wiki.garrysmod.com/page/Entity/GetPhysicsObjectNum[/url]
[url]http://wiki.garrysmod.com/page/Entity/GetBonePosition[/url]
you probably need those and then get the bone from model 2 and SetPos/SetAngles like the bone for model 1[/QUOTE]
[QUOTE=wh1t3rabbit;47761700]Bone merge by AddEffects [url]http://wiki.garrysmod.com/page/Entity/AddEffects[/url] . Old wiki has an example [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4e03.html[/url][/QUOTE]
I'm gonna thank both of you now before I try this. Thank you very much! I hope these work nicely.
[QUOTE=WalkingZombie;47766898]I'm gonna thank both of you now before I try this. Thank you very much! I hope these work nicely.[/QUOTE]
Just a heads up, bonemerging is going to be a lot easier to use if you want the models to be directly on top of each other.
[QUOTE=Adzter;47766604]After messing around today this anim seems to work but does anyone know why it's so inconsistent?
Here's what I mean:
[vid]http://zippy.gfycat.com/JadedRemoteFeline.webm[/vid]
Sometimes the player will get up using the animation, sometimes they'll just glide up and sometimes they'll slowly get up. Is it an issue with the animation not being reset or maybe there's multiple animations? I can't seem to find much on Google and it doesn't seem return much.
EDIT: Seems like it's got a pool of about 3-4 animations and one of them is instantly stand up, I can't find anything on how ACT works I'm just going off assumptions, is there maybe a way to force it to just use one animation?[/QUOTE]
Just thought I'd post the solution I've found in case anyone is searching for this in the future, I simply added ply:AnimRestartMainSequence() before starting the animation.
How do I change the frame of a VMT? I set the Framerate to 0 and want a CLuaParticle to spawn with a random frame.
[QUOTE=Johnny Guitar;47767122]Just a heads up, bonemerging is going to be a lot easier to use if you want the models to be directly on top of each other.[/QUOTE]
Yeah. I got it all working, thanks. When I first tried bone merging, I died when I realized how easy it was! It automatically perfectly aligned every single bone. Immeasurable thanks! I did end up using a function or two that Busan1 mentioned, though. "GetPhysicsObjectCount"
[code]for i=0, someStuff:GetPhysicsObjectCount() - 1 do[/code]
That was just for bone scaling.
[QUOTE=matrixninja;47761748][CODE]hook.Add("PlayerCanJoinTeam","CanJoin",function(ply,team)
if(team.GetPlayers(2) == 0) then
return false
else
return true
end
end );[/CODE]
That's what I have so far, what next? Still a bit confused.[/QUOTE]
I got it working. I simply changed the if statement to check the teams player count before continuing, don't know why I didn't think of that. Although, I'd like to implement a team full message, to let the player know why they couldn't join. How can I include it in the function I have?
What I have so far:
[CODE]local function TeamSwitch(ply,text)
text = string.lower(text)
if (string.sub(text,1) == "!juggernaut") and (team.NumPlayers(2) == 0) then
ply:SetTeam(2)
ply:Spawn()
ply:StripWeapons()
ply:Give("weapon_crowbar")
ply:SetWalkSpeed(50)
ply:SetRunSpeed(200)
ply:ChatPrint(ply:Nick().." Is the juggernaut!")
return true
end
return false
end
[/CODE]
Thanks for the help
having an annoying problem when testing some of my old hatshop code from late 2012.
when the client receives a list of hats, it creates a table of clientside models similar to PS, then in PostPlayerDraw it checks if the player is alive among other stuff and returns if not, or continues to draw hats if everything checks out.
the problem is something i dont understand, if i do for example [B]hat:SetNoDraw(true)[/B] when creating the model, there's a weird issue where hats will randomly change/flash all kinds of different colours depending on the distance from them.
if i set [B]hat:SetNoDraw(false)[/B], hats will be perfectly coloured but they stick around after people die.
this code used to work fine back in the day, is there some weird hack that needs to be done to get the colours to behave correctly? i'm not really doing anything different in rendering them from how PS does it.
[QUOTE=matrixninja;47768919]I got it working. I simply changed the if statement to check the teams player count before continuing, don't know why I didn't think of that. Although, I'd like to implement a team full message, to let the player know why they couldn't join. How can I include it in the function I have?
What I have so far:
[CODE]local function TeamSwitch(ply,text)
text = string.lower(text)
if (string.sub(text,1) == "!juggernaut") and (team.NumPlayers(2) == 0) then
ply:SetTeam(2)
ply:Spawn()
ply:StripWeapons()
ply:Give("weapon_crowbar")
ply:SetWalkSpeed(50)
ply:SetRunSpeed(200)
ply:ChatPrint(ply:Nick().." Is the juggernaut!")
return true
end
return false
end
[/CODE]
Thanks for the help[/QUOTE]
hu?
if !juggernaut and the value of team.NumPlayers( 2 ) is 0, then it sets team, spawn, give weapon, return true.
You have then:
end
return false
you could just put
else
ply:ChatPrint( "Team full" );
return false;
end
if() then
else
end
string.sub(text,1) == "whatever"
is the same as
text == "whatever"
Anyone know what the entity name of a door is?
[QUOTE=A Fghtr Pilot;47774929]Anyone know what the entity name of a door is?[/QUOTE]
prop_door_rotating
[QUOTE=LUModder;47774990]prop_door_rotating[/QUOTE]
Could be func_door also. The only "proper" way is to check the class name of the entity for "door".
MASK_WATER doesn't hit Slime / Sludge... but I'm looking for a mask that does. I ONLY want to detect water or sludge, and nothing else. Does one exist?
[QUOTE=WalkingZombie;47775884]MASK_WATER doesn't hit Slime / Sludge... but I'm looking for a mask that does. I ONLY want to detect water or sludge, and nothing else. Does one exist?[/QUOTE]
[lua]local mask = bit.bor(CONTENTS_SLIME, CONTENTS_WATER)[/lua]
[url]http://wiki.garrysmod.com/page/Enums/CONTENTS[/url]
What's the best way to check and see if the weapon is the same as the weapon being defined in a script?
I wanna check and see if the weapon in the script is currently in use. I usually did it with this
[code]self.Owner:GetActiveWeapon( ).PrintName == self.PrintName[/code]
but that seems like overkill.
[QUOTE=Luni;47776952][lua]local mask = bit.bor(CONTENTS_SLIME, CONTENTS_WATER)[/lua]
[url]http://wiki.garrysmod.com/page/Enums/CONTENTS[/url][/QUOTE]
I didn't need a link to the CONTENTS Enums, I already had that open :pwn: but... I wasn't aware I could do that, to make my own mask like that, so thank you.
EDIT: Using orthographic projection in the screenshot.
Any way to change what the camera see's when nothing is rendered? By default nothing is rendered black.
Any way to render the (un-rendered black) a different color or override what is rendered (or not) when nothing is rendered?
Example in a screenshot I just took: [url]http://puu.sh/hWczh/b8bbe4bb5c.jpg[/url]
[QUOTE=BlackMadd;47777626]EDIT: Using orthographic projection in the screenshot.
Any way to change what the camera see's when nothing is rendered? By default nothing is rendered black.
Any way to render the (un-rendered black) a different color or override what is rendered (or not) when nothing is rendered?
Example in a screenshot I just took: [url]http://puu.sh/hWczh/b8bbe4bb5c.jpg[/url][/QUOTE]
You could render the scene yourself onto a stencil, and do some magic with that?
[code]function SWEP:SetupDataTables( )
self:NetworkVar( "Int", 0, "Mode" );
self:NetworkVar( "Float", 0, "ModeSwitchTime" );
self:NetworkVar( "Float", 0, "Spread" );
self:NetworkVar( "Bool", false, "ReloadingStatus" ); -- true when reloading, false otherwise
self:NetworkVar( "Int", 0, "CrouchingStatus" ); --
self:NetworkVar( "Int", 0, "ClimbingStatus" ); -- 2 = ply is climbing, 1 = ply just started climbing, 0 = ply is not climbing, -1 = ply just stopped climbing
self:NetworkVar( "Int", 0, "SwimmingStatus" ); --
self:NetworkVar( "Vector", Vector( 0, 0, 0 ), "LastBulletCollisionVector" );
self:NetworkVar( "Float", Vector( 0, 0, 0 ), "FirstShotTime" );
self:NetworkVar( "Float", Angle( 0, 0, 0 ), "FirstShotAngle" );
self:NetworkVar( "Float", Vector( 0, 0, 0 ), "LastShotTime" );
end
function SWEP:StatusCheck( var, condition, verb )
if var == 1 and condition then
if GetConVar( "awb_debug" ):GetInt( ) == 3 and SERVER then
print( "2: "..self.Owner:Nick( ).." IS "..verb )
end
return 2
elseif var == 0 and condition then
if GetConVar( "awb_debug" ):GetInt( ) == 3 and SERVER then
print( "1: "..self.Owner:Nick( ).." STARTED "..verb )
end
return 1
elseif var == 2 and !condition then
if GetConVar( "awb_debug" ):GetInt( ) == 3 and SERVER then
print( "-1: "..self.Owner:Nick( ).." STOPPED "..verb )
end
return -1
elseif var == -1 and !condition then
if GetConVar( "awb_debug" ):GetInt( ) == 3 and SERVER then
print( "0: "..self.Owner:Nick( ).." IS NOT "..verb )
end
return 0
else
return var
end
end
function SWEP:MovementChecks( ) -- this is ran in think
self:SetClimbingStatus(
self:StatusCheck(
self:GetClimbingStatus( ),
( self.Owner:GetMoveType( ) == MOVETYPE_LADDER ),
"CLIMBING" )
)
self:SetCrouchingStatus(
self:StatusCheck(
self:GetCrouchingStatus( ),
( self.Owner:Crouching( ) ),
"CROUCHING" )
)
end[/code]
If I remove one of the last two set functions, the above works totally fine. However, having them both together causes each to break immensely.
[img]https://dl.dropboxusercontent.com/u/965202/ShareX/2015/05/2015-05-22_05-27-54.png[/img]
Why is this? I feel like it should uniquely respond to each.
[b]EDIT:[/b] Time to deduce the obvious with yours truly, since I wasn't getting it at all.
[quote]5:33 AM - Jvs: lmao
5:34 AM - Jvs: you know you're supposed to give different ids to networkvar functions right
5:34 AM - Jvs: those are not te default values
5:35 AM - wauterboi: I don't understand what you're saying
5:35 AM - Jvs: [url]http://wiki.garrysmod.com/page/Entity/NetworkVar[/url]
5:35 AM - Jvs: the second argument of networkvar is a slot
5:35 AM - Jvs: not a default value
5:35 AM - wauterboi: OH ahhahaha
5:35 AM - wauterboi: well then what the fuck at this stupid page on the wiki
5:35 AM - Jvs: your setclimbing and setcrouching are technically the same thing
5:35 AM - wauterboi: [url]http://wiki.garrysmod.com/page/Networking_Entities[/url]
5:35 AM - wauterboi: look at this
5:35 AM - Jvs: um no? where does it say that
5:35 AM - wauterboi: i looked at that and thought "okay cool i'll do that"
5:35 AM - wauterboi: hahaha
5:35 AM - Jvs: look at the vector one
5:35 AM - Jvs: they use different slots
5:36 AM - wauterboi: OH.
5:36 AM - Jvs: why would garry set a vector networkvar to a default value of 0
5:36 AM - Jvs: ya dummy
5:37 AM - wauterboi: thanks a ton, totally working now!
5:37 AM - Jvs: hf
[/quote]
[QUOTE=BlackMadd;47777626]EDIT: Using orthographic projection in the screenshot.
Any way to change what the camera see's when nothing is rendered? By default nothing is rendered black.
Any way to render the (un-rendered black) a different color or override what is rendered (or not) when nothing is rendered?
Example in a screenshot I just took: [url]http://puu.sh/hWczh/b8bbe4bb5c.jpg[/url][/QUOTE]
This should work if you call it before anything is drawn.
[url]http://wiki.garrysmod.com/page/render/Clear[/url]
Does anyone know of an easy way to check if there is a lockdown in DarkRP?
I have this code in lua/autorun/server but it causes this error:
[code]Disconnect: Client 0 overflowed reliable channel..[/code]
Code:
[code]
local function funcCallback(CVar, PreviousValue, NewValue)
print(CVar.." changed from "..PreviousValue.." to "..NewValue.."!")
end
cvars.AddChangeCallback("DarkRP_Lockdown", funcCallback)
[/code]
Any help would be much appreciated! =)
Sorry, you need to Log In to post a reply to this thread.