Adding custom models

Discussion in 'StarCraft 2 Maps, Replays, Modding' started by Xern, Dec 11, 2010.

Adding custom models

  1. Xern

    Xern New Member

    Joined:
    Aug 11, 2010
    Messages:
    88
    Likes received:
    0
    Trophy points:
    0
    I plan on doing a custom map with extensive usage of custom models. I've downloaded mpq extractor and import / export plugins for 3dsmax. After extracting dds textures and zealot model i can open it in 3dsmax and tweak it a bit, then substitute it for original zealot. But the questions i have are following:

    How do i add a new model to the game? It seems that i need to add info in units.xml and models.xml in data.mpq file, somewhere else?

    How to add different animations for the unit?

    If someone has done this before i'd be grateful for help.
     
  2. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,730
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    I'm pretty sure all you have to do is import the model file then choose that file in the data module. I'm not sure about animations though.
     
  3. MeisterX

    MeisterX Hyperion

    Joined:
    Jul 23, 2007
    Messages:
    4,949
    Likes received:
    17
    Trophy points:
    38
    From:
    New Port Richey, FL
    Animations currently aren't supported by the 3DS plugin...

    I'm planning on working on putting together a guide but unfortunately I don't know the answers to all of your questions at the moment....

    You can check SC2Mapster but unfortunately that site's hard to get any information out of it at all....

    Feel free to hit me up with any questions and maybe I can help you figure it out.

    I am curious, how did you texture the models so that the .m3 format would support it?
     
  4. Xern

    Xern New Member

    Joined:
    Aug 11, 2010
    Messages:
    88
    Likes received:
    0
    Trophy points:
    0
    Yeah, i have to agree that it's pretty hard to find useful advice on SC2Mapster, I have found though import / export / animation plugins for 3d max, and that's what i'm using:

    http://www.sc2mapster.com/assets/m3-export-plugin-3ds-max/

    I'll briefly describe my experience with this so far:

    Since i'm working on this alone i definitely don't want to do custom animations. Instead i would like to modify existing models and preserve their animations, that would be perfectly suitable for my purpose.

    Imported models come mostly as one object, with edit mesh modifier and skin modifier for animation. Skin modifier is on top of edit mesh, so any changes to the mesh would result in loss of animation info.

    What i intented to do is add another edit mesh modifier on top of skin, so that i could preserve animations and change geometry a bit at the same time. That worked well in 3d max but unfortunately wouldn't export properly. Later i found out that you can't add polygons to existing models, only remove them, which won't work for me, as i want to do for example more armored zealot model.

    Fortunately it's still possible to apply transforms, so i guess the scale transform will have to do for now if i want to minimize effort involved. I quickly made a custom zealot with bigger blades and forearm shields, longer back of the helm and bigger arm things, but i guess it's almost indistinguishable from the original.

    [​IMG]

    I purposely haven't included custom textures, because i wanted to see if there would be visible geometrical differences, but i have already done that before:

    [​IMG]

    The plugins add starcraft 2 bitmap material type to 3d max, you can use it to add standard bitmaps. I've just added simple black bitmap to see if it would work and it does. And you can also import models with their dds texture files.
     

    Attached Files:

  5. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,730
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    I dabbled in models quite a long time ago, and I ran in to the issue that Blender can't export the correct model type, only import with a plugin. But was I right when I told you to simply import the file then select it in the data module?
     
  6. Xern

    Xern New Member

    Joined:
    Aug 11, 2010
    Messages:
    88
    Likes received:
    0
    Trophy points:
    0
    Yes, that's the way to go so thanks for help, but actually i had a problem with that as well. After wasting a lot of time trying to find the imported model in data editor, i just typed in the path (inside editor) manually. It's really non intuitive, there should be more obvious correlation beetween import module and data.
     
    Last edited: Dec 12, 2010
  7. EatMeReturns

    EatMeReturns Happy Mapper Moderator

    Joined:
    Jun 28, 2007
    Messages:
    1,730
    Likes received:
    11
    Trophy points:
    38
    From:
    Albuquerque, New Mexico
    So just importing it and using that import path worked?
     
  8. Xern

    Xern New Member

    Joined:
    Aug 11, 2010
    Messages:
    88
    Likes received:
    0
    Trophy points:
    0
    You have to save the map first, then status of imported model changes from added to normal. Then I've change the path to be consistent with standard naming (Assets\Units\Protoss\Zealot2\Zealot2.m3), saved again. Then i duplicated zealot (it's better then creating a new unit based on zealot) and changed model path to my imported model, and it worked.