"Nan" error compiling Models for Insurgency 2

Hey everyone,

Loathe though I am for people to make threads everytime they run into an issue - I have been banging my head against this roadblock for the past 3 hours, so I thought I’d at least see if anyone else has run into it before, my Googlefu isn’t pointing to any obvious answers.

I’ve modeled an edited weapon mesh for Insurgency 2, and exported it out of blender, but when I go to compile it either with via the command line, or Crowbar, I get this error log:

Inspecting the .qc does show that there is indeed a “NaN” value at that break, but I have no clue what to change it to. The .qc is from the decompile of the origional, out of the .vpk. Should I just use a generic .qc? I havn’t tried it so far, as I assume I need all these sequences for it the function correctly. Or is the “NaN” just an incorrect translation on the behalf of the decompiler? I couldn’t find any references to it in my .qc commands dictionary.

Anyway, here’s hoping someone’s seen this sort of thing before.

NaN means Not a Number, which is an error it throws when it’s expecting a number in a certain place, but finds something else. Common programmer term.
Try changing NaN in that part of the .QC to just 0 or something, like the above event.

Yeah I know, I’ve done some C++

But changing that one NaN throws up another further along, and a third after that. At that point I’m beginning to feel it’s either a systematic translation error on the behalf of the decompiler, or the models were origionally compiled with something different, which dosn’t throw a fatal at NaN values.

Thanks for the speedy response though :slight_smile:

Welp I was sucessfully able to compile the model by changing those three NaN’s to 0’s - but now when I open it up in the model viewer, it’s not showing any of the geometry that I’ve created. Instead it’s just the origional base weapon I was working off of.

Which makes absolutley zero sense to me, as I’ve decompiled my compile and loaded it back into blender, and the geometry is still there, all vertex groups accounted for.

Is there something obvious I’m missing? I was under the impression only the Studiomdl defined the geometry.

Nevermind, using the Hl2 modelviewer (not the Insurgency one) - and compiling the .qc from blender instead of via crowbar seems to worked.

Welp, turns out some of the animations arn’t functioning correctly in-game. The ironsight transition for the red dot sight and foregrip aren’t working - and as the three “NaN” values I changed were in lines headed “iron_foregrip” and “iron” - I get the feeling they might have something to do with it.

I’m going to try decompiling it with something other than crowbar to see if I can get a .qc without the 'NaN’s - just posting to warn anyone else who may be attempting to mess about with the Insurgency 2 weapon models.