GTA IV Zmodeler2 Import/Export issue on vanilla cars

ZModeler2-related discussion. General questions, howto, etc.

Moderators: Oleg, _RicH_

GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Mon Sep 05, 2016 9:11 am

Hey guys,

I'm currently working on a mod on all GTA IV vanilla cars (I want to adapt them to the Real Inside View script in order to give them fully working steering wheels).
For those who are not familiar with the Real Inside View script: It uses door rotations to make the steering wheel work. (On 2-door cars, I use a rear door rotation. On 4-door cars, I use either the bonnet or the boot).

But when exporting the cars, some of them have an issue where the game crashes instantly upon shooting the car windows.

I converted about 70 cars till now and the issue is on the following cars:

- Coquette
- Merit
- Taxi2 (Merit base)
- Police2 (Merit base)
- Vigero
- Vigero2
- Landstalker

In order to sort out an error done by me, I just imported and exported these cars without changing a little bit on them (I never touched the windows!). Also, I used different versions of the Zmodeler (2.2.4 & 2.2.6) but nevertheless, once these cars were imported & exported by the Zmodeler, they start crashing the game when I shoot the windows.

I checked the window COL IDs and they were always fine (137 / 136 / 135) so I don't know what could cause this issue, especially because it's not occuring on every car, the other 60+ cars are perfectly fine.

Did anyone here experience that issue as well and knows how to resolve it?

Thanks a lot

eljamon88
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Tue Sep 06, 2016 11:55 am

check the COL objects on vertices level: ensure there are no poly overlap and COL is not flipped inside out. There is a small part of video related to GTA5, but it uses a GTA4 model in it: try the same in ZModeler2:

https://youtu.be/GuYapRP7Ta0?t=646
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Tue Sep 06, 2016 12:47 pm

Hey there,

first of all: thank you for your help.

As a first try, I did as you told and flipped all the window COLs (on the object level) without any success; the game still crashes when shooting the windows. So right now, this is how my window COLs look (before I flipped them for testing):

Image
Image

Then, I checked all my window COLs on the vertice level: all the green markers are going away from the COL mesh and not towards it. Is that the way it is supposed to look?

Image
Image

So what else could I try?
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Tue Sep 06, 2016 10:15 pm

COLs seems to be Ok to me. I can suggest to assign IDs that correspond to "metal" rather than the "glass", just to check whether the game will run fine on this type of COLs. If i'm not mistaken, using "Glass" IDs on COL require object to use specific shader, have 2 UV channels, and have LOD#1 and LOD#2 models too. Meanwhile, the original model crashing after import/export looks quite strange as it fits these requirements.
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Tue Sep 06, 2016 10:53 pm

Alright, tonight, I will assign all window & the chassis COL to ID 79 (metal) in order to check if that resolves the problem. I rather have metal windows than a crashing game ;-).

In the meantime: how can I check if the glass uses the correct shader and has 2 UV channels?
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Wed Sep 07, 2016 11:04 am

each COL object is associated with the geometry object (it's parent object with the same name). Select this geometry object, expand properties -> mesh -> polygons and examine materials assignment. it should utilize one or two materials, both configured for vehglass shader. Also, in properties -> mesh -> vertices -> format, you can check settings for UV channels - it should be set to 2.

you can do this on several objects selected at the same time.
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Wed Sep 07, 2016 11:37 am

Thanks for the tip. After trying several times, I found that out on my own; all the geometry meshes have 2 UVs assigned to them (the vehglass shaders for outer glass or inner glass). These were fine on the cars and not causing the problem.

But I think I figured out what did: apparently, the chassis COL was causing all the trouble. Usually, the polygons on the chassis COL that have the positions of the car windows are being assigned the COL ID 2. When I changed these polygons to the same COL ID from the respective window COLs, it all worked perfectly!

For example: all door windows use COL ID 135, so I checked which polygons on the chassis COL have the same position as these window COLs and changed them to COL ID 135 as well. I tested it on the Merit & the Coquette: total success ;-)

Thanks a lot for your help, your hint on checking the COL IDs was the missing puzzle piece I needed ;-)
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Wed Sep 07, 2016 12:29 pm

I suspect this is a half of solution only, as this setup will not let the bullets fly through the vehicle/window and hit objects inside (e.g. hit driver or passenger).
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Wed Sep 07, 2016 1:53 pm

Yup, just realized that. Well, at least I successfully prevented the game from crashing, that's a plus for now.

I think it could also have to do with the position of the window COLs. Because when I did the chassis COL trick on the Landstalker, I had to manually move the rearshield COL a little further outside so that the window would burst upon shooting at it.

On the weekend, I'll try to adjust the window COLs by moving them around their meshes and then readjust the chassis COL to ID 2.

Let's see if that'll do the trick.
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Wed Sep 07, 2016 8:18 pm

Short update: I did a test on the Landstalker since I manually adjusted its rear windshiel COL already. If I change the rear windshield polygons on the chassis COL from ID 79 to ID 2, it crashes the game again.

So it seems that on these cars (Merit, Coquette, Landstalker, etc.), the game has a problem with handling ID 2 polygons on the chassis COL since it works fine when the entire chassis COL is being assigned ID 79.

Any further advice?
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Thu Sep 08, 2016 1:37 pm

give it a try by adding polygons onto window COLs to make them solid objects with no open edges. I mean the COL that has polygons facing forward and facing backward only - should have polygons on the border connecting them together. So a solid all-vertices-welded shape is a result. the game engine handles solids in a slightly different manner, so this could be the case too. make sure to assign correct IDs on newly-created polygons too.
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Thu Sep 08, 2016 11:03 pm

I'll give it a try, but I have another question:

As you can see on the pictures above (Coquette window COLs) the door window COLs are solid meshes already without any open edges. Nevertheless, my game crashed when shooting these door windows.

Can that also occur if not all window COLs are solid meshes or am I facing another problem here?

Thanks for your help & support.
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby Oleg » Sat Sep 10, 2016 2:35 am

hmm.. no ideas on this. I don't know how the game code works and what could cause the game to crash. I just give an overal advice on what could be possible the cause without deep knowledge on what's going one under the hood.
User avatar
Oleg
Site Admin
 
Posts: 7642
Joined: Fri Feb 06, 2004 3:54 am

Re: GTA IV Zmodeler2 Import/Export issue on vanilla cars

Postby eljamon88 » Sat Sep 10, 2016 3:45 am

Hey Oleg,

don't worry, that's cool. You sure helped me a lot since you gave me the tip to have a look at the chassis COL.

Nevertheless, another experienced GTA IV modder gave me another hint which I want to share with you:

Try exporting the (modded) .wft to openFormats using OpenIV, then it will create a folder and an .oft file. From there you can go into the folder that was created (it should have the same name as the oft) and edit the individual COLs. They are labels as .CHILD files and usually the problem comes from the chassis COLs.

When you open the CHILD file with Notepad you should see some thing like this at the beginning:

Version 112 2
drawable
{
lodgroup
{
high none 0.00000000
med none 0.00000000
low none 0.00000000
vlow none 0.00000000
center 0.00000000 0.00000000 0.00000000
AABBMin 0.00000000 0.00000000 0.00000000
AABBMax 0.00000000 0.00000000 0.00000000
radius 0.00000000
}

etc.

Scroll down to were it says this:

}
Polygons 49 (This number is different depending on how many vertices are in the COL model.
{
Polygon 0
{
Material 0
Vertices 15 10 1 6
Siblings 11 6 24 10
}
Polygon 1
{
Material 1
Vertices 9 2 11 0
Siblings 10 2 18 -1

Now if it says something like this:

}
Polygons 49
{
Polygon 0
{
Material 0
Vertices 15 10 1 6
Siblings 11 6 24 10
}
Polygon 1
{
Material 255
Vertices 9 2 11 0
Siblings 10 2 18 -1
}
Polygon 2
{
Material 255
Vertices 5 11 2 0
Siblings 3 1 26 -1

Then you have a problem, this is usually where collision problems happen. Zmodeler will sometimes export the COLs with this "255" material which is not what we want, we want it to have either a 0 or a 1. From here, you can export the .wtf of the original untouched car as an openFormat file and replace the chassis.CHILD file of your car mod with the original untouched one.
Afterwards, you import the .oft file of your modded car using OpenIV again and enjoy your crash-free car mod.

IMPORTANT: Using this fix must be a last step, as if you try to import the newly created wft it will just show one green dummy in Zmodeler. So you should complete all of the work you need to do then do the fix.

I did that on all cars and it works! Windows can be shot and you can shoot through the car. Problem solved ;-)
eljamon88
 
Posts: 12
Joined: Mon Sep 05, 2016 8:58 am


Return to ZModeler2 General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest