• Welcome to SC4 Devotion Forum Archives.

Linking S3Ds to FSH

Started by Lowkee33, November 14, 2010, 10:35:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lowkee33

(Ah, to post right above myself...)

I am changing the Instances of S3D and FSH files (call me crazy).  Within a S3D file there is a "map" tab, who's properties link it to the FSH file.  When I change the Instance of the FSH all of the S3Ds become white cubes, and I have to change the properties in the S3D map to fix this.

Right now I am doing this one S3D at a time.  Is there a way to to this all at once?

Thanks. 

vester

You will need to take a copy of the FSH. Then change the IID.
Then you will need to restart the reader. Then the reader can "see" the new FSH and you can change the materials on the 3ds.

Lowkee33

Can I change the materials all at once?

RippleJet

#3
Yes.
And you don't need to copy any FSHs, unless you need the original ones...

But, as Arne said, you do have to restart Reader, as all TGI addresses are read when Reader opens a file,
and changing those TGI addresses will cause Reader not to find them anymore.

vester

The times I just changed the TGIs without copying the FSH, the reader crash 3 out of 4 times.

Lowkee33

I really thought I posted again...perhaps not?

The crashes may come from doing a lot at once?  I use the version from the LEX and it only crashes when I do something strange.

Re-opening reader doesn't seem to work for me:  I changed a "0" to a "1" on a FSH ID, re-indexed, saved, quit, and reopened.  At that time I get something like this:


When I change the Material ID they all snap back to the proper picture.  It's changing the material ID that I have to do one at a time right now.

Some side questions: What is the Material Name?  I change the numbers to match the ID, but is there anything else I have to change?  What are the BMP, JFIF, and XML?  I imagine I have "broken" them by doing these changes.  What should I do to make them work again?

Girafe

#6
At first seems you have not the last version of reader. He came back few months ago and worked again on new versions of ilive more stable. They are available in his topic with links.

The Xml file points to the name of the exported model (needed for me when I want to check in my 3d data bank one exported model) and its dimension  (how tall is a prop like a tree  :P).

BMP and Jfif don't know a lot about them. 1 BMP is similar to 1 Jfif with white texture and blue one for the others (maybe someting like day / night)  &Thk/(
The Floraler

This is the end, hold your breath and count to ten, feel the earth move, and then...

*   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *    *   *   *   *   *    * 

cogeo

The TGI IDs can be changed massively in the reader. Sort items by type and then use the "TGI Editor" feature to change the texture IDs (select only the texture files in the TGI Editor).

The material IDs (in the S3D files) can be changed massively by using the SC4 Model Tweaker (Texture Replace function).

Lowkee33

#8
@ Girafe:  I have had problems with the new version (like destroying every file I touch).  It has some very handy options, but I never change files and always back them up before I open them.

I would guess the xml points at the FSH?  The S3Ds seem much more malleable.

@Cogeo:  Awesome!  I have sometimes accidentally opened models with your program (open with...), but it wasn't until today that I thought it could be doing some of these things.  Terrific.  It gave me some trouble, but perhaps I was doing it wrong.  I used the same file as the picture above:  The first box was given a value of 0x0??????? and the second a value of 0x1???????.  This did not work.  Making the first 0x???????? did though.

I will have to go through the support thread before I ask any more questions :)

Thanks all.

cogeo

#9
Quote from: Lowkee33 on November 14, 2010, 02:32:53 PM
It gave me some trouble, but perhaps I was doing it wrong.  I used the same file as the picture above:  The first box was given a value of 0x0??????? and the second a value of 0x1???????.  This did not work.  Making the first 0x???????? did though.

Checked the code, and indeed, there is a bug in the algorithm matching the material ID. It doesn't work when comparing the material ID to literal values; it is OK with the hash (instance ID) and questionmark (any) wildcards, but not with literal character values.

Also the help says "This command is unavailable if there are no S3D files currently selected, or if the selection includes files with 20 Z/R views too.", which is wrong as it works with 20-Z/R models as well. The correct would be "This command is unavailable if there are no S3D files currently selected.". Obviously a result of copy-and-paste.

I'm not sure if I can provide a fix. My trial license has expired, and I have installed the "Express" (free) version of MS Visual Studio in its place, which does not include an optimizing compiler, neither a Resource Editor. I don't know if it can compile a project made with the Professinal Version. I'll give it a try but I can't promise anything.

Lowkee33

It works fine for what I would be doing. 

Trying to think of when it would be a problem...  The IDs in a model are all the same other than the last three digits of the Instance, and I don't think anyone wants to mess with how the model looks at different zooms/rotations.

Perhaps the program is asking for needless info...  But still very time saving.

cogeo

#11
Well, checked the code a little further, and the bug affects the program in a different way than I thought:
- In general all search options work. The problem occurs only if the very first digit in the Find or Replace mask is a literal 0, and only if the mask contains the 0x prefix.
- The problem concerns BOTH the Find and Replace masks.
- The poblem does NOT occur if an 8-character mask is used, instead of a 10-character one. The program accepts both formats, ie it is possible to enter a mask without the 0x prefix.

That is a value like 0x0??????? doesn't work, but a value like 0x1??????? does work. And while 0x0??????? doesn't work, 0??????? does work.

So the workaround can be:
- Use the wildcards (# or ?) instead of a literal 0, as the leftmost character in the mask, if possible, OR
- Delete the 0x prefix in thr mask (use a 8-character-long mask).


And the program is not really asking for needless info. It's not used for modifying "pure" BAT-exported models only, but also merged/composite models, eg for bridges or puzzle pieces. There is required as great flexibilty here as possible, so as to accommodate the maximum possible number of cases. That's why the masks accept both literals and wildcards. For example, many puzzle pieces use composite models, often with one group (and its material) that's common across many puzzle pieces, and another one that's different for each puzzle piece (and typically uses a material that's by convention equal to the S3D's IID - or at least a part of the ID is the same). This way you can limit the changes to certain materials, selectively.