Ludeon Forums

Ludeon Forums

  • May 06, 2021, 09:20:59 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Transparent Stuff properties?  (Read 111 times)

Tenshi~Akari

  • Colonist
  • ***
  • Posts: 230
  • Refugee
    • View Profile
Transparent Stuff properties?
« on: May 01, 2021, 07:20:53 AM »

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.
Logged

m1st4x

  • Drifter
  • **
  • Posts: 63
  • Refugee
    • View Profile
Re: Transparent Stuff properties?
« Reply #1 on: May 04, 2021, 04:29:12 AM »

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?

Code: [Select]
<ThingDef ParentName="ResourceBase">
    <defName>YourDef</defName>
    ...
    <Revolus.TransparentStuff.Opacity>0.5</Revolus.TransparentStuff.Opacity>
    ...
</ThingDef>
Logged

Tenshi~Akari

  • Colonist
  • ***
  • Posts: 230
  • Refugee
    • View Profile
Re: Transparent Stuff properties?
« Reply #2 on: May 04, 2021, 11:35:03 AM »

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. :(
Logged

m1st4x

  • Drifter
  • **
  • Posts: 63
  • Refugee
    • View Profile
Re: Transparent Stuff properties?
« Reply #3 on: May 04, 2021, 11:57:28 AM »

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?
Logged

Tenshi~Akari

  • Colonist
  • ***
  • Posts: 230
  • Refugee
    • View Profile
Re: Transparent Stuff properties?
« Reply #4 on: May 05, 2021, 02:35:27 AM »

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.

Code: [Select]
      <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>

Logged