Truck interior spawns in the ground

Forum rules
SCS as a company do not wish to have paid mods on this forum. While we understand that not all paid mods use the Intellectual Property of other companies/people, it is very hard to moderate what is and isn't acceptable when money is involved. There are also concerns that it could look unfavorable to potential work partners going forward if SCS allow mods that may potentially use unlicensed branding.
Posting in the Mods forum (ATS and ETS2) is restricted to sharing free-to-the-public mods and providing support for mods. For more details, please check the Forum Rules.
Post Reply
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Truck interior spawns in the ground

#1 Post by Deca » 20 May 2023 22:11

My truck interior spawns on the ground when I swapped my truck's interior with another interior. I offset the camera in the camera units def file to make the camera go higher, but the interior model itself is still on the ground of the mechanic shop in game. AFAIK the root node of my interior model itself is intersecting the seat of my interior... so what gives? Any help would be much appreciated!

It could also be that my interior is scaled abnormally larger than the interiors in the game:
[ external image ]
Last edited by Deca on 26 May 2023 13:51, edited 1 time in total.
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Re: Truck interior spawns in the ground

#2 Post by Deca » 23 May 2023 13:25

Still no idea as to what's causing this, going to try directly placing my interior models in the game's stock interior model and see if that fixes anything, or if I'm missing a locator that should be in my interior's root or in my truck model itself. I haven't messed with anim.pmd or ext_interior because I'm not sure it's relevant to the positioning of the interior.

This is what I mean when I say it spawns in the ground:
[ external image ]
User avatar
room217au
Posts: 2723
Joined: 17 Jul 2015 01:55
Location: Lakeside

Re: Truck interior spawns in the ground

#3 Post by room217au » 25 May 2023 00:08

The relationship between the interior model and its world origin is also important when that model is placed using the 'interior' locator in truck.pmg
If you suck at playing the trumpet, that's probably why.
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Re: Truck interior spawns in the ground

#4 Post by Deca » 25 May 2023 18:10

room217au wrote: 25 May 2023 00:08 The relationship between the interior model and its world origin is also important when that model is placed using the 'interior' locator in truck.pmg
Thanks for the response. Not sure I understand, I was told the 'interior' locator is the truck's pivot point by Outlaw Trucking on another thread:
Outlaw Transport wrote: 23 Aug 2022 12:40 IIRC the interior locator doesn't actually position the interior, that's just the truck's pivot point. The interior and exterior is connected through the def file and positioned from the camera locator. I think you may be confusing it with the ext_interior, which is the interior visible from the outside and needs to fit the truck perfectly or it bleeds through. That is not the actual interior model. Most trucks aren't identical in scale inside and out, because there's usually no point in restricting your workflow to it. They have nothing in common. My 359 interior is around 5% larger in scale than the exterior because at 1:1 it kept feeling too "small" in game.

That's why you can have separate interior/exterior models for things like mirrors, sun visors, deflectors.
What exactly is the world origin? I posted an image below of the position of my interior locator in the interior.pmg and my interior locator in the truck.pmg. Does the coordinates of the root interior locator in the interior.pmd matter relative to the coordinates of the 'interior' locator itself in the truck.pmd? Are you saying that the coordinates of the 'interior' locator in truck.pmg have to match the coordinates of the root interior locator for your interior.pmg? I guess that wouldn't really make sense given that the interior.pmg root node has to be at 0,0,0 (world origin), right?

Edit: I tried importing a truck.pmg and interior.pmg from the game normally into a fresh scene. The 'interior' locator is at -0.5, 1.2, 2.4 approximately on XYZ coordinates, while its root locator for the truck.pmg itself is at 0,0,0. When I import the interior.pmd, its root node is at 0,0,0. If I offset the interior root locator by -0.5, 1.2, 2.4 on XYZ coordinates, just like that of the 'interior' locator in the truck.pmg, it the interior instantly fits in the truck! Is that the solution? Then you export and it has those offset coordinates from the world origin (0,0,0)? I was under the impression that you had to have all your root locators at 0,0,0. :o

[ external image ]
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Re: Truck interior spawns in the ground

#5 Post by Deca » 26 May 2023 17:23

I tried offsetting the root interior node by the coordinates set in the interior node in truck.pmg and it still spawns in the ground.
User avatar
Outlaw Transport
Posts: 252
Joined: 15 Jul 2020 06:18

Re: Truck interior spawns in the ground

#6 Post by Outlaw Transport » 27 May 2023 06:34

Deca wrote: 25 May 2023 18:10
room217au wrote: 25 May 2023 00:08 The relationship between the interior model and its world origin is also important when that model is placed using the 'interior' locator in truck.pmg
Thanks for the response. Not sure I understand, I was told the 'interior' locator is the truck's pivot point by Outlaw Trucking on another thread:
Outlaw Transport wrote: 23 Aug 2022 12:40 IIRC the interior locator doesn't actually position the interior, that's just the truck's pivot point. The interior and exterior is connected through the def file and positioned from the camera locator. I think you may be confusing it with the ext_interior, which is the interior visible from the outside and needs to fit the truck perfectly or it bleeds through. That is not the actual interior model. Most trucks aren't identical in scale inside and out, because there's usually no point in restricting your workflow to it. They have nothing in common. My 359 interior is around 5% larger in scale than the exterior because at 1:1 it kept feeling too "small" in game.

That's why you can have separate interior/exterior models for things like mirrors, sun visors, deflectors.
What exactly is the world origin? I posted an image below of the position of my interior locator in the interior.pmg and my interior locator in the truck.pmg. Does the coordinates of the root interior locator in the interior.pmd matter relative to the coordinates of the 'interior' locator itself in the truck.pmd? Are you saying that the coordinates of the 'interior' locator in truck.pmg have to match the coordinates of the root interior locator for your interior.pmg? I guess that wouldn't really make sense given that the interior.pmg root node has to be at 0,0,0 (world origin), right?

Edit: I tried importing a truck.pmg and interior.pmg from the game normally into a fresh scene. The 'interior' locator is at -0.5, 1.2, 2.4 approximately on XYZ coordinates, while its root locator for the truck.pmg itself is at 0,0,0. When I import the interior.pmd, its root node is at 0,0,0. If I offset the interior root locator by -0.5, 1.2, 2.4 on XYZ coordinates, just like that of the 'interior' locator in the truck.pmg, it the interior instantly fits in the truck! Is that the solution? Then you export and it has those offset coordinates from the world origin (0,0,0)? I was under the impression that you had to have all your root locators at 0,0,0. :o
My bad, I was thinking of the cabin locator. Interior locator does indeed place the interior.

So your myinterior.pmd root needs to be at 0,0,0.

Truck model - 0,0,0.
Interior model - 0,0,0.
Interior locator - wherever.

The interior model position is relative to where the locator is. e.g. if your interior model root coordinates are set at -1m in any direction, it will show up -1m away from the locator (and not from the truck root). In your example your interior root is positioned several truck lengths away in every direction from the locator :)

Also, silly side note but double check that you're actually pointing to the right interior model in the def file. I've spent countless hours trying to "fix" issues only to realize I'm not actually working on the model I'm looking at in-game.
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Re: Truck interior spawns in the ground

#7 Post by Deca » 27 May 2023 23:18

Outlaw Transport wrote: 27 May 2023 06:34
Deca wrote: 25 May 2023 18:10

Thanks for the response. Not sure I understand, I was told the 'interior' locator is the truck's pivot point by Outlaw Trucking on another thread:



What exactly is the world origin? I posted an image below of the position of my interior locator in the interior.pmg and my interior locator in the truck.pmg. Does the coordinates of the root interior locator in the interior.pmd matter relative to the coordinates of the 'interior' locator itself in the truck.pmd? Are you saying that the coordinates of the 'interior' locator in truck.pmg have to match the coordinates of the root interior locator for your interior.pmg? I guess that wouldn't really make sense given that the interior.pmg root node has to be at 0,0,0 (world origin), right?

Edit: I tried importing a truck.pmg and interior.pmg from the game normally into a fresh scene. The 'interior' locator is at -0.5, 1.2, 2.4 approximately on XYZ coordinates, while its root locator for the truck.pmg itself is at 0,0,0. When I import the interior.pmd, its root node is at 0,0,0. If I offset the interior root locator by -0.5, 1.2, 2.4 on XYZ coordinates, just like that of the 'interior' locator in the truck.pmg, it the interior instantly fits in the truck! Is that the solution? Then you export and it has those offset coordinates from the world origin (0,0,0)? I was under the impression that you had to have all your root locators at 0,0,0. :o
My bad, I was thinking of the cabin locator. Interior locator does indeed place the interior.

So your myinterior.pmd root needs to be at 0,0,0.

Truck model - 0,0,0.
Interior model - 0,0,0.
Interior locator - wherever.

The interior model position is relative to where the locator is. e.g. if your interior model root coordinates are set at -1m in any direction, it will show up -1m away from the locator (and not from the truck root). In your example your interior root is positioned several truck lengths away in every direction from the locator :)

Also, silly side note but double check that you're actually pointing to the right interior model in the def file. I've spent countless hours trying to "fix" issues only to realize I'm not actually working on the model I'm looking at in-game.

Thanks Outlaw and Room, that helps.

My root interior node however was at 0,0,0 and my truck.pmg root node was at 0,0,0 as well, and it still spawned the interior in the ground. Then I checked the cabin definitions and saw that my interior locator in my truck.pmg was assigned to the wrong part. It was assigned to 'cab_base' instead of 'factory' as specified in the cabin definitions for 'duty.sii'. Therefore, when it loads the cabin by default in the truck dealer, it doesn't load the interior locator, hence why it was showing in the ground. :roll:

Slightly relevant but irrelevant point: I don't get how some models, when I import them, the models themselves are offset from the root node but they show '0,0,0' on the coordinate system. Is that just an import glitch? They truly wouldn't be at 0,0,0 in world space, but they show as if they're at 0,0,0, even if they're offset by some values. Maybe that's a question for another thread, lol. Clearly it doesn't matter though given that everything works based off offset. Assigning the locator to the proper 'part' type actually fixed it for me, though, but your guys' tips definitely pointed me in the right direction.
User avatar
room217au
Posts: 2723
Joined: 17 Jul 2015 01:55
Location: Lakeside

Re: Truck interior spawns in the ground

#8 Post by room217au » 29 May 2023 01:48

@Deca The relationship between model's origin and any given locator in that model are different coords from other models because the locators only relate to their own origin.
Always remembering that the truck.pmg and interior_model.pmg are two separate models and are treated as such in the game.
ie. The 'interior' locator in truck.pmg is where the origin of the interior_model.pmg is placed.

[edit]
Perhaps I can add here that if you have an 'external' accessory (a bullbar is a good example) that should be seen from the interior view in-game, then that bumper locator needs to be present in the interior.pmg as well as the truck.pmg
The bullbar's def file should also include a "interior_model" path. Just copy the "exterior_model" line and change the 'ex' to 'in'. The same model can be used for both statements, but doesn't have to.
If neither locator nor def file line are present, you won't see an exterior accessory from the interior. Check the 'mirrors' def file. It has both.
If you suck at playing the trumpet, that's probably why.
User avatar
Deca
Posts: 37
Joined: 21 Jun 2022 09:56

Re: Truck interior spawns in the ground

#9 Post by Deca » 30 May 2023 20:46

room217au wrote: 29 May 2023 01:48 @Deca The relationship between model's origin and any given locator in that model are different coords from other models because the locators only relate to their own origin.
Always remembering that the truck.pmg and interior_model.pmg are two separate models and are treated as such in the game.
ie. The 'interior' locator in truck.pmg is where the origin of the interior_model.pmg is placed.

[edit]
Perhaps I can add here that if you have an 'external' accessory (a bullbar is a good example) that should be seen from the interior view in-game, then that bumper locator needs to be present in the interior.pmg as well as the truck.pmg
The bullbar's def file should also include a "interior_model" path. Just copy the "exterior_model" line and change the 'ex' to 'in'. The same model can be used for both statements, but doesn't have to.
If neither locator nor def file line are present, you won't see an exterior accessory from the interior. Check the 'mirrors' def file. It has both.
Thanks for the tip, I was aware of this somewhat apart from the fact that the models only relate to their own origin. Makes a lot of sense that an offset origin or offset model-within-that-origin would do nothing other than to relate to that origin node itself.
room217au wrote: 29 May 2023 01:48 Perhaps I can add here that if you have an 'external' accessory (a bullbar is a good example) that should be seen from the interior view in-game, then that bumper locator needs to be present in the interior.pmg as well as the truck.pmg
The bullbar's def file should also include a "interior_model" path. Just copy the "exterior_model" line and change the 'ex' to 'in'. The same model can be used for both statements, but doesn't have to.
If neither locator nor def file line are present, you won't see an exterior accessory from the interior. Check the 'mirrors' def file. It has both.
That also explains how my theory on the interior locator in truck.pmd having an offset value of the root node of interior.pmd makes zero sense, and the only relationship that is even comparable to my convoluted solution to a locator in one model (with its root node at 0,0,0) being related to a root node of another model is the interior_model and exterior_model variables that allow you to display exterior models' locators (from truck.pmd) within an interior model (interior.pmd) and vice versa. Thereby linking locators in different root nodes (models) when you're in one model versus when you're in an entirely different model. :roll:

Otherwise, my issue was simply that my interior locator in truck.pmd was not assigned to the correct part as demanded by cabin.sii in my def/truck/interior folder and I didn't need to think that hard! Obviously locators in one model only related to their assigned root node and not a root node in another model entirely. Thanks for the help and posts everyone!
User avatar
room217au
Posts: 2723
Joined: 17 Jul 2015 01:55
Location: Lakeside

Re: Truck interior spawns in the ground

#10 Post by room217au » 02 Sep 2023 06:16

@Deca Maybe I was unclear. Sorry.
In truck.pmg there will be a locator called "interior". The interior model of that truck uses the truck.pmg's interior locator as its origin.
This principle applies to all models.
If you suck at playing the trumpet, that's probably why.
Post Reply

Return to “Help requests”

Who is online

Users browsing this forum: No registered users and 7 guests