[MVL] How to import objects from GTA

PunkNoodle

  • Full Member
  • Posts: 160
[MVL] How to import objects from GTA
«  »Last edited
Introduction

Since I often get asked on the procedure on how to import objects from other GTAs, I thought I will post a tutorial that hopefully makes it clear for everyone. It's no rocket science, it just takes some time and patience. I'll list below the tools I personally use, you can of course use others if you prefer. With that being said let's move on the actual stuff.



Tools:

- MEd there are other map editors out there but this is newer and better than Moo Mapper and KEd
- Collision File Editor II Again I recommend this over the older CollEditor or Col - IO



Steps:

Part I - Retrieving the needed files

  • Open MEd, load the IPL files from Scene tab and double click on the object you want to export



  • Use right click on the object and select Properties

- This will provide the name of the model and texture in this case dinerind.dff and newbuildind.txd respectively.

  • Click Browse... next to Model Name, right-click the model you need and extract it. Repeat the exact same procedure for the texture file
  • In the Item Definition window you've seen before, click on the Col icon

- This will show you the collision name and in which file you're going to find it. In this case the name is dinerind located inside INDUSTSW.col file.

  • Move to your GTA III folder and open data->maps->industsw, there you'll find industSW.col. Open it in CollEditor II


  • Locate the file you need, in this case dinerind, right-click on the name, hover on to Export and select Combined Collision File... to export it

Now that we have a model, a texture and a collision file. Let's move on the next section.





Part II - Importing it to VC:MP

  • Create a 7-Zip archive with those 3 files, give it any name and attach '_unp' as suffix, then drop it inside your server store folder
- I chose to name mine dinerind_unp.7z

  • Open your objects.xml file, located inside store->objects folder. There you need to define the characteristics for your object, including:
- the ID that you assign to it within VC:MP
- the model name and its draw distance
- the texture name
- the collision name
- the flag values, which I'll explain in the next section

  • If everything is done correctly it should look like the following:
Code: [Select]
<?xml version="1.0" encoding="ASCII"?>
<objectlist>
<object id="0">
<model path="dinerind.dff" distance="300" />
<texture path="newbuildind.txd" />
<collision path="dinerind.col" />
<flags value="0" />
</object>
</objectlist>


And that's done!! Those were all the essentials. The subsequent section focuses instead on minor facts you might need to know.





Part III - Details

  • Object flags will influence object's behaviour a bit, but for the average object you can just leave them 0, I'll attach their description below


  • Object ID 0 in objects.xml translates to 6000 within VC:MP usage
  • To spawn the object in Vice City now you either need to make use of the XML maps or CreateObject function
Code: [Select]
<?xml version="1.0" encoding="ASCII" ?>
<itemlist>
<item model="6000" name="dinerind">
<position x="0" y="0" z="0" />
<rotation format="axisangle" x="0" y="0" z="0" angle="0" />
</item>
</itemlist>
    - This is an example of how the XML file could look like

    • Setting draw distance to anything higher than 300m will have the effect of not rendering the collision. This is due to the game considering such objects low polygons models, thus not loading their collision to reduce load on performance
    • GTA 3 objects and in particular its interiors, need to have back-face culling disabled otherwise they won't display correctly
    • GTA SA uses a more complex collision type (type 3) thus before you import your object in VC:MP you need to adjust the collision type to the one compatible with GTA VC and III (type 1). You can do it by opening your object collision file with Coll Editor II, right-clicking on it and then selecting Target Version and Col 1, save it and you're good to go.


    And that's now really all. I hope it helped and thank you for reading! :)[/list]

    DarkRaZoR^

    • Full Member
    • VC:MP Battlefield Head Developer/KF Leader
    • Posts: 226

    PunkNoodle

    • Full Member
    • Posts: 160
    [MVL] Re: How to import objects from GTA
    « Reply #2,  »Last edited
    Update

    Since I've learnt something new today I decided to update this thread. I'll add my discovery to the Details sections as well.

    - GTA SA uses a more complex collision type (type 3) thus before you import your object in VC:MP you need to adjust the collision type to the one compatible with GTA VC and III (type 1). You can do it by opening your object collision file with Coll Editor II, right-clicking on it and then selecting Target Version and Col 1, save it and you're good to go.


    .
    Quote from DarkRaZoR^ on December 27th, 2019, 12:19 AM
    Props to you, NoodlePunk!
    Thank you ;)