Way to make glowing pawns?

Started by XenGrimm, January 23, 2017, 06:40:30 AM

Previous topic - Next topic

XenGrimm

I've been working on several custom creatures (They're available on steam workshop, I'll post them up here soon) - one of which is a large "Spirit Wolf" that I am trying to apply a subtle glow effect to.

The problem is: The glow effect is not sticking to the pawn - it's sticking at their spawn location.

I'm trying to use this bit of code to apply the glow effect:

<comps>
      <li Class="CompProperties_Glower">
        <glowRadius>4</glowRadius>
        <glowColor>(46,161,228,0)</glowColor>
      </li>
</comps>


Can anyone shed any light on my light shedding issue?

EDIT: So - upon some further research, it seems Rimworld does not support movable lightsources without making a custom DLL or something. Burned.

Does anyone have anything like this in the works? Can anyone point me somewhere useful? Or is this a lost cause?

Vandris

I believe you can make something not be affected by lighting, which would be a cheap way to make something appear "glowing" but I'd say best bet is to try C# to actually make a mobile light source. I'm still a noob though, don't know a thing about C#
Not all who wander are lost. But oh boy, I sure am.

forestfey

you might be interested in looking at the Mining Helmet:
https://ludeon.com/forums/index.php?topic=14711.msg153940#msg153940

And what an interesting idea btw, I asked myself inspired by this if you can make slightly transparent textures? Have you tried that, it might be a nice effect, too?
Let me know if it works, I might be interested in using something like this, too :)
"Despite all our accomplishments, we owe our existence to a six-inch layer of top-soil and the fact that it rains."
_
Klirrend klare Nacht
funkelt durch den Schleier.
Entfaltung nach innen

Jingling clear night
Sparkles through the veil.
Unfolding inwards

Vandris

Haven't looked at the mining helmet's files, but does it work because the lighting is assigned to a thing (helmet) that is then worn by a pawn? If so, you could make an invisible item for your creatures to wear in a similar way. Definitely is a cool concept. I hope it can work. :)
Not all who wander are lost. But oh boy, I sure am.

forestfey

actually, I haven't looked myself yet. I just linked it to you so you could get on crackin' ;)
I'm working on different construction sites at the moment. Please take a look how it's exactly done for yourself^^ I don't know if and when I get to it... but you're asking the right question I'd say! =)
"Despite all our accomplishments, we owe our existence to a six-inch layer of top-soil and the fact that it rains."
_
Klirrend klare Nacht
funkelt durch den Schleier.
Entfaltung nach innen

Jingling clear night
Sparkles through the veil.
Unfolding inwards

squirrel gnut

I wonder if you created a Fang(s) for the Spirit Wolf, much like the Thrumbo Horn, and then added the glowing verse to the Fang(s)...that might solve your problem. I am interested in adding glowing to Core and other Mod items...just can't figure out how to make a new Mod def that will work. Seems simple...but...

XenGrimm

Looking at the mining helmet assembly - I think the key piece of code would be

IntVec3 intVec = IntVec3Utility.ToIntVec3(this.wearer.get_DrawPos());
if ((!ThingUtility.DestroyedOrNull(this.light) && intVec != this.light.get_Position()) || this.refreshIsNecessary)


the rest of the assembly seems to be rules for when people wearing the helmets should switch the light on or off.

Is there someone more familiar with C# who can tell me what I need to change for this?

I'm thinking I have to assign a new animal pawn class (newpawnytpe for hypothetical) within the assembly (and likely XMLs also?) and use this.newpawntype.get_Drawpos


Also - thanks a million for the info thus far. The mining helmet link was ESPECIALLY helpful.

XenGrimm

Quote from: squirrel gnut on January 23, 2017, 05:19:03 PM
I wonder if you created a Fang(s) for the Spirit Wolf, much like the Thrumbo Horn, and then added the glowing verse to the Fang(s)...that might solve your problem. I am interested in adding glowing to Core and other Mod items...just can't figure out how to make a new Mod def that will work. Seems simple...but...

Well, the thrumbo horn and elephant tusk aren't actually ITEMS until the creature dies and they are dropped.

I don't think it's calling any graphic data for the horns or tusks, just using them as a damage base.

forestfey

^interesting. And good to see some progress/learning! TEAMWÖÖÖRK  ;D
"Despite all our accomplishments, we owe our existence to a six-inch layer of top-soil and the fact that it rains."
_
Klirrend klare Nacht
funkelt durch den Schleier.
Entfaltung nach innen

Jingling clear night
Sparkles through the veil.
Unfolding inwards