Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 2nd Mar 2010 at 6:22 PM Last edited by plasticbox : 2nd Mar 2010 at 7:06 PM.
Default Presets as XML: any way to make this work?
In this thread in S3OC QA testing, it says in the changelog "include resources referenced from PresetXMLs [..] gives the opportunity to edit presets, for those who know how." It meanwhile turned out that all that meant was literally "edit the file for those who know how (to use a keyboard)", not "edit" as in "change the way the object behaves", but still, that is what lead me to experiment with it – I seem to have acheived a limited degree of workingness, but apparently only for 1.8.25 games.

I don't know how it behaves in earlier games, I know it doesn't work the same way in later games (with WA or the equivalent patch), and I couldn't find any difference between the same objects cloned from 1.8.25 and WA so I'd think it's the game itself behaves differently.


What I had: A set of objects with tasteless and inappropriate presets (EA).

What I wanted to do: Include four custom presets as XML, and make the objects use them.

What I managed to do: Include one preset as XML, and make 1.8.25 use it for

- the rotating preview that shows up next to the catalogue description
- the actual object, if it's placed after that preview appears

Game defaults of the original (the object mine is cloned from) were used instead for

- the thumbnail
- the actual object, if it's placed before the rotating preview appears

These objects (with the default textures) were still "aware" of my preset in the sense that when CASTing them, the UI came up with my preset loaded (correct materials, channels, colours) and I was able to apply it. Just the initial view was defaults of the original, and in WA games the initial view was solid black (see below).

The way I did this was replace the XML that's included for the object (same instance as the MODL/MLOD) when making a full clone (or a clone with s3oc_1002-13-1333) with my own definition, and delete all material presets in the OBJD.

In WA games, both the rotating preview and the object showed up solid black, no matter whether the object was placed before or after the preview; the thumb was the default of the original like in 1.8.25. The XML still seems to do *some*thing, since there are no material presets in the OBJD or anywhere else that I can see, yet the objects are fully recolourable in WA with the correct number and order of channels and with my custom overlays and multipliers. I'm not clear on whether or not my preset is loaded when a WA user tries to CAST such a black object directly, by clicking on it (I don't have WA myself).



What I tried that did not work: (in 1.8.25)
  • Leaving the OBJD untouched, and include one or more custom presets in the XML: Couldn't see any sign of the XML being used at all, for object or preview or thumb or anything else. The stuff in the OBJD seems to override this.
  • Deleting parts of the typecodes and references in the OBJD, and include one or more custom presets in the XML: Results in a funky mix of the original's defaults, the XML, and OBJD definitions.
  • No presets in the OBJD, and more than one preset in the XML: the last of the XML presets was being used for rotating preview and objects placed after it appears, defaults for the rest.
  • Empty presets in the OBJD, and including one or more custom presets in the XML: Object won't show up in the catalogue.
  • Empty presets in the OBJD that have one TGi index for the in-game ObjectRgbMask: Uses the default values (flat brown, no shading) from ObjectRgbMask for everything (thumbnails, preview, objects) – this makes the object show up, but with "invalid style" errors and no channels.
  • Empty presets in the OBJD that reference my XML instead of ObjectRgbMask: I was very surprised that this worked at all ("worked" as in, the object shows up in game) – maybe it was just because that TGI index is being ignored? overridden? –: object showed up with defaults of the original (cream and white in this case), but had invalid styles and no channels.
  • Voodoo: combinations of different filenames, changing resource names, removing/changing TGI indexes, changing the pattern names in the XML, making empty MaterialBlocks with different sets of pattern names in "Unknown1", renumbering objects and so on and so forth: resulting in solid white objects with palettes in primary colours, only the first channel being recognised, only the first channel being recognised, original defaults being used, the CAST UI not loading, and other such things. None of it resulted in anything from my preset being used in any way. I don't remember the details and I didn't make notes because it was late and I'm a sucky tester. I'm pretty sure I didn't get "invalid style" errors with any of this as long as there was *some*thing being referenced in the TGI of the material (I didn't try complete garbage, but it might just as well have "worked").

What I didn't try:
  • Editing the presets in the OBJD – I know this will work because I've done it before, but there's no way I will ever do it again.

All of this was with objects that included only the XMLs for the object itself (those with the same instances as the MODL/MLOD), not the ObjectRgbMask one or any of the material XMLs.



Questions I have:
  • Does anyone have any ideas on how to make this work? Being able to actually edit presets (as in make them do stuff) by editing one friendly XML would be a vast improvement over having to deal with the OBJD.
  • Do the resource names (as in, the first column in s3pe) play any role for the game at all, or ar they just labels for the user?
  • I couldn't find any explicit reference to the object XML anywhere in the package (as in, there's no TGI block that lists it). How does the game know when to use it, is it because of the instance number? Or the name? Or something else?
  • What exactly is the relationship between the TGI block in the OBJD, and the ones in the material blocks? I only edited the "main" one once (which resulted in objects not showing up at all). I see that it references more or less the same things that are referenced in the ones in each material block; is it updated from those? When saving or renumbering or something? Or is it completely independent from those and will only change when the user changes it manually?
  • Is there any information available on what the exact relationships are between filenames and pattern names in XML presets and material presets? Below are two presets that I made in game by CASTing the middle and end of the same counter, exported from userPresets.package – the names near the top, key="Pattern A" value="whatever" are different but both presets work and neither of the objects have any materials in the OBJD. The game must be taking those names from somewhere else than that, but I don't know where.

    For all of the counterIslandEndEModern presets (I made more than one), the values were pine01VerMed_1 for pattern A and eggshell01Med_1 for B and C (which is what is used in my XML in the object), no matter what materials I CASTed with. For all of the counterIslandBaseModern ones, it's grainStraight01VerMed_1 for A, B, and C – and I have no idea where that's from.




Three more things for reference: the ObjectRgbMask XML from 1.8.25 (which is the same in WA), my custom preset XML, and the one of the original object (what mine is cloned from; again the WA one is identical). Far as I can tell this is what my object is using for the thumbnail in 1.8.25 and WA, and object-before-swirly in 1.8.25.






Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Advertisement
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#2 Old 3rd Mar 2010 at 1:29 AM
I have been successful with this method, but it's been hit and miss. My sunburst clock was colored this way, and I haven't had any reports of wonkyness. But I don't know why it works or why it doesn't.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#3 Old 3rd Mar 2010 at 1:56 AM Last edited by plasticbox : 3rd Mar 2010 at 2:31 AM.
I'll crack open your clock and look at it. Thanks for letting me know =).

What game do you have yourself (patch version)? Or rather, which one did you have when you cloned the clock? And do you know which version of S3OC you used (if that's what you used)?

eta: hm, but your clock seems to be quite different from my objects .. there is an XML but that's for one pattern, not a full preset like what I did (with channels and which patterns are used for which part and so on), and you have what looks like a perfectly valid material definition in the OBJD as well. To me it looks like this is where you reference your material XML, and you're using it to define colours and overlays for this particular material (instead of by editing typecodes) – is that right? Where is that material definition from, is that one that got included when you cloned the object?

Just to explain the difference: what I do, or try to do, is essentially replace the fallback preset with mine (not one material) and then delete everything else so it should use the fallback. The problem I have is that in some cases (for the thumbnail and when I place my object "too early"), it uses the fallback of the *original* instead – the object that mine is cloned from –, and I don't know why .. and in WA games, it doesn't seem to find the fallback at all. But I can see no difference between the original objects from WA and the base game .


It's good news that you managed to override the OBJD though, that's what failed completely for me. You OBJD isnt even mentioning this material anywhere (not by name I mean – it has leather and wood, and your XML is Plastic_Rubber/solidColourS2_1).

Since you say "hit and miss", what did your "miss" look like? Were objects solid colour, or did they use EA materials, or defaults .. ?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#4 Old 3rd Mar 2010 at 11:26 PM
I'm patched like you, but I think I was still non-patched when I made that clock, and I'm sure I was using the last stable s3pe.

The XML came from the Fullbuild0. The material definition is the clock's original and the TGI references the XML.

The I've been able to include a preset by XML, but never replace them. Maybe the problem you're having is a FNV hash problem, you know, the way some stuff has to have a hash of the file name and such?
My hits, everything worke the way it was supposed to. The misses were borked colors, the texture on the mesh wouldn't change but the CAS category would, brown or black textures, and other various monstrosities. I found it only worked with some consistency when I used a texture that was similarly constructed to the texture I was trying to replace. For example, a texture with one color I could only change to a texture with one color. I couldn't switch a wood texture to a fabric pattern with four colors. So it's something I've only used when the situation was right, i.e. the clock.

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Me? Sarcastic? Never.
staff: administrator
#5 Old 4th Mar 2010 at 12:26 AM
cmo you might be partly correct on the pattern and number of colors. My only success with changing values was with my lack surfaces. Each was changed to solid white color. I noticed in the string table that there are values for color 0-4, might that have to do with the colors available to each pattern?
Pettifogging Legalist!
retired moderator
Original Poster
#6 Old 4th Mar 2010 at 12:33 AM Last edited by plasticbox : 4th Mar 2010 at 12:50 AM.
Quote: Originally posted by cmomoney
Maybe the problem you're having is a FNV hash problem, you know, the way some stuff has to have a hash of the file name and such?

That might be – I didn't change any hashes myself, I rely entirely on s3pe/s3oc linking things correctly. Maybe it doesn't. The way I got my XML in there was open it and change the actual text in it, I didn't replace the resource with a new one. Maybe I should have.

It might very well be that there's still a hash somewhere in the package that refers to the original default instead of mine .. I wasn't able to see any reference when I looked for it (by TGI i mean), so perhaps it's referenced with an fnv that I can't decipher.

It does seem like *some* sort of linking problem in any case – the XML itself is working (I mean there's no garbage values or broken syntax or anything like that).


Quote: Originally posted by cmomoney
I found it only worked with some consistency when I used a texture that was similarly constructed to the texture I was trying to replace. For example, a texture with one color I could only change to a texture with one color.
This is a problem I know – from the editing-lots-of-typecodes way of doing it (what you describe in your tutorial). I guess in your clock the original materials in the OBJD still govern what variables *exist* for which material, so you can't replace what doesn't exist? I've tried adding "missing" typecodes before, without success, maybe I overlooked some or didn't delete some I should have deleted.

When I made presets that "matched" the original ones (in terms of what variables they use), I've had 100% success with your tutorial btw, no surprises. Except for lots and lots of typos, copypaste errors and missed minuses in front of numbers (resulting in green wood and the like).

However, when replacing the entire preset I never encountered this .. I haven't tested it very thorougly, but I did use a few different materials for it, one of them tile (2 channels) and one of them solid colour, the rest one channel paint and wood, and all of them worked .. I guess because the OBJD is a blank slate in my objects.



Quote: Originally posted by HugeLunatic
I noticed in the string table that there are values for color 0-4, might that have to do with the colors available to each pattern?


I'm pretty sure that's the channels! I have an object with a slightly wonky preset – same problem, but the other way aorund: I replaced a one channel material with a three channel one but since there were only typecodes for the *first* channel in the OBJD, it is now a white wood that looks white and behaves white, but when you CAST it the second and third channel show up as brown in the UI (I guess because that's the colours of the original thing or the fallback or whatever). .

There seems to be some sort of disconnect with what shows up on the object and what shows up in the UI.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
˙uʍop ǝpᴉsdn ǝɹ,noʎ 'oN
#7 Old 4th Mar 2010 at 1:49 AM
The Color values in the string table refer to color values in certain patterns. Some patterns use HSV and a few use the Color values (like florals). I think....

"Part of being a mesher is being persistent through your own confusedness" - HystericalParoxysm
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Pettifogging Legalist!
retired moderator
Original Poster
#8 Old 4th Mar 2010 at 2:02 AM
I've only seen Color being used in the SolidColor_Somethingorother materials from Misc and Plastic_Rubber, so far .. and once in a metal I believe, but I haven't done much with metals yet, and this metal was in the OLD\ category (in a game default, not in an actual object).

My impression is that Color is used for everything that's a flat shade (with a specular or none), and HSV (Shift and background HSV) for everything that uses a background image.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Back to top