Welcome to PlagueFest.com! Log in or Sign up to interact with the Plague Fest community.
  1. Welcome Guest! to interact with the community and gain access to all the site's features.

Trouble with STUDIOMDL

Discussion in Mapping Discussion started by llVeXXll, Aug 5, 2012

  1. Jun 18, 2012
    Posts
    Hi all ok so I have a model in .3ds format which I opened with Blender and installed the addon script to export it to a .smd format. I set the VPROJECT or game directory path correctly in GUISTUDIOMDL (counterstrike global offensive\bin) I have then created a .qc file and saved it in the same place as the .smd and with the same name. The .qc file reads as follows:

    $modelname"piano.mdl"
    $body mybody"piano-ref.smd"
    $staticprop
    $surfacepropcombine_metal
    $cdmaterials"models"

    $sequence idle"piano-ref.smd"

    $collisionmodel"piano-phys.smd" { $concave }

    (Yes I want the model to be in the root of the cs go\models folder just to keep things simple for now, and yes I want the material to be in the root of materials\models).

    Then I'm trying to load the QC file into GUISTUDIOMDL to try and compile it for use in Hammer. Here's the error log I'm getting:

    Working on "piano.qc"
    ERROR: c:\program files (x86)\steam\steamapps\common\counter-strike global offensive\csgo\models\piano.qc(2): - could not load file 'piano-ref.smd'
    ERROR: Aborted Processing on 'piano.mdl'
    WARNING: Leaking 1 elements

    I have no idea what is going on here as this is all new to me so if there's anything I have/ havent done that is wrong please can you let me know and help me out? thanks!
  2. Apr 9, 2012
    Posts
    Currently I have no idea if there would be any changes (somehow) for models regarding CS:GO which I'm fairly sure there aren't any, but so far the only thing I could explain is that you also have a leaking element in your model. I can only say that it won't prohibit the model for compiling but it's not a good sign in any case. Are you also sure that your piano there isn't too high-poly? I could imagine every key on the piano being a seperate block, massivly adding so many poly's that Source wouldn't really be able to render in any optimised way...

    So far that I could make something out of this, you either:

    - Didn't smoothed the model at all, which is required for Source models to work properly, or
    - Your 'piano-ref.smd' is just not there where the .qc is located

    However just to make clear, I have 0 experience regarding Blender and their exporting scripts and such, I use 3DS Max for that, and that's why I won't be the right person to solve this problem.
  3. Feb 24, 2011
    Posts
    (Missing $cd ALTHOUGH that shouldn't be an issue if you have all the files in the same folder)
    $modelname"piano.mdl"
    $body mybody"piano-ref.smd"
    $staticprop
    $surfacepropcombine_metal (isn't there supposed to be a space between "surfaceprop" and "combine_metal" ?)
    $cdmaterials"models"

    $sequence idle"piano-ref.smd"

    $collisionmodel"piano-phys.smd" { $concave } (i suppose you have "piano-phys.smd" in the same folder along with the .QC and "piano-ref.smd. you could always try to compile without this)

    (I'm not sure if it's really an issue or not, but it feels like you've been missing a whole bunch of spaces here and there)

    Feel free to copy+paste this, replacing your own text before giving it another compile, if it doesn't work just revert it.
    Beware though, i'm not that experienced within this, i'm just going from things i feel suspicious about.

    $modelname "piano.mdl"
    $body "mybody" "piano-ref.smd"
    $staticprop
    $surfaceprop "combine_metal"
    $cdmaterials "models\"

    $sequence "idle" "piano-ref.smd"
  4. Apr 9, 2012
    Posts
    Indeed I didn't even noticed that! Lol nice Luffaren.

    ------------------------

    However even more things:


    $collisionmodel"piano-phys.smd" { $concave }
    Could become (for easier overview, and plz space the "'s from the commands or else it may not work):

    $collisionmodel "piano-phys.smd"
    {

    $concave

    }


    Please note that IF you made the collision model yourself, it might be that the collision model has either become corrupt (not likely to be) or also NOT smoothed. If it isn't smoothed, it will give yellow error command lines and thus make the entire collisionmodel one convex piece... As a piano it would'nt really matter this way, but it would be nice to have the collision model work properly)
    -------------------------

    Also, as Luffaren says, $surfacepropcombine_metal

    Should become:

    $surfaceprop "combine_metal" (Why in the world does a piano has to be made from metal? Make it wood instead, offering logical realism (I'm a pianist myself))


    -------------------------

    All sequences, even the idle one, have to have fps! Else it won't work:

    $sequence "idle" "piano-ref.smd"
    Should become:

    $sequence "idle" "piano-ref.smd" loop fps 30
    Post Merged, Aug 6, 2012

    Luffaren you are right, don't worry. He/She missed a lot of spaces, which is completely normal because honestly the Valve QC commands are terribly inaccurate and very confusing. I don't blame ||Vexx|| at all ^^
  5. Apr 9, 2012
    Posts
    Also,

    $body mybody"piano-ref.smd"
    Should become:

    $body mybody "piano-ref.smd"
  6. Jun 18, 2012
    Posts
    Oh god, I don't know where to start, I have no idea whether the polygon count is too high because I don't know how to USE 3d modeling software. I downloaded the piano off a free website, all i did was bring it into blender to change it from .3ds to .smd (using the smd plugin) I can't see how a model can be leaked either. The only file that I have is piano.smd, i don't have any of those other things, piano-ref.smd piano-phys etc I feel I am missing lots of knowledge here. I don't know the first thing about QC files or how they should read. I really need someone to help me step by step on this one I think. :frown:
  7. Mar 26, 2009
    Posts
    You should use guistudiomdl, it's a front end to studiomdl and stops you from making mistakes on the command line. Just point it to where studiomdl is and it will do the rest.

    http://www.wunderboy.org/apps/guistudiomdl2.php

    As for your model, you shouldn't store the source to the models in the folder where the compiled model is going to be stored.

    Here's a fixed QC script that should work:

    Code:
    $modelname "piano.mdl"
    $cdmaterials "models"
    
    $scale 1
    $surfaceprop "metal"
    
    $body "Body" "piano-ref.smd"
    
    $sequence "idle" "piano-ref.smd" fps 30
    
    $collisionmodel "piano-phys.smd"
    {
    	$mass 100
    	$concave
    }
    
    As for the poly count, you can go up to around 30,000 without any trouble, but rendering it in-game will cause bad performance problems.
  8. Jun 18, 2012
    Posts

    I think I have not explained myself properly. I AM using guistudiomdl. I am stuck on the bit that comes BEFORE this that you have just explained to me (but thankyou anyway) I am only able to export 1 smd, thats just the normal mesh, I have no idea how to get the others (_ref, _phys) etc.
  9. Mar 26, 2009
    Posts
    lol.

    First, you only need two meshes; The mesh for the model itself and the physics mesh. You can't extrapolate a physics mesh from the model mesh, you have to build the physics mesh yourself out of new pieces that approximate where the model should have collisions. I suggest that you look on Youtube for some tutorials on how to make collision meshes, you seem to be flying blind.
  10. Nov 11, 2011
    Posts
    I make physics mesh in hammer for propper like a pro... coughhhh :giggle:
    • Funny Funny x 1
    • Jun 18, 2012
      Posts
      ALright, I will come back here when I have learned more basic stuff, sorry, I didn't realise I had missed this step out.

      Also, what happens if I DONT want my prop to have a collision?
    • Nov 11, 2011
      Posts
      Then don't create a physics mesh and remove $concave (someone correct me if I'm wrong)! :razz: