Code Me A Proggy...

venomusvenomus Join Date: 2002-11-16 Member: 8951Members
Since some of you around here seem to be quite good with this kind of thing, I have a very simple request: a basic model to map converter.
Now this kind of thing has been attempted before, and if you try to convert 2d polygons to 3d brushes it is a lot harder than it sounds. All I require, however is something which outputs the location of the model vertices. For example it will output a map file with no brushes in it, but the location of the vertices will be marked out with point entities such as env_sprite. It is then up to the mapper to 'join the dots' with brushes and vertex manipulation.
I will not be able to test this just yet, so if anyone else wants to give feedback on whatever our resident coders come up with, be my guest.

Comments

  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    edited March 2004
    You could try <a href='http://homepage.ntlworld.com/pr.searle/testns/mdl2map.zip' target='_blank'>this</a>. It doesn't export directly from .mdl (mostly because the .mdl format is a **** to work with), but instead creates a .map from a Milkshape3d ascii file. Here's how to use it:<ul><li>Use milkshape3d to decompile the model's reference mesh (Tools -> Half-Life -> Decompile normal HL .mdl file; you only want the reference SMD).</li><li>Open the reference SMD and then use File -> Export -> Milkshape 3D ASCII</li><li>Run the tool using the ASCII file as input.</li></ul>The tool is a command-line program, and takes the following parameters:<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->mdl2map.exe [-usage] [-scale x] [-round y] infile outfile

    -usage: Prints out this information.

    -scale x: Scales the vertex coordinates by x.

    -round y: Rounds vertex cooridnates so they lie on a grid of granularity y.

    infile: The path to the input file.

    outfile: The path to the output file.  This will be overwritten if it exists, and created if it doesn't.<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    Here's a quick picture of the map produced after running it on the phasegate model:
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    It appears my hosting is playing up... I've attached the program to this post.
  • venomusvenomus Join Date: 2002-11-16 Member: 8951Members
    Wow that was quick, thanks. Any chance you could make it take .smd as an input. Reason being is I can't export files with my expired MS3D, but I can still decompose .mdl files.
    As I said, I'm unable to test it ATM, but from the looks of that screenshot it seems to do the job \m/
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    Okay, this version should take a .mdl as input and export the vertexes. It doesn't handle multiple bodygroups or other exotic features, but it should work OK. Just add the paramter "-mdl" to the start of the command line. Leave the parameter off to use the normal Milkshape ASCII version.
  • DelarosaDelarosa Naturally Custom Join Date: 2002-11-29 Member: 10214Members, NS1 Playtester
    a similar MORE acurate way to do this...

    decompile (milkshape) ...just textures and reference will do.
    import reference .smd (milkshape)
    export as a Quake 2 .map....

    bingo! in-map brush... not too great on the textures, as you will need to do that peice by peice for the whole model... but still...
  • prsearleprsearle Join Date: 2002-11-01 Member: 2365Members, Constellation
    I can't find an option to export to Quake2 .map in my copy of Milkshape (1.6.6). All I have is Quake 2 .md2 or QERadient .map, neither of which can be read by Hammer...
Sign In or Register to comment.