SetModel animation graph crash in build 240

jfmherokillerjfmherokiller Join Date: 2012-12-18 Member: 175408Members
edited March 2013 in Modding
can anyone please explain why externally calling the function
WhateverClass:SetModel(whatever-valid-model,whatever-valid-animgraph)
causes a crash
yet externally calling
WhateverClass:SetModel(whatever-valid-model)
works and externally calling
WhateverClass:SetModel(whatever-valid-model,whatever-valid-animgraph)
works after refreshing the lua file?
I mean I can refresh the file if I have to but is annoying when you must add/remove something (like a space) just so that you can set the animation graph of the model.
In the versions before 240 this worked fine now it causes the game to crash to desktop.

I call this function from a server command
with code similar to this
local function wtf3(client)
local player = client:GetControllingPlayer()
local oooo = PrecacheAsset("models/alien/shade/shade.model")
local oooe = PrecacheAsset("models/alien/shade/shade.animation_graph")
player:SetModel(oooo,oooe) // causes crash
//player:SetModel(oooo) // does not cause crash
end
Event.Hook("Console_twtf3", wtf3)

Comments

  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Are there any errors? Look at %appdata%/NaturalSelection2/ then the oldest log.txt .
  • jfmherokillerjfmherokiller Join Date: 2012-12-18 Member: 175408Members
    edited March 2013
    the only errors I get are
    Error: Precaching may only be done before the map is loaded ('models/alien/tunnel/mouth.model')
    Error: Precaching may only be done before the map is loaded ('models/props/generic/generic_crate_01.model')
    Error: Precaching may only be done before the map is loaded ('models/alien/tunnel/mouth.animation_graph')
    
    that is normal since those errors were seen before 240 and did not cause any problems.
    those errors do not cause the crash either.
    The ones above are the only errors in the log.
    The error stems from somewhere in the engine. where they changed how the animation_graph is loaded.
    The only possibly helpful thing may be the minidump which is created on each crash but after examining its just a memory access error.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    use Shared.PrecacheAnimationGraph(graphName)
  • jfmherokillerjfmherokiller Join Date: 2012-12-18 Member: 175408Members
    yep that worked thanks.
Sign In or Register to comment.