Transparent Stuff properties?

Started by Tenshi~Akari, May 01, 2021, 07:20:53 AM

Previous topic - Next topic

Tenshi~Akari

So, I've been trying to get Revolus' Semi-Transparent Materials mod to work for quite a while now, due to the fact a personal mod project of mine sort of has a prismatic crystal theme that would greatly benefit from transparent resources.

However, the unfortunate facts that impede my progress is there was absolutely no example XML included of how & where in the ThingDefs to use the mentioned properties, and I am but a simple XML baby modder that has tried every possible thing known in my capacity to get this working with absolutely no luck.

Has anyone been able to work this mod out before? As it stands now, the resource I have set up that I'd like to make stuffed transparent items from has its own set of walls/furniture/weapons that already uses the default Transparency shader and edited art for testing, but for usage with vanilla and other modded furniture that relies on stuffed properties, I was hoping to allow for what I've seen in the preview screenshot to happen when used as a resource.

m1st4x

Quote
Q: How do I use it?
A: It's a modding tool. It adds an XML attribute "Revolus.TransparentStuff.Opacity" for
<ThingDef>s. Its values may be between 0.5 and 1.0. It is an engine restriction
that higher transparency is not possible. The attribute must be set in the <ThingDef>s
directly, not its "ParentName"!

Have you tried sth like this?


<ThingDef ParentName="ResourceBase">
    <defName>YourDef</defName>
    ...
    <Revolus.TransparentStuff.Opacity>0.5</Revolus.TransparentStuff.Opacity>
    ...
</ThingDef>

Tenshi~Akari

That was the first thing I tried, but it doesn't work. Nothing with the resource I want to show transparency shows up transparent, and in my Player.log file I've gotten this as the reason:

"XML error: <Revolus.TransparentStuff.Opacity>0.5</Revolus.TransparentStuff.Opacity> doesn't correspond to any field in type ThingDef. "

I've tried formatting it as a comp as well based on what parts I could see from the source code provided, and while it doesn't throw errors, that hasn't shown any visible results either...  so I'm at a complete loss of how to get it working as the creator visualized in the screenshot. :(

m1st4x

Quote
Q: Loading order?
A: After any mod that uses this feature.
Did you follow this?

What happens if you take an existing ThingDef (like Bamboo from VGP) and add the attribute there?

Tenshi~Akari

It's definitely been loaded after my resource mod, I made sure of that. Same results: the above error in the player log and no stuff transparency visible. I've pretty much followed what was mentioned on the steam post, but no luck.

My resource is literally a stone block clone, so I should have been able to see something happening. Trying the same thing with other existing resources also was a no-go for some reason... so I feel like either there is something else I'm just either outright missing, or perhaps the assembly file might need an update? (The latter I was hoping that wouldn't be the case...)

Posting the ThingDef portion for review if needed. I had hoped to be able to see if it worked so I could change over to patching it in once knowing for sure things worked fine.


      <ThingDef ParentName="ResourceBase">
<defName>CrystalSlabs</defName>
<label>crystal slabs</label>
<description>Made from beautiful shards of crystal harvested from geodes. Used as base building materials for furniture and structures.</description>
<graphicData>
<texPath>Things/Item/Crystal/Slabs</texPath>
<graphicClass>Graphic_StackCount</graphicClass>
</graphicData>
<useHitPoints>false</useHitPoints>
<castEdgeShadows>false</castEdgeShadows>
<statBases>
<Mass>3</Mass>
<MarketValue>15</MarketValue>
</statBases>
<thingCategories>
<li>ResourcesRaw</li>
</thingCategories>
<stackLimit>150</stackLimit>
<Revolus.TransparentStuff.Opacity>0.5</Revolus.TransparentStuff.Opacity>
<stuffProps>
<categories>
<li>Crystal</li>
<li>Stony</li>
</categories>
<constructEffect>ConstructMetal</constructEffect>
<soundImpactStuff>BulletImpact_Metal</soundImpactStuff>
<soundMeleeHitSharp>MeleeHit_Stone</soundMeleeHitSharp>
<soundMeleeHitBlunt>MeleeHit_Stone</soundMeleeHitBlunt>
<stuffAdjective>crystal</stuffAdjective>
<commonality>0.012</commonality>
<!--<color>(255,225,215)</color>-->
<statOffsets>
<Beauty>12</Beauty>
</statOffsets>
<statFactors>
<Beauty>3.12</Beauty> 
<WorkToBuild>5.0</WorkToBuild>
<WorkToMake>1.1</WorkToMake>
<Flammability>0</Flammability>
</statFactors>
</stuffProps>
<smeltable>false</smeltable>
<filthLeaving>BrokenCrystal</filthLeaving>
</ThingDef>



m1st4x

It doesn't work for me either - same error.
This feature might have been removed with 1.2 update?!
Cannot say more atm. Maybe you can contact the creator of the mod...

Canute

2 other mods that comes in mind when i read Transparent.
- Dub's Skylight
- Expanded Roofing https://steamcommunity.com/sharedfiles/filedetails/?id=1512478761

Maybe take a look there how they made the roof visible but transparent.

Tenshi~Akari

I know I should've said this earlier, but I do appreciate the help on this. Thanks for trying to figure it out with me.  :)

Canute: The difference between Semi-Transparent stuff & Dubs Skylights/Expanded Roofing is the first one is meant to affect stuff properties & making anything that uses affected stuff have a transparent look to them (be it vanilla/modded furniture, walls, weapons), while the other 2 are their own separate types of items that don't particularly rely on "stuffed" materials for visible transparency. I've pretty much done similar to those mentioned mods in having my own separate objects that rely on the resource to be built & have those transparent either through shaderType, or just making it look see-through via the WIP artworks themselves. What I would like is to be able to have a stuff resource be able to affect vanilla/stuffable objects visibly like Revolus managed to do. I just want to be able to find out exactly how he did it, which brings me to my next problem...

m1st4x: I would very much like to get in contact w/ the creator, but I do not have (and do not wish to make) a Steam account for reasons, and it appears the profile is set to private anyways, so I'm not sure how else to get in contact seeing as they haven't even been active since before 1.2 dropped.

Guess I'll put this part off for now... I was kind of also hoping to edit gemstone mods to have some translucency in their stuff properties, too, but I guess unless a miracle update to the mod happens or I figure out what's the right way to make it work whenever I have the patience to try something out XML-wise.

Thanks again for all the help!

m1st4x

I have a steam account but for any strange reason I'm not allowed to comment anything inside the workshop. I read it's just allowed if you've ever deposited sth, so I asked a friend who did but he couldn't either^^