Player Models not appearing as ragdoll when killed.
8 replies, posted
Models don't show up as ragdolls when killed. They just vanish?
I have 2 models.. Duke Nukem and Michael Jordan. When Michael Jordan is killed, everything works fine. He's there and everything.
But when Duke Nukem gets killed he just vanishes. Everything is in the right order and the only console errors im getting for this is something related to Corpse.Lua
I looked into it and didn't come up with any solution.
L 10/15/2012 - 10:04:43: Lua Error: [gamemodes/terrortown/gamemode/corpse.lua:368] Model missing: models/jessev92/player/misc/dukenukem.mdl
[gamemodes/terrortown/gamemode/corpse.lua:368] Model missing: models/jessev92/player/misc/dukenukem.mdl
Here's my corpse.lua if you wanted to review it.
It says getmodel.. There's also an error in my console that it cannot find the model of Duke Nukem, although it works in game? Confused?
[B]It says error on line 368. Just CTRL + F if you wanna fine line 368. I edited it.[/B]
[CODE]---- Corpse functions
-- namespaced because we have no ragdoll metatable
CORPSE = {}
include("corpse_shd.lua")
--- networked data abstraction layer
local dti = CORPSE.dti
function CORPSE.SetFound(rag, state)
--rag:SetNWBool("found", state)
rag:SetDTBool(dti.BOOL_FOUND, state)
end
function CORPSE.SetPlayerNick(rag, ply_or_name)
-- don't have datatable strings, so use a dt entity for common case of
-- still-connected player, and if the player is gone, fall back to nw string
local name = ply_or_name
if ValidEntity(ply_or_name) then
name = ply_or_name:Nick()
rag:SetDTEntity(dti.ENT_PLAYER, ply_or_name)
end
rag:SetNWString("nick", name)
end
function CORPSE.SetCredits(rag, credits)
--rag:SetNWInt("credits", credits)
rag:SetDTInt(dti.INT_CREDITS, credits)
end
--- ragdoll creation and search
-- If detective mode, announce when someone's body is found
local bodyfound = CreateConVar("ttt_announce_body_found", "1")
local function IdentifyBody(ply, rag)
if not ply:IsTerror() then return end
-- simplified case for those who die and get found during prep
if GetRoundState() == ROUND_PREP then
CORPSE.SetFound(rag, true)
return
end
local finder = ply:Nick()
local nick = CORPSE.GetPlayerNick(rag, "")
local traitor = (rag.was_role == ROLE_TRAITOR)
-- Announce body
if bodyfound:GetBool() and not CORPSE.GetFound(rag, false) then
local roletext = nil
local role = rag.was_role
if role == ROLE_TRAITOR then
roletext = "body_found_t"
elseif role == ROLE_DETECTIVE then
roletext = "body_found_d"
else
roletext = "body_found_i"
end
LANG.Msg("body_found", {finder = finder,
victim = nick,
role = LANG.Param(roletext)})
end
-- Register find
if not CORPSE.GetFound(rag, false) then
-- will return either false or a valid ply
local deadply = player.GetByUniqueID(rag.uqid)
if deadply then
deadply:SetNWBool("body_found", true)
if traitor then
-- update innocent's list of traitors
SendConfirmedTraitors(GetInnocentFilter(false))
end
SCORE:HandleBodyFound(ply, deadply)
end
CORPSE.SetFound(rag, true)
else
-- re-set because nwvars are unreliable
--CORPSE.SetFound(rag, true)
--CORPSE.SetPlayerNick(rag, nick)
end
-- Handle kill list
for k, vicid in pairs(rag.kills) do
-- filter out disconnected
local vic = player.GetByUniqueID(vicid)
-- is this an unconfirmed dead?
if ValidEntity(vic) and (not vic:GetNWBool("body_found", false)) then
LANG.Msg("body_confirm", {finder = finder, victim = vic:Nick()})
-- update scoreboard status
vic:SetNWBool("body_found", true)
-- however, do not mark body as found. This lets players find the
-- body later and get the benefits of that
--local vicrag = vic.server_ragdoll
--CORPSE.SetFound(vicrag, true)
end
end
end
-- Covert identify concommand for traitors
local function IdentifyCommand(ply, cmd, args)
if not ValidEntity(ply) then return end
if #args != 2 then return end
local eidx = tonumber(args[1])
local id = tonumber(args[2])
if (not eidx) or (not id) then return end
if (not ply.search_id) or ply.search_id.id != id or ply.search_id.eidx != eidx then
ply.search_id = nil
return
end
ply.search_id = nil
local rag = Entity(eidx)
if ValidEntity(rag) and rag:GetPos():Distance(ply:GetPos()) < 128 then
if not CORPSE.GetFound(rag, false) then
IdentifyBody(ply, rag)
end
end
end
concommand.Add("ttt_confirm_death", IdentifyCommand)
-- Call detectives to a corpse
local function CallDetective(ply, cmd, args)
if not IsValid(ply) then return end
if #args != 1 then return end
if not ply:IsActive() then return end
local eidx = tonumber(args[1])
if not eidx then return end
local rag = Entity(eidx)
if IsValid(rag) and rag:GetPos():Distance(ply:GetPos()) < 128 then
if CORPSE.GetFound(rag, false) then
-- show indicator to detectives
SendUserMessage("corpse_call", GetDetectiveFilter(true), rag:GetPos())
LANG.Msg("body_call", {player = ply:Nick(),
victim = CORPSE.GetPlayerNick(rag, "someone")})
else
LANG.Msg(ply, "body_call_error")
end
end
end
concommand.Add("ttt_call_detective", CallDetective)
-- Send a usermessage to client containing search results
function CORPSE.ShowSearch(ply, rag, covert, long_range)
if not ValidEntity(ply) or not ValidEntity(rag) then return end
if rag:IsOnFire() then
LANG.Msg(ply, "body_burning")
return
end
-- init a heap of data we'll be sending
local nick = CORPSE.GetPlayerNick(rag)
local traitor = (rag.was_role == ROLE_TRAITOR)
local role = rag.was_role
local eq = rag.equipment or EQUIP_NONE
local c4 = rag.bomb_wire or -1
local dmg = rag.dmgtype or DMG_GENERIC
local wep = rag.dmgwep or ""
local words = rag.last_words or ""
local hshot = rag.was_headshot or false
local dtime = rag.time or 0
local owner = player.GetByUniqueID(rag.uqid)
owner = IsValid(owner) and owner:EntIndex() or -1
-- basic sanity check
if nick == nil or eq == nil or role == nil then return end
if DetectiveMode() and not covert then
IdentifyBody(ply, rag)
end
local credits = CORPSE.GetCredits(rag, 0)
if ply:IsActiveSpecial() and credits > 0 and (not long_range) then
LANG.Msg(ply, "body_credits", {num = credits})
ply:AddCredits(credits)
CORPSE.SetCredits(rag, 0)
ServerLog(ply:Nick() .. " took " .. credits .. " credits from the body of " .. nick .. "\n")
SCORE:HandleCreditFound(ply, nick, credits)
end
-- time of death relative to current time (saves bits)
if dtime != 0 then
dtime = math.Round(CurTime() - dtime)
end
-- identifier so we know whether a ttt_confirm_death was legit
ply.search_id = { eidx = rag:EntIndex(), id = rag:EntIndex() + dtime }
-- time of dna sample decay relative to current time
local stime = 0
if rag.killer_sample then
stime = math.max(0, rag.killer_sample.t - CurTime())
end
-- build list of people this traitor killed
local kill_entids = {}
for k, vicid in pairs(rag.kills) do
-- also send disconnected players as a marker
local vic = player.GetByUniqueID(vicid)
table.insert(kill_entids, IsValid(vic) and vic:EntIndex() or -1)
end
local lastid = -1
if rag.lastid and ply:IsActiveDetective() then
-- if the person this victim last id'd has since disconnected, send -1 to
-- indicate this
lastid = IsValid(rag.lastid.ent) and rag.lastid.ent:EntIndex() or -1
end
-- If found by detective, send to all, else just the finder
Well, I don't know shit but lets see if I can lend a hand.
Stupid questions first, the model actually is on the server, right? Yeah, I thought so. No offense, I told you it was a stupid question lol
Now about the game itself, is this being run on a linux server? Because if it is, remember that linux is case sensitive, and windows isnt. So, just for fun, check to make sure that the line that sets the player model has the file path capitalized correctly. if you're using the addon I just checked, JesseV92 is the correct capitals.
Alternatively, you could see what happens if you rename the folder JesseV92 to jessev92. But first, check the caps in the setmodel line.
[QUOTE=me-name-bob;38052574]Well, I don't know shit but lets see if I can lend a hand.
Stupid questions first, the model actually is on the server, right? Yeah, I thought so. No offense, I told you it was a stupid question lol
Now about the game itself, is this being run on a linux server? Because if it is, remember that linux is case sensitive, and windows isnt. So, just for fun, check to make sure that the line that sets the player model has the file path capitalized correctly. if you're using the addon I just checked, JesseV92 is the correct capitals.
Alternatively, you could see what happens if you rename the folder JesseV92 to jessev92. But first, check the caps in the setmodel line.[/QUOTE]
Tried the case sensitive thing. Also the server can't find the model. Even though the model works.
Also.. There's an error on line 24 for why the model isn't registering.
[url]http://pastebin.com/G2gph5YM[/url]
[QUOTE=Joobie;38052749]Tried the case sensitive thing. Also the server can't find the model. Even though the model works.[/QUOTE]
Weird. Well dammit. Is this a dedicated server, or is it you hosting on your own machine? This error is showing up serverside only, right?
The model you are trying to set as a ragdoll is made for players - and only players, thus cant be used as a ragdoll. You'll have to find a ragdolled version of it to be able to carry out what you are currently trying. There's nothing else you can do as far as I am aware.
[QUOTE=me-name-bob;38052794]Weird. Well dammit. Is this a dedicated server, or is it you hosting on your own machine? This error is showing up serverside only, right?[/QUOTE]
This is a rented server from elpishost.com
[QUOTE=Joobie;38052815]This is a rented server from elpishost.com[/QUOTE]
Well, I'm stuck. Dizla is probably right, but i would think that the model would be standing in a T position if it werent for ragdolls.
gonna test something, brb
EDIT: in the mean time, is this gm 12 or 13 beta?
[QUOTE=me-name-bob;38052848]Well, I'm stuck. Dizla is probably right, but i would think that the model would be standing in a T position if it werent for ragdolls.
gonna test something, brb
EDIT: in the mean time, is this gm 12 or 13 beta?[/QUOTE]
Dizla was right. I ragdolled myself and nothing happened. Thanks for the responses guys.
Well, sorry I couldn't help any more. I still think theres a way to get it working. Ther4es no way you'll let me ftp into your server, is there? haha
better luck next time i guess
Sorry, you need to Log In to post a reply to this thread.