[A17] CompFX

Started by CannibarRechter, October 01, 2017, 08:53:11 PM

Previous topic - Next topic

CannibarRechter

Hi,

I am releasing a new graphics tool called CompFX. It allows modders, using XML only, to attach a "comp" to any ThingWithComps in order to achieve an overlay effect (including animated overlays). It supports a very wide variety of overlays. It also supports UNDERLAYS. Proper use of the comp usually involves a patch, like this:


<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "FueledStove"]/comps</xpath>
<value>
<li Class="CR.CompProperties_FXOverlay">
<fxType>FX_Flash</fxType> <!-- optional, defaults to FX_Flash -->
<fxPath>FX/RedLight</fxPath> <!-- REQUIRED -->
<fxSize>1</fxSize> <!-- optional, defaults to 1 -->
<fxAbove>true</fxAbove>             <!-- optional, defaults to true -->
<fxTicks>10</fxTicks> <!-- optional, defaults to 60 -->
<fxAmount>5</fxAmount> <!-- required for some FX, see individual FX descr -->
<fxOption1>30</fxOption1> <!-- required for some FX, see individual FX descr -->
<fxOption2>0.2</fxOption2> <!-- required for some FX, see individual FX descr -->
<fxDependency>Fueled</fxDependency> <!-- optional, defaults to None -->
<fxOffset>(0,0,0.1)</fxOffset> <!-- optional, defaults to (0,0,0) -->
</li>
</value>
</Operation>


Documentation is included in the Examples/Example.xml directory. However, the basic gist of it is that CompFX supports the following FX types:


fxType (enum, default FX_Overlay):

FX_Overlay, // the effect is just to overlay the thing, that is all
FX_Flash,      // the effect is to appear and dissapear @fxTicks interval
FX_Animate,      // the effect is to overlay images in sequence @fxTicks interval
FX_Flicker, // the effect is random frames @fxTicks interval
FX_Spin,     // the effect is to spin around the middle; spin fxAmount (degrees) @fxTicks rate
FX_SpinJitter, // the effect is to periodically spin in a random direction and portion of @fxAmount (degrees) @fxTicks rate
FX_Pulse, // the effect is to grow and shrink by fxAmount @fxTicks rate
FX_Pop, // the effect is to grow--by fxAmount @fxTicks rate--and then start over
FX_Fade, // the effect is to fade in and out of transparency
FX_Mote         // the effect is animates versions of the frame into the air, like smoke


This is a tool for modders who want to graphically touch up rimworld. This mod makes use of one Harmony call in order to check to see if a work location has been worked at. This helps the tool able to satisfies the "Worked" dependency type. For example, you might have a stove smoke extra if it's been worked at. Currently supported dependencies are Powered, Fueled, Worked, and None.

For additional info see the Examples.xml file.

The download is found by following the link in my sig.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Canute

I think that should be moved/repost to the mod/tools section.

CannibarRechter

Yeah, I just added it over there. Because I originally found Jecrell's Tools on releases, I don't think I'm sure where to post.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Canute

Yeah, because jectools is needed for other mods, like hugslib.
Does your stuff get integrated into a mod, or it is a libary like hugslib ?

CannibarRechter

You would download it and put it in your mods list in order to make other mods work (any mod needing CompFX). It's not a "library" in the sense that you call code to use it. It enables XML patterns to work in other mods, and gives those patterns in game behavior.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

tobe

I think you're so nice modder.
People like me who want modding but can't code by c# are saved by your mod.
Thx for sharing your talent.

Kiame

Can this be used to add an overlay to apparel?

CannibarRechter

It can overlay any ThingWithComps. Apparel is a ThingWithComps.

I haven't tested Apparel yet.

One word of warning: Right now, while the overlays rotate POSITION with the rotation of an item, they do not rotate themselves. For example, if I were to have an FX labeled "fire" with the flames going "up," if the object were to rotate, the flames will always go "up". This can be the right thing (like with fire), but could be the wrong thing in some circumstances. This leads to some conditions where you can't use the overlay.

I'm working on that, starting with Multis.

This could be a problem with overlaying Apparel, depending on what you were trying to do. If it was just display a glowing light, it would be okay. But if it was a specific shape, that shape would be the same on any of the Apparel items, which might not be okay.

Hope you see what I'm saying.
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

Kiame

Yep totally makes sense. Yeah I was trying to add a layer which would be a static non-greyscale colored item to a place on the front of a piece of apparel.

Thanks for the response.