Page 1 of 2

I need help with editing prefabs

PostPosted: Tue Jan 31, 2017 5:24 am
by brainiac
I got many "Can't open file for read ***" errors, one "Collision model file ***prefab name*** not found" and "Failed to detect path origin. Defaulting to "/vehicle/truck/***".
Also I read viewtopic.php?f=25&t=5780 and there said that I need to extract base.scs and open 2-3 folders in depth, but when I open 1 (enviorinment), it is empty.
How to successful open prefab?

Re: I need help with importing prefabs

PostPosted: Tue Jan 31, 2017 6:09 am
by Oleg
"Can't open file for read" is generally a wrong paths/folders configuration. unpacked base folder is either specified wrong, or you import an addon/modded content.

"Collision model file ... not found" is absolutely ok, it's just a warning, not an error.

"failed to detect path origin" is again - wrong paths/folders config.

read this topic: viewtopic.php?f=25&t=6757

Re: I need help with importing prefabs

PostPosted: Tue Jan 31, 2017 7:51 am
by brainiac
Thank you. Errors gone.
SCS extractor won't extract files which zmodeler need, so there are errors can't open texture object file and failed to road texture.
EDIT:
I exported prefab and texture are there.

Re: I need help with exporting prefabs

PostPosted: Wed Feb 01, 2017 7:14 am
by brainiac
Now I have more problems. I read topic and made graceful exprot: I made folder base in ETS2 folder for map editor few months ago and used it for mod folder. For base.scs I chose ETS2 folder. But when I export, mat files and pmd and ppd files are in same folder. Thus I can't use it as mod because of missing textures.

Re: I need help with importing prefabs

PostPosted: Wed Feb 01, 2017 12:07 pm
by Oleg
mat files will be created in the same folder as pmd/ppd unless you assign material to some group (and group's name will be used as mat destination folder).

same applies to textures - they will be expected in the same folder too (and .tobj will be created there) unless you assign texture to belong to some group (and group's name will be used as .tobj destination folder too).

If you gracefully import original prefab, you can easily locate some materials being assigned a common group name (something like material/terrain or material/road), as well as some stock textures will be assigned a group named like material/terrain or material/road).

PMD -> MAT -> TOBJ -> DDS

"missing texture" is a result of broken chain above. PMD->MAT link is configured by material's group; MAT->TOBJ link is configured by texture's group, TOBJ -> DDS link is non-configurable, you just copy DDS images into the same folder as respective TOBJ file.

Re: I need help with importing prefabs

PostPosted: Wed Feb 01, 2017 1:44 pm
by brainiac
Thank you very much!!! Finally, I succeed and I have only pmd, ppd and pmg files in ceratin folderand I can start modding prefabs...

Re: I need help with importing prefabs

PostPosted: Thu Feb 02, 2017 5:12 pm
by brainiac
I have more problems.
I imported one vanilla SCS' prefab, road2_x_road1_lights and change name of semaphore profile. Then I made semaphore_profile.sii according to changes. When I export files, in folder are only ppd, pmd and pmg files. I zipped them with folder and moved to mod folder. But, when I starting game and test changing prefabs, semaphores still work like before, e.g. game doesn't see my changes.
Also, I changed names and sequences of semaphore profiles for hw2xcity2_small prefab, on which Promods' set semaphores. When I start game, semaphores follow my profile, but AI respect old profile and when I removed Promods' files, semaphores disappeared. I see that in creating files when exporting aren't all things.

Re: I need help with importing prefabs

PostPosted: Thu Feb 02, 2017 10:07 pm
by Oleg
it is strongly recommended to test your modifications with no other mods installed caused by very high risk of conflicts. If something does not work as intended, the very first thing to test is to import your model back into ZModeler and take a look whether changes actually did take effect. Also, it is recommended to move some vertices on visual model (to make a visible spike), just to be sure you see in game the modded content out of your scs mod.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 4:32 am
by brainiac
I imported changed prefab and changes are there, then I correct some little mistake and copied prefab to SCS file in mod folder. I started ETS and prefab don't have traffic lights. I think that in Zmodeler is one more place on which I should set new semaphore profile, not only on prefab/lights (in hierarchy).
Here I must complain on one more problem, probably related with upper. I read topic viewtopic.php?f=23&t=6487. First, I can't find how to manage (create/select) points. Then, I followed steps for adding AI lane and it isn't smooth, but open polygon. And when I select one lane and want to see properties, in External state is only ID, there aren't SCS compatiblity with more properties.
On start, I set SCS compatibiliy and other in configuration.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 4:50 am
by Oleg
semaphore profile is set in an object name
for example:
city (1)
where "city" is a profile name
profile lights require "type" user-defined option to be set to zero (or be missing). If you re-import your model and see light names with profile names there, everything is assumed to be exported properly. I haven't been messing with prefabs much, can't be sure on this, may be something has changed since last update. by words "and prefab don't have traffic lights" you mean no visual model appears in game? have you toggled prefab option to "use lights"? also, not sure on editor options, but is it possible to inspect prefab for availability of lights and their profiles?


You can create points in existing lanes when they are switched to manipulators level. Insert tool will allow to insert new points.
Creation of new spline can be done on objects level. Make sure to use "Click+Drag" on each AI point you create, so spline point is created in "curve" mode vs default "hard point" mode. "curve" type can be set later if needed on manipulators level (right-click -> type -> Bezier corner). IDs and properties are set on manipulators level too: you need to select a point while on manipulators level and you can change its properties.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 5:11 am
by brainiac
Yes, no visual model appears in game, but they are enabled. If I remove my mod from mod folder, lights are there.
I have all object name as there should be.
What can be reason because I haven't property SCS compatibilty in External State?
Where I can find curve mode?
EDIT: I found that new semaphore profile in sii file isn't saved, now semaphores are there.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 5:14 am
by Oleg
zmodeler does not create/change *.sii files.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 5:16 am
by brainiac
I know. I am very familiar with map editor, but I am noob in Zmodeler.
Then,
What can be reason because I haven't property SCS compatibilty in External State?
Where I can find curve mode?

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 10:17 am
by Oleg
scs compatibility is set in Settings->General page.
scs compatibility options available on properties of manipulators only. they will not appear on properties of objects, vertices..

manipulators are available in splines only: press '5', hover and click any spline (AI lane) - it will switch to manipulators level ("curve mode" as you name it). while spline is on manipulators level, you can refine its points position(s) and curvature by dragging manipulator arms in each point. If point has no manipulator arms, right-click on it, pick "Spline->Type->Bezier corner".


Edit: is the issue with semaphores solved? can't find it clearly out of your posts.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 2:27 pm
by brainiac
Thank you. I hope that I will able to add lanes, but I am sceptical.
Problems with semaphores aren't solved. For now, I can rename semaphore profile for prefab, but still I can't change position in array of one semaphore. If I do that, semaphore behave like I set, but AI behave according to old settings. For most prefabs it is enough, but for some I can't do what I want.
EDIT:
I still can't make curve splines, even on manipulator level.
Believe or not, I successfully added AI lane, but in open polygon shape.
SCS compatibility option found.

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 11:37 pm
by Oleg
semaphore lights need to have numbers in names. These are their reference numbers. You associated semaphore with AI lane by adding user-defined property named "light" at lane point. At the end of respective curve segment AI will respect given light state to stop or pass.

curve splines are created with "Strip" tool. With left-click-[and still holding left mouse button]-drag you define point and curve direction; then release left mouse button and shape the curve; click-and-drag again to place next point and define its curve shape; release left button again.. and so on. I'm nut sure I understand you properly when you say "but in open polygon shape". can you make some screenshots to explain it?

Re: I need help with importing prefabs

PostPosted: Fri Feb 03, 2017 11:56 pm
by brainiac
Open polygon is when from polygon you remove one line.
Now I can make curve splines, and change semaphore positions in array.
Thank you very much on help.
I think that on whole forum and internet I can't find most of things that you told me and this topic should be sticky, because can help other users.

Re: I need help with importing prefabs

PostPosted: Sat Feb 04, 2017 12:55 am
by Oleg
you can open polygon spline by using modify\break tool first, then you can delete point at break point.

to make a polygon spline, while creating, click on the first point and pick "Close spline" option.

Re: I need help with importing prefabs

PostPosted: Sat Feb 04, 2017 1:00 am
by brainiac
I don't need polygons, just described problem.

Re: I need help with importing prefabs

PostPosted: Sat Feb 04, 2017 1:27 am
by Oleg
I still don't get the problem you try to explain. meaning, not sure what sort of a problem you are describing at all.

Re: I need help with importing prefabs

PostPosted: Sat Feb 04, 2017 10:03 am
by brainiac
brainiac wrote:Thank you very much on help.
I think that on whole forum and internet I can't find most of things that you told me and this topic should be sticky, because can help other users.

This mean that I don't have any more problems. Please, make this topic sticky.
I changed subjet of 1. post, for other users.

Re: I need help with editing prefabs

PostPosted: Sat Feb 11, 2017 1:34 am
by brainiac
Until today after editing prefab I saved pmd, pmg and ppd files with all materials. As I am changing only splines and semaphores, is enough to save only ppd files? I guess that in ppd are informations about that, and in pmd or pmg about materials.

Re: I need help with editing prefabs

PostPosted: Sat Feb 11, 2017 2:03 am
by Oleg
in most of cases, replacing just .ppd files will work. However, .ppd file is somewhat interconnected with model file, as it allows different side-terrain generation on different model variants (e.g. model with sidewalk and model with no sidewalk), so something *might* work improperly, but I think it's a rare situation to happen.

Re: I need help with editing prefabs

PostPosted: Mon Feb 13, 2017 5:41 am
by brainiac
How to add semaphores on prefab which doesn't have it? Right, in hierarchy, <prefab name> and properties, there are lanes, nodes, navi and locators. How to add lights?

Re: I need help with editing prefabs

PostPosted: Mon Feb 13, 2017 11:19 am
by Oleg
create dummy node named "lights", create and place dummy nodes inside "lights" and give them names of profile to use, after profile name use (0), (1), (2) as a reference numbers. Then edit properties on points (manipulator level, hotkey=5) of AI lanes: add user-defined property name "light" with value = index of semaphore to use.

Import original prefab with semaphores and take a look on hierarchy and AI point properties to find what I'm talking about. Once you see everything on your own, you will be able to reproduce it properly on your modded prefab. It's essential to see correct setup (original prefab) first, to be sure you will do things properly in your scene.