How do you create a window collision model from scratch

GTA:V Modding with ZModeler3 discussion.

Moderator: madga182

Post Reply
TacticalDonut
Posts: 6
Joined: Wed Jun 05, 2019 11:07 am

How do you create a window collision model from scratch

Post by TacticalDonut »

I put a glass partition in the vanilla taxi and set the windshield/front door windows to bulletproof with the intention that the player/front passenger compartment of the taxi will be protected from bullets, but the passengers in the back won't. The glass partition is just the police3_xhatch object merged from the PPV Stanier and is of course inside the car. I want to create a window collision model for that glass partition so that bullets will pass through the rear windows and stop at the glass partition. This obviously means that I have to create a collision model for the glass object but I do not know how to do so. I'm fully aware of how to make glass break in-game, but that knowledge only applies to glass with pre-existing collision models created and not to glass that doesn't have a collision model.

I tried that one tutorial where you make a copy of the object, rename it to .[COL], and convert that to COL, but all that does is crash the game when it's shot. I tried renaming that same part to name [COL]... which resulted in the bullets going right through it. Attempting to just copy and move a pre-existing window collision model (like windscreen_r [COL]) doesn't work either. I also tried to create/modify the damage model, but I can't even select it in polygon mode, when I can with the already existing collision models.

Incidentally, I'd also like to create a collision model for the non-solid object that is the lower half of the partition but that isn't the main focus of this topic nor is it my main concern right now. I need that part to function as a part of the car body, i.e. bullet holes appear on it when shot but don't travel through it but again I don't need to solve that right now.

Finally, if this isn't possible because the glass is inside the car, I would still like to know how to create window collisions from scratch because there's a few other base models I have that don't have window collision models and I'd like to create some for them.

I somehow can't seem to find working tutorials on this issue but if there are, please point me to them.
User avatar
Oleg
Site Admin
Posts: 11181
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do you create a window collision model from scratch

Post by Oleg »

in most of cases, window collisions could be just a plain polygon (or a couple of polygons facing outside and inside). The glass object is not something that falls off, so it is not a must ot be a convex hull, solid shape with no missing polygons. it could be an arbitrary quad (a pair of).

I assume your partition glass is not a thing to have a chatter effect (I suppose you wish one, but this could work on a separate object only with its own collision object). Given that, you can put this partition collisoin into chassis collision. Take a look how Hercules (airplane) chassis collision is made - it is a combination of exterior collision of solid object and a set of inner-side polygons (to walk on and climb on).

the inner polygons are a geometry object with "Deformable" option toggled off (properties->mesh->vertices->format), while exterior mesh object has this option enabled. Both meshes are "Group"-ed and then converted to [COL]-compound.

I guess this is what you need to do with your chassis collision:
- dismiss "chassis [COL]"
- create new object with a pair of polygons (front-facing and back-facing) for partition glass. it could be made of cube primitive with 4 sides removed and 2 retained. toggle off "Deformable" option on it. Assign collision properties onto remaining facets.
- group new partition collision with original dismissed collision
- convert new group object to [COL] compound, rename to "chassis [COL]".
TacticalDonut
Posts: 6
Joined: Wed Jun 05, 2019 11:07 am

Re: How do you create a window collision model from scratch

Post by TacticalDonut »

Thank you for your response. I've never actually done any "scratch modeling" before; aside from using Copy this is the first time I've ever gone over to the Create menu.

- With regards to "Create new object"... how do you actually do that? I see under "Create" there is "Polygons" submenu with tools that do something. Are those the things I need to use?
- What are the "collision properties"?
- With regards to grouping the object I see the Group button, but it's always greyed out for me.
- Converting I assume is nothing different; you just select it, choose COL in the right panel and click convert?

Thanks
User avatar
Oleg
Site Admin
Posts: 11181
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do you create a window collision model from scratch

Post by Oleg »

1. you can create new object out of primitive. E.g. a box/cube primitive is the one I've suggest to use.
2. collision properties are per-polygon information on "COL" objects (objects converted to Compound with "COL" state on them). These are game-specific properties of surface type and in-game "behavior" scenarios for collision surface.
3. to group objects, you need to select several of them in hierarchy view with ether Shift or Ctrl key held down.
4. yes.

so, you have two geometry objects. you pick the first one in hierarchy, press and hold Ctrl, pick the second in hierarchy view. "Group" button will become enabled, press it. Then pick the underlined object (a group), press "COL" button and use "Convert to compound".

Then you can use "Open group" button to gain access to objects inside a group; you can switch them (any or both) to polygons level, select desired polygons and assign collision properties onto them. It is advied to set "GTA5" in ZModeler's Settings -> General -> Compatibility -> Options drop-down selection. If you do so, after selecting polygons on "COL"-compound object, properties window will show you "GTA5 Options" among other regular options for selected polygons. Double-click on them to bring an options window up. Assign properties, close window and press "Apply" in properties panel to save changes to selection.
TacticalDonut
Posts: 6
Joined: Wed Jun 05, 2019 11:07 am

Re: How do you create a window collision model from scratch

Post by TacticalDonut »

Oleg wrote: Fri Apr 16, 2021 2:01 pm 1. you can create new object out of primitive. E.g. a box/cube primitive is the one I've suggest to use.
2. collision properties are per-polygon information on "COL" objects (objects converted to Compound with "COL" state on them). These are game-specific properties of surface type and in-game "behavior" scenarios for collision surface.
3. to group objects, you need to select several of them in hierarchy view with ether Shift or Ctrl key held down.
4. yes.

so, you have two geometry objects. you pick the first one in hierarchy, press and hold Ctrl, pick the second in hierarchy view. "Group" button will become enabled, press it. Then pick the underlined object (a group), press "COL" button and use "Convert to compound".

Then you can use "Open group" button to gain access to objects inside a group; you can switch them (any or both) to polygons level, select desired polygons and assign collision properties onto them. It is advied to set "GTA5" in ZModeler's Settings -> General -> Compatibility -> Options drop-down selection. If you do so, after selecting polygons on "COL"-compound object, properties window will show you "GTA5 Options" among other regular options for selected polygons. Double-click on them to bring an options window up. Assign properties, close window and press "Apply" in properties panel to save changes to selection.
Hi, I'm very sorry for my horribly late response. I forgot about my desire to create a collision model when my copy of GTA V decided to completely break for no apparent reason and not start up if I didn't have the mods folder installed. I definitely appreciate your help and didn't mean to give the impression that I'm ungrateful and ignoring your advice.

Anyway, I gave up on the window collision thing after GTA V stopped working and I had to start a new save, but now I have to create collisions again. This time, it's for a towtruck-to-flatbed conversion, and I need to create collision models for the sides, bottom, and back of the flatbed frame. I've used your previous instructions on creating primitives to create four boxes that serve as the collision model. However, the collision models don't work in-game. The player will recognize the sides and back as solid objects and will grab onto them and climb over them, but they can also walk straight through them from either side.

One major problem I'm currently having is that the GTA V Options... dropdown does not appear for my collision models in Object mode, but does appear for the Rockstar-created ones. When I select my collision model and go into Polygon mode, the GTA V Options... dropdown does appear, but the dropdown is for Light Emissive Selection. When a Rockstar-created collision model is selected, the Options dropdown appears properly in both Object and Polygon mode, and in Polygon mode it's actually a dropdown for collisions, not light emissives. So I must have done something wrong with mine in that ZModeler does not recognize them as collision models.

So I've set up the collision models as follows:
- The main collision model flatbed [COL] is grouped from three objects: flatbed [COL] (the bottom collision), flatbed [COL] back, and flatbed [COL] sides.
- In Object mode, they have the following properties: External State ID 0, Flat shaded, Normals and Deformable, Max Rig Bones 0, UV Channels 0. They're using Default Material and in format Quads. I've copied the User-Defined Options (in Object mode) from the Rockstar-created left door collision model and added them to mine.
- In Polygon mode, I've set the External State ID to 116, which was the ID on the left door collision model.

I am wondering if you have any suggestions on where I could go from here or what I'm doing wrong.

If it helps, I've uploaded the z3d to a Google Drive folder and can send you the link if you want.

Thanks again!
User avatar
Oleg
Site Admin
Posts: 11181
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do you create a window collision model from scratch

Post by Oleg »

if you use "deformable" option on a geometry object, it should have no open edges: there should be no sharp solid wireframe outline on a mesh - every edge should have dimmed color in ZModeler. A box primitive has sharp edges and solid wireframe outline. however, if you select (rectangle) every "point" of a box and use Modify\Weld tool on selection (8 times for entire box), it will have the same "points" but vertices in these points will be merged together. You will see dimmed edges on such a box. This box can be used as collision with "deformable" option.

Most of problematic collisions could be fixed by duplicating a geometry object and setting a "Deformable" option on just one of geometries. Then Group them together into a single object and convert to [COL] compound. Mind the "no sharp edges" from paragraph above for "deformable" version of geometry.

The "Gta Options" will appear for collision object that is already converted to COL compound. It's a bit inconvenient, but ZModeler need to know that you edit a collision object to show you correct set of options.
TacticalDonut
Posts: 6
Joined: Wed Jun 05, 2019 11:07 am

Re: How do you create a window collision model from scratch

Post by TacticalDonut »

Edit: Hopefully the last time I have to edit this - I solved the issue myself. Apparently you have to attach collision models to the chassis collision rather than having independent collision objects...

Hey, that worked! I was able to get the window and partition collision model working (I'm back working on the taxi mentioned in the original post) after following your instructions on using the Weld tool. Again, sorry for the late response - The forum isn't sending me email notifications for whatever reason and I don't check here often.

Thanks!
Post Reply