Create custom road prefabs?

MiddletonCounty
Posts: 3
Joined: 05 Mar 2013 00:11

Create custom road prefabs?

#1 Post by MiddletonCounty » 05 Mar 2013 20:36

I have a question. Is it possible to create custom road prefabs? Do I have to use ZModeler2 and a hex editor to create it?
User avatar
ohaha
Posts: 11345
Joined: 07 Dec 2012 06:31
Location: Watchin' y'all
Contact:

Re: Create custom road prefabs?

#2 Post by ohaha » 05 Mar 2013 21:04

Most likely.
Retired, but still loving it.
User avatar
Reinhard
Posts: 4713
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Create custom road prefabs?

#3 Post by Reinhard » 05 Mar 2013 22:06

"Custom road prefabs"? Do you mean forks and crossings?

Prefabs consist of a 3D model (PMG and all the other files) plus a file describing all prefab parameters for interaction with "the world", called PDD files (PPD for newer games).

If you are keen on Zmodeler, you could create such models, in theory. But there is no visual PDD editor available. Doing it with a hex editor is not practicable. Even if you had the knowledge, it would be a nightmare to create PDD files from scratch.

Only chance is to make very limited changes to existing prefabs. But only if you exactly know what you are doing. Somewhere there is a tool named pddedit.exe to be found (sorry, no link), to change PDD sections into human-readable stuff, and back. But be warned: even this tool affords detailed knowledge of PDD internals.
MiddletonCounty
Posts: 3
Joined: 05 Mar 2013 00:11

Re: Create custom road prefabs?

#4 Post by MiddletonCounty » 06 Mar 2013 07:14

Okay, when the prefab is imported into ZModeler2, I get a few parse errors in .mat files. When exported, and started the game, the textures are messed up for some reason.
User avatar
Reinhard
Posts: 4713
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Create custom road prefabs?

#5 Post by Reinhard » 06 Mar 2013 08:09

MiddletonCounty wrote:Okay, when the prefab is imported into ZModeler2, I get a few parse errors in .mat files. When exported, and started the game, the textures are messed up for some reason.
Not for "some reason". The problem starts with " few parse errors in .mat files". Zmodeler is tested with vehicles only, the syntax of some material files for other models may slightly differ. Which means you have to learn and understand all of it, fix those buggers before final import, and re-apply some of that changes after export.

If you want to learn some Zmodeler, fine, go ahead. Lot to learn, it isn't exactly the casual way.

But again, if your target is "creating prefabs", you are probably lost. This is not a task for beginners, but of course I don't know your technical background.

Cannot help you with Haulin, sorry, my experience is limited to ETS1, which is very different. But learning Zmodeler is 95% self-reliant anyway, searching, thinking, trial/error. Good luck.
User avatar
bang-setia
Posts: 52
Joined: 15 Jun 2013 15:23
Location: indonesia
Contact:

Re: Create custom road prefabs?

#6 Post by bang-setia » 24 Jan 2014 12:25

pddedit
Attachments

[The extension rar has been deactivated and can no longer be displayed.]

hydraulics
Posts: 19
Joined: 20 Nov 2013 23:06

Re: Create custom road prefabs?

#7 Post by hydraulics » 05 Feb 2014 03:41

Yes, it is possible with the tool suggested above and blender(for finding vertex coords).

The PDD use's the coordinates from the Model's Origin.
If you open \def\world\roads.def and take the "City2" road for example.
You will notice that both lanes(left/right) are 4.5(meters).

So if we want to create a square out of this we would say
4.5m(left) + 4.5m(right) = 9.0m Width + 9.0m length = 9.0m sq

Open blender and make sure you are using the "Metric" units.

From top view(making sure the cursor is centered), Create a plane. With it selected in object mode, hit "N" on
your keyboard, this will bring up the properties panel.

Under "Diemensions" add the values 9.0m for the height, and 9.0m for the width
giving you 9.0m sq

X => 9.0m
Y => 9.0m
Z => 0.0m

Next add an edge loop directly down the center, this will leave you with two faces(both 4.5m in width).
To get the center of both lanes(to create the AI lines) its simple subdivision 4.5m / 2

left lane center : -2.25m
right lane center : 2.25m

We have enough information now to run a test.
Important Note: Where you offset the model from the Origin is crucial.
if you followed the steps, then the Origin should be in the center of the model. However you may want to move it for any number of reasons.


As the model currently is, when we go to create our nodes(green&red) our starting point will be from the center, so node[0] will be positioned at -4.5m on the Y axis, and Node[1] will be positioned at 4.5 on the Y axis, make sense ?

You now know your diemensions, so creating lines will work the same way.
Starting from the Origin, line[0] we need the AI to travel down the center of our 4.5m road, so our x axis is -2.25m, line[1] again from the center would be 2.25m

Any questions feel free to ask!
MiddletonCounty
Posts: 3
Joined: 05 Mar 2013 00:11

Re: Create custom road prefabs?

#8 Post by MiddletonCounty » 05 Feb 2014 22:12

I have a question. Does the Blender program can open up .pdd files to edit the AI travel lanes?
hydraulics
Posts: 19
Joined: 20 Nov 2013 23:06

Re: Create custom road prefabs?

#9 Post by hydraulics » 06 Feb 2014 12:46

No you can't.

You can use blender to work out the Coords you need though, I made a quick image to show you what way it could be used.

[ external image ]
User avatar
Reinhard
Posts: 4713
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Create custom road prefabs?

#10 Post by Reinhard » 06 Feb 2014 13:54

Hydraulics, he's talking of Haulin, at least that's where here posted.

MiddletonCounty, I doubt that Blender will do you any good. Because there is no import/export possible for you, as far as I know. The filter plug-in by 50Keda that people are using here is for ETS 2.

18wos Haulin comes with PMG version 0x10, while ETS 2 (right now) is PMG version 0x13 (was 0x12 till 1.4).

If there is no other plugin-in for Blender I never heard of, the only way to handle such meshes is Zmodeler 2. Or may be ancient Zmodeler 1, I don't know that one.

Zmodeler 3 doesn't support the old stuff, I doubt it will read/write the Haulin PMG files. It will for sure not read a Haulin PDD, only the new PPD format.

So only way left is to fumble with an old Zmodeler, a hex editor, a calculator perhaps and pddedit. I've done so for ETS1, years ago, and it was no real fun. And I never created prefabs that way, just copied and changed some existing in a modest way.
Post Reply

Return to “18 Wheels of Steel: Haulin'”

Who is online

Users browsing this forum: No registered users and 6 guests