lmao that has to be the biggest troll i've ever seen
i'm honestly impressed
I still got my shitty title from about 6 months ago I believe.
[QUOTE=rebel1324;44163709]Oh what the hell, I liked my freaking title[/QUOTE]
what was your title
Is there a specific type of model that NS uses? I attempted to use a few model packs, but only a few work. For example, [url=http://steamcommunity.com/sharedfiles/filedetails/?id=137387663]this[/url].
I added
nut.anim.SetModelClass( "models/metro2033/nikout/player/ranger2.mdl", "citizen_male), and a few other variants of that to try to get it work. The models/metro2033/nikout/ranger.mdl model works, however.
Im assuming that means NS doesn't use player models; is there any way to convert them over?
Yea, that's what I did.
"nut.anim.SetModelClass( "models/metro2033/nikout/player/ranger2.mdl", "citizen_male)" in my sh_schema.lua
I tried all of them. Do these update automatically or do I have to restart the server?
Autorefresh only works on Windows, Garry hasn't made it available for Linux.
I can't tell if you're forgetting another parentheses after male because it's "citizen_male", not "citizen_male
Im using windows, and no, I didn't forget that, just failed to copy it.
Wait, should I be using \ instead of / ?
edit: nope
The model has /player/ in it so it seems like it's a player model.
At the moment, I'm trying
nut.anim.SetModelClass("models/avoxgaming/mrp/jake/guard.mdl", "citizen_male")
Still doesn't work
after updating the script it now displays the notices when you pick up a weapon or ammo and also shows the names and health of a player like in sandbox. it also shows the messages that tell you "x has killed xnpc with xweapon"
is this the server or the script, and if it is the script, how can i fix it?
Well it seems anyone with a significant post count in this thread has their title changed. I don't know what's worse, the one lemonpunch gave me or this new one.
Annyways on topic, any development I've been doing has been postponed due to work. Hopefully I'll get a day to power through some code and possibly release some screenshots.
Okay, this is my code for a first person plugin (Made by Spy)
[CODE]PLUGIN.name = "Immersive First Person"
PLUGIN.author = "Spy ( http://steamcommunity.com/id/ifenerv )"
PLUGIN.desc = "Add's realistic head movement and first person with legs & chest."
if (CLIENT) then
CreateClientConVar("iv_status", "1", true, true)
CreateClientConVar("iv_viewsmooth", "0.2", true, true)
-- Crosshair
CreateClientConVar("iv_crosshair", "1", true, true)
CreateClientConVar("iv_in_r", "255", true, true)
CreateClientConVar("iv_in_g", "255", true, true)
CreateClientConVar("iv_in_b", "255", true, true)
CreateClientConVar("iv_in_a", "150", true, true)
CreateClientConVar("iv_out_r", "0", true, true)
CreateClientConVar("iv_out_g", "0", true, true)
CreateClientConVar("iv_out_b", "0", true, true)
CreateClientConVar("iv_out_a", "125", true, true)
-- Anti-clipping measures
CreateClientConVar("iv_znear", "0.4", true, true)
CreateClientConVar("iv_pitchlock", "1", true, true)
CreateClientConVar("iv_pitchlock_max", "82", true, true)
local ViewOffsetUp = 0
local ViewOffsetForward = 3
local ViewOffsetForward2 = 0
local ViewOffsetLeftRight = 0
local RollDependency = 0.1
local CurView = nil
local holdType
local traceHit = false
local eyeAt, forwardVec, FT, EA, wep, ply
local view = {}
local function IFPP_ShouldDrawLocalPlayer()
if GetConVarNumber("iv_status") > 0 then
if (not traceHit and not LocalPlayer():InVehicle()) or not traceHit then
return true
end
end
end
hook.Add("ShouldDrawLocalPlayer", "IFPP_ShouldDrawLocalPlayer", IFPP_ShouldDrawLocalPlayer)
local mapp, mclamp = math.Approach, math.Clamp
local FVec = Vector(0, 0, 0)
local function FirstPersonPerspective(ply, pos, angles, fov)
eyeAtt = ply:GetAttachment(ply:LookupAttachment("eyes"))
forwardVec = ply:GetAimVector()
FT = FrameTime()
EA = ply:EyeAngles()
wep = ply:GetActiveWeapon()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() or (traceHit and not ply:InVehicle()) or not eyeAtt then
return
end
if not CurView then
CurView = angles
else
CurView = LerpAngle(mclamp(FT * (35 * (1 - mclamp(GetConVarNumber("iv_viewsmooth"), 0, 0.8))), 0, 1), CurView, angles + Angle(0, 0, eyeAtt.Ang.r * RollDependency))
end
if IsValid(wep) then
holdType = wep:GetHoldType()
else
holdType = "normal"
end
if holdType then
if holdType == "smg" or holdType == "ar2" or holdType == "rpg" then
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, -1, 0.5)
else
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, 0, 0.5)
end
else
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, 0, 0.5)
end
if ply:WaterLevel() >= 3 then
ViewOffsetUp = mapp(ViewOffsetUp, 0, 0.5)
ViewOffsetForward = mapp(ViewOffsetForward, 8, 0.5)
RollDependency = Lerp(mclamp(FT * 15, 0, 1), RollDependency, 0.15)
else
ViewOffsetUp = mapp(ViewOffsetUp, mclamp(EA.p * -0.1, 0, 10), 0.5)
ViewOffsetForward = mapp(ViewOffsetForward, 2 + mclamp(EA.p * 0.1, 0, 5), 0.5)
RollDependency = Lerp(mclamp(FT * 15, 0, 1), RollDependency, 0.05)
end
if ply:InVehicle() then
ViewOffsetForward2 = 2
else
ViewOffsetForward2 = 0
end
if eyeAtt then
FVec.x = forwardVec.x * (ViewOffsetForward + ViewOffsetForward2)
FVec.y = forwardVec.y * (ViewOffsetForward + ViewOffsetForward2)
FVec.z = ViewOffsetUp
FVec = FVec + ply:GetRight() * ViewOffsetLeftRight
view.origin = eyeAtt.Pos + FVec
view.angles = CurView
view.fov = fov
view.znear = mclamp(GetConVarNumber("iv_znear"), 0.1, 1)
return GAMEMODE:CalcView(ply, view.origin, view.angles, view.fov, view.znear)
end
end
hook.Add("CalcView", "FirstPersonPerspective", FirstPersonPerspective)
local IN_R, IN_G, IN_B, IN_A, OUT_R, OUT_G, OUT_B, OUT_A, tr, pos
local td = {}
local function IFPP_DotCrosshair()
if GetConVarNumber("iv_crosshair") < 1 then
return
end
ply = LocalPlayer()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() or traceHit then
return
end
IN_R = GetConVarNumber("iv_in_r")
IN_G = GetConVarNumber("iv_in_g")
IN_B = GetConVarNumber("iv_in_b")
IN_A = GetConVarNumber("iv_in_a")
OUT_R = GetConVarNumber("iv_out_r")
OUT_G = GetConVarNumber("iv_out_g")
OUT_B = GetConVarNumber("iv_out_b")
OUT_A = GetConVarNumber("iv_out_a")
td.start = ply:GetShootPos()
td.endpos = td.start + ply:GetAimVector() * 3000
td.filter = ply
tr = util.TraceLine(td)
pos = tr.HitPos:ToScreen()
surface.SetDrawColor(OUT_R, OUT_G, OUT_B, OUT_A)
surface.DrawRect(pos.x - 2, pos.y - 1, 5, 5)
surface.SetDrawColor(IN_R, IN_G, IN_B, IN_A)
surface.DrawRect(pos.x - 1, pos.y, 3, 3)
end
hook.Add("HUDPaint", "IFPP_DotCrosshair", IFPP_DotCrosshair)
local function IFPP_PrePlayerDraw(pl)
ply = LocalPlayer()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() then
return
end
EA = ply:GetRenderAngles()
EA.y = ply:EyeAngles().y
ply:SetRenderAngles(EA)
ply:SetPoseParameter("aim_yaw", 0.5)
ply:SetPoseParameter("body_yaw", 0.5)
ply:SetPoseParameter("head_yaw", 0.5)
end
hook.Add("PrePlayerDraw", "PrePlayerDraw", IFPP_PrePlayerDraw)
local Vec001, Vec1 = Vector(0.001, 0.001, 0.001), Vector(1, 1, 1)
local function IFPP_Think()
ply = LocalPlayer()
if not ply:Alive() then
return
end
if GetConVarNumber("iv_status") > 0 then
ply:ManipulateBoneScale(ply:LookupBone("ValveBiped.Bip01_Head1"), Vector(0,0,1))
if eyeAtt then
forwardVec = ply:GetAimVector()
forwardVec.z = 0 -- by getting only the X and Y values, I can get what's ahead of the player, and not up/down, because other methods seem to fail.
td.start = eyeAtt.Pos
td.endpos = td.start + forwardVec * 20
td.filter = ply
tr = util.TraceLine(td)
if tr.Hit then
traceHit = true
else
traceHit = false
end
end
else
ply:ManipulateBoneScale(ply:LookupBone("ValveBiped.Bip01_Head1"), Vec1)
end
end
hook.Add("Think", "IFPP_Think", IFPP_Think)
local function IFPP_SetupMove(ucmd)
if GetConVarNumber("iv_status") <= 0 or GetConVarNumber("iv_pitchlock") <= 0 or not LocalPlayer():Alive() then
return
end
EA = ucmd:GetViewAngles()
ucmd:SetViewAngles(Angle(math.min(EA.p, mclamp(GetConVarNumber("iv_pitchlock_max"), 82, 82)), EA.y, EA.r))
end
hook.Add("CreateMove", "IFPP_SetupMove", IFPP_SetupMove)
end[/CODE]
Can anyone help me to make it so it ONLY runs when a player spawns on their char so it doesn't create a ton of script errors?
Why are you using hook.Add when you can do function PLUGIN:HookName() like you're suppose to?
[QUOTE=Chessnut;44171995]Why are you using hook.Add when you can do function PLUGIN:HookName() like you're suppose to?[/QUOTE]
Whoops, I'll change that quickly.
EDIT:
HookName has to be replaced by the first thing in the hook brackets correct?
EDIT:
Uhm, how do I do it. My errors tell me that im doing somthing clearly wrong and stupid. So how do I use PLUGIN:HookName() ? :S
No just the hook name I guess.
So for example:
[lua]
function PLUGIN:OnEntityCreated(ent)
--do stuff
end
[/lua]
[QUOTE=LennyPenny;44172061]No just the hook name I guess.
So for example:
[lua]
function PLUGIN:OnEntityCreated(ent)
--do stuff
end
[/lua][/QUOTE]
Oh, I think I get it now. Thanks
[editline]8th March 2014[/editline]
Just so I don't waste my time, I want to see if this is right.
[CODE]
function PLUGIN:HookName()
hook.Add("ShouldDrawLocalPlayer", "IFPP_ShouldDrawLocalPlayer", IFPP_ShouldDrawLocalPlayer)
end
[/CODE]
EDIT:
Wait, functions dont work on [CODE]if (CLIENT) then[/CODE] lua files do they?
EDIT (again...):
A friend helped me to get it working. And I think I might be able to do what I was trying to do before now.
I can confirm that Nutscript is the reason my model wasn't working, not my client. As you said, Chessnut,
"nut.anim.SetModelClass("models/devcon/mrp/act/guard.mdl", "citizen_male")" is in my sh_schema.lua, and I put in the exact files I sent to you. The model works perfectly on Clockwork and other gamemodes; is there any other possible way to fix it?
Okay this is my lua file now
[LUA]PLUGIN.name = "Immersive First Person"
PLUGIN.author = "Spy ( [url]http://steamcommunity.com/id/ifenerv[/url] )"
PLUGIN.desc = "Add's realistic head movement and first person with legs & chest."
if (CLIENT) then
function PLUGIN:PlayerSpawn(client)
CreateClientConVar("iv_status", "1", true, true)
CreateClientConVar("iv_viewsmooth", "0.2", true, true)
-- Crosshair
CreateClientConVar("iv_crosshair", "1", true, true)
CreateClientConVar("iv_in_r", "255", true, true)
CreateClientConVar("iv_in_g", "255", true, true)
CreateClientConVar("iv_in_b", "255", true, true)
CreateClientConVar("iv_in_a", "150", true, true)
CreateClientConVar("iv_out_r", "0", true, true)
CreateClientConVar("iv_out_g", "0", true, true)
CreateClientConVar("iv_out_b", "0", true, true)
CreateClientConVar("iv_out_a", "125", true, true)
-- Anti-clipping measures
CreateClientConVar("iv_znear", "0.4", true, true)
CreateClientConVar("iv_pitchlock", "1", true, true)
CreateClientConVar("iv_pitchlock_max", "82", true, true)
local ViewOffsetUp = 0
local ViewOffsetForward = 3
local ViewOffsetForward2 = 0
local ViewOffsetLeftRight = 0
local RollDependency = 0.1
local CurView = nil
local holdType
local traceHit = false
local eyeAt, forwardVec, FT, EA, wep, ply
local view = {}
local function IFPP_ShouldDrawLocalPlayer()
if GetConVarNumber("iv_status") > 0 then
if (not traceHit and not LocalPlayer():InVehicle()) or not traceHit then
return true
end
end
end
function PLUGIN:HookName()
hook.Add("ShouldDrawLocalPlayer", "IFPP_ShouldDrawLocalPlayer", IFPP_ShouldDrawLocalPlayer)
end
PLUGIN:HookName()
local mapp, mclamp = math.Approach, math.Clamp
local FVec = Vector(0, 0, 0)
local function FirstPersonPerspective(ply, pos, angles, fov)
eyeAtt = ply:GetAttachment(ply:LookupAttachment("eyes"))
forwardVec = ply:GetAimVector()
FT = FrameTime()
EA = ply:EyeAngles()
wep = ply:GetActiveWeapon()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() or (traceHit and not ply:InVehicle()) or not eyeAtt then
return
end
if not CurView then
CurView = angles
else
CurView = LerpAngle(mclamp(FT * (35 * (1 - mclamp(GetConVarNumber("iv_viewsmooth"), 0, 0.8))), 0, 1), CurView, angles + Angle(0, 0, eyeAtt.Ang.r * RollDependency))
end
if IsValid(wep) then
holdType = wep:GetHoldType()
else
holdType = "normal"
end
if holdType then
if holdType == "smg" or holdType == "ar2" or holdType == "rpg" then
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, -1, 0.5)
else
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, 0, 0.5)
end
else
ViewOffsetLeftRight = mapp(ViewOffsetLeftRight, 0, 0.5)
end
if ply:WaterLevel() >= 3 then
ViewOffsetUp = mapp(ViewOffsetUp, 0, 0.5)
ViewOffsetForward = mapp(ViewOffsetForward, 8, 0.5)
RollDependency = Lerp(mclamp(FT * 15, 0, 1), RollDependency, 0.15)
else
ViewOffsetUp = mapp(ViewOffsetUp, mclamp(EA.p * -0.1, 0, 10), 0.5)
ViewOffsetForward = mapp(ViewOffsetForward, 2 + mclamp(EA.p * 0.1, 0, 5), 0.5)
RollDependency = Lerp(mclamp(FT * 15, 0, 1), RollDependency, 0.05)
end
if ply:InVehicle() then
ViewOffsetForward2 = 2
else
ViewOffsetForward2 = 0
end
if eyeAtt then
FVec.x = forwardVec.x * (ViewOffsetForward + ViewOffsetForward2)
FVec.y = forwardVec.y * (ViewOffsetForward + ViewOffsetForward2)
FVec.z = ViewOffsetUp
FVec = FVec + ply:GetRight() * ViewOffsetLeftRight
view.origin = eyeAtt.Pos + FVec
view.angles = CurView
view.fov = fov
view.znear = mclamp(GetConVarNumber("iv_znear"), 0.1, 1)
return GAMEMODE:CalcView(ply, view.origin, view.angles, view.fov, view.znear)
end
end
function PLUGIN:HookName()
hook.Add("CalcView", "FirstPersonPerspective", FirstPersonPerspective)
end
PLUGIN:HookName()
local IN_R, IN_G, IN_B, IN_A, OUT_R, OUT_G, OUT_B, OUT_A, tr, pos
local td = {}
local function IFPP_DotCrosshair()
if GetConVarNumber("iv_crosshair") < 1 then
return
end
ply = LocalPlayer()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() or traceHit then
return
end
IN_R = GetConVarNumber("iv_in_r")
IN_G = GetConVarNumber("iv_in_g")
IN_B = GetConVarNumber("iv_in_b")
IN_A = GetConVarNumber("iv_in_a")
OUT_R = GetConVarNumber("iv_out_r")
OUT_G = GetConVarNumber("iv_out_g")
OUT_B = GetConVarNumber("iv_out_b")
OUT_A = GetConVarNumber("iv_out_a")
td.start = ply:GetShootPos()
td.endpos = td.start + ply:GetAimVector() * 3000
td.filter = ply
tr = util.TraceLine(td)
pos = tr.HitPos:ToScreen()
surface.SetDrawColor(OUT_R, OUT_G, OUT_B, OUT_A)
surface.DrawRect(pos.x - 2, pos.y - 1, 5, 5)
surface.SetDrawColor(IN_R, IN_G, IN_B, IN_A)
surface.DrawRect(pos.x - 1, pos.y, 3, 3)
end
function PLUGIN:HookName()
hook.Add("HUDPaint", "IFPP_DotCrosshair", IFPP_DotCrosshair)
end
PLUGIN:HookName()
local function IFPP_PrePlayerDraw(pl)
ply = LocalPlayer()
if GetConVarNumber("iv_status") < 1 or not ply:Alive() then
return
end
EA = ply:GetRenderAngles()
EA.y = ply:EyeAngles().y
ply:SetRenderAngles(EA)
ply:SetPoseParameter("aim_yaw", 0.5)
ply:SetPoseParameter("body_yaw", 0.5)
ply:SetPoseParameter("head_yaw", 0.5)
end
function PLUGIN:HookName()
hook.Add("PrePlayerDraw", "PrePlayerDraw", IFPP_PrePlayerDraw)
end
PLUGIN:HookName()
local Vec001, Vec1 = Vector(0.001, 0.001, 0.001), Vector(1, 1, 1)
local function IFPP_Think()
ply = LocalPlayer()
if not ply:Alive() then
return
end
if GetConVarNumber("iv_status") > 0 then
ply:ManipulateBoneScale(ply:LookupBone("ValveBiped.Bip01_Head1"), Vector(0,0,1))
if eyeAtt then
forwardVec = ply:GetAimVector()
forwardVec.z = 0 -- by getting only the X and Y values, I can get what's ahead of the player, and not up/down, because other methods seem to fail.
td.start = eyeAtt.Pos
td.endpos = td.start + forwardVec * 20
td.filter = ply
tr = util.TraceLine(td)
if tr.Hit then
traceHit = true
else
traceHit = false
end
end
else
ply:ManipulateBoneScale(ply:LookupBone("ValveBiped.Bip01_Head1"), Vec1)
end
end
function PLUGIN:HookName()
hook.Add("Think", "IFPP_Think", IFPP_Think)
end
PLUGIN:HookName()
local function IFPP_SetupMove(ucmd)
if GetConVarNumber("iv_status") <= 0 or GetConVarNumber("iv_pitchlock") <= 0 or not LocalPlayer():Alive() then
return
end
EA = ucmd:GetViewAngles()
ucmd:SetViewAngles(Angle(math.min(EA.p, mclamp(GetConVarNumber("iv_pitchlock_max"), 82, 82)), EA.y, EA.r))
end
function PLUGIN:HookName()
hook.Add("CreateMove", "IFPP_SetupMove", IFPP_SetupMove)
end
PLUGIN:HookName()
end
end[/LUA]
However, PLUGIN:PlayerSpawn isn't calling. If I add PLUGIN:PlayerSpawn() after the first end at the bottom it does call, but not when I spawn. Any help?
Well, false alarm. The models weren't t posing, it was just the character select menu throwing me off.
....
camera tool
all i have to say
It seems anyone can spawn weapons from entities and the weapons menu even if they don't have pet
[QUOTE=amjugan;44173011]It seems anyone can spawn weapons from entities and the weapons menu even if they don't have pet[/QUOTE]
Can't replicate.
[QUOTE=amjugan;44173011]It seems anyone can spawn weapons from entities and the weapons menu even if they don't have pet[/QUOTE]
Have you installed it correctly? When playing on mine and chessnuts test servers (separately) I never had this issue.
It was fun having you on our server Chessnut. We were really surprised, haha.
[QUOTE=Blazer232;44169160]after updating the script it now displays the notices when you pick up a weapon or ammo and also shows the names and health of a player like in sandbox. it also shows the messages that tell you "x has killed xnpc with xweapon"
is this the server or the script, and if it is the script, how can i fix it?[/QUOTE]
pls help
Did you update?
[QUOTE=Blazer232;44174751]pls help[/QUOTE]
You know there is a [URL="http://chessnut.info/support/"]support section[/URL] on [URL="http://chessnut.info/"]Chessnuts website[/URL].
[QUOTE=Chessnut;44175344]Did you update?[/QUOTE]
Yes, that is the cause of the issue.
Unless there was some other update that I missed that is more recent?
When was the last time you updated?
Sorry, you need to Log In to post a reply to this thread.