Ludeon Forums

Ludeon Forums

  • August 03, 2021, 12:27:06 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: {Mod Request} Glowing Projectiles  (Read 2650 times)

CB elite

  • Guest
{Mod Request} Glowing Projectiles
« on: January 05, 2015, 04:23:26 PM »

I just think it would be nifty to have certain projectiles that gave off some sort of light glow as they traveled across the map. I've noticed a lot of laser-type weapons being released recently, and I think it would be really cool if their projectiles had a glow to them.

I'm sure it would require some .dll modding, but still! :)

-----

Note: If this has already been done, I would more than appreciate a link.
Logged

Oxidus

  • Drifter
  • **
  • Posts: 93
  • Sgt.Oxidus 101st Airborne
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #1 on: January 06, 2015, 04:02:03 AM »

They have a glow i think,Can you send pic?
Logged
Requiescat in Pace,Mio Fello.

aditaja

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #2 on: January 06, 2015, 08:40:59 AM »

Did you mean like this
Logged

CB elite

  • Guest
Re: {Mod Request} Glowing Projectiles
« Reply #3 on: January 06, 2015, 09:51:18 AM »

That's actually exactly what I meant :o
Logged

Tankh

  • Drifter
  • **
  • Posts: 26
  • Refugee
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #4 on: January 06, 2015, 09:54:52 AM »

a bit too much glow there imo, but I like the idea.
Logged

CB elite

  • Guest
Re: {Mod Request} Glowing Projectiles
« Reply #5 on: January 06, 2015, 11:41:45 AM »

a bit too much glow there imo, but I like the idea.

I agree. I'm only looking for a faint glow, but I'd be more than happy to know how that was accomplished.
Logged

S4NDBE4R

  • Muffalo
  • *
  • Posts: 13
  • Red Matter Researcher
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #6 on: January 06, 2015, 11:44:40 AM »

Looking forward to seeing how this is done, been wanting to do some things with ambiance. Maybe digging into one of the other light mods can give a bases of how its accomplished?
Logged

skullywag

  • Global Moderator
  • Transcendent
  • ***
  • Posts: 5868
  • Engineer
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #7 on: January 06, 2015, 11:57:26 AM »

But now show it animated.....
Logged
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

S4NDBE4R

  • Muffalo
  • *
  • Posts: 13
  • Red Matter Researcher
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #8 on: January 06, 2015, 02:47:32 PM »

Hey, so i just dug into the actual light defs. It looks like all you will need is this little bit of code here.
Code: [Select]
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <glowRadius>0</glowRadius>
        <glowColor>(0,0,0,0)</glowColor>
      </li>
    </comps>
You'll want to put that at the end of the bullet base for your weapon. DO NOT put it in the actual labeled bullet def for the gun, this way it will track the bullet, preventing a graphical error. So it should look something like this.
Code: [Select]
  <ThingDef Name="BaseBullet" Abstract="True">
    <category>Projectile</category>
    <tickerType>Normal</tickerType>
    <altitudeLayer>Projectile</altitudeLayer>
    <thingClass>Bullet</thingClass>
    <label>bullet</label>
    <useStandardHealth>False</useStandardHealth>
    <neverMultiSelect>True</neverMultiSelect>
    <shaderType>Transparent</shaderType>
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <glowRadius>4</glowRadius>
        <glowColor>(217,0,0,0)</glowColor>
      </li>
    </comps>
  </ThingDef>
Of course changing out the glow color numbers will result in different colors. Right now it's set at red. Hope this helped

-Edit:

With all that said, changing BaseBullet will affect all bullets in the xml. So if you're wanting different colors, or having a mix of glowing and non glowing, make sure you have all new xmls for each type.
« Last Edit: January 06, 2015, 03:03:48 PM by S4NDBE4R »
Logged

CB elite

  • Guest
Re: {Mod Request} Glowing Projectiles
« Reply #9 on: January 07, 2015, 12:05:11 AM »

I remember attempting this by putting that comp in the projectile def, but that never worked. Thanks for showing how this is accomplished!

The only thing I don't like is how the glow is rendered as the projectile travels...

Slower projectiles obviously look a lot smoother than fast ones, but "glowy" beams aren't typically slow :P lol

Perhaps a future alpha will allow for smoother rendering of these glows? :)
Logged

skullywag

  • Global Moderator
  • Transcendent
  • ***
  • Posts: 5868
  • Engineer
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #10 on: January 07, 2015, 06:02:13 AM »

This was why i asked for it to be shown in motion, the lighting is grid based, its always gonna be strange looking when moving unless Tynan changes that, which I doubt will happen.
Logged
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

S4NDBE4R

  • Muffalo
  • *
  • Posts: 13
  • Red Matter Researcher
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #11 on: January 07, 2015, 08:23:30 AM »

I remember attempting this by putting that comp in the projectile def, but that never worked. Thanks for showing how this is accomplished!

The only thing I don't like is how the glow is rendered as the projectile travels...

Slower projectiles obviously look a lot smoother than fast ones, but "glowy" beams aren't typically slow :P lol

Perhaps a future alpha will allow for smoother rendering of these glows? :)

Yeah.. That's something I'm actually going to be looking into sometime later (unless someone knows this already). I am guessing that if you change the ticker, it might render faster? Seems to me that anything traveling over 94 speed is noticeable. So it would seem that we are stuck with "plasma" weapons for now haha.
Logged

aditaja

  • Muffalo
  • *
  • Posts: 4
  • Refugee
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #12 on: January 07, 2015, 11:18:59 AM »

Hey, so i just dug into the actual light defs. It looks like all you will need is this little bit of code here.
Code: [Select]
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <glowRadius>0</glowRadius>
        <glowColor>(0,0,0,0)</glowColor>
      </li>
    </comps>
You'll want to put that at the end of the bullet base for your weapon. DO NOT put it in the actual labeled bullet def for the gun, this way it will track the bullet, preventing a graphical error. So it should look something like this.
Code: [Select]
  <ThingDef Name="BaseBullet" Abstract="True">
    <category>Projectile</category>
    <tickerType>Normal</tickerType>
    <altitudeLayer>Projectile</altitudeLayer>
    <thingClass>Bullet</thingClass>
    <label>bullet</label>
    <useStandardHealth>False</useStandardHealth>
    <neverMultiSelect>True</neverMultiSelect>
    <shaderType>Transparent</shaderType>
    <comps>
      <li>
        <compClass>CompGlower</compClass>
        <glowRadius>4</glowRadius>
        <glowColor>(217,0,0,0)</glowColor>
      </li>
    </comps>
  </ThingDef>
Of course changing out the glow color numbers will result in different colors. Right now it's set at red. Hope this helped

-Edit:

With all that said, changing BaseBullet will affect all bullets in the xml. So if you're wanting different colors, or having a mix of glowing and non glowing, make sure you have all new xmls for each type.

No , dont use it at the projectile data , use it like this
Code: [Select]
<ThingDef ParentName="BaseBullet">
    <defName>Bullet_Pistol</defName>
    <label>pistol bullet</label>
    <graphicPath>Things/Projectile/Bullet_Small</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <DamageAmountBase>10</DamageAmountBase>
      <Speed>55</Speed>
    </projectile>
    <comps>
<li>
<compClass>CompGlower</compClass>
<glowRadius>5</glowRadius>
<glowColor>(199,22,164,0)</glowColor>
</li>
    </comps>

  </ThingDef>
it will make bullet color like picture that im post before , and for specific bullet type ...
PS: sorry for my bad english ...  ;D
Logged

S4NDBE4R

  • Muffalo
  • *
  • Posts: 13
  • Red Matter Researcher
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #13 on: January 07, 2015, 11:57:47 AM »

No , dont use it at the projectile data , use it like this
Code: [Select]
<ThingDef ParentName="BaseBullet">
    <defName>Bullet_Pistol</defName>
    <label>pistol bullet</label>
    <graphicPath>Things/Projectile/Bullet_Small</graphicPath>
    <graphicClass>Graphic_Single</graphicClass>
    <projectile>
      <flyOverhead>false</flyOverhead>
      <damageDef>Bullet</damageDef>
      <DamageAmountBase>10</DamageAmountBase>
      <Speed>55</Speed>
    </projectile>
    <comps>
<li>
<compClass>CompGlower</compClass>
<glowRadius>5</glowRadius>
<glowColor>(199,22,164,0)</glowColor>
</li>
    </comps>

  </ThingDef>
it will make bullet color like picture that im post before , and for specific bullet type ...
PS: sorry for my bad english ...  ;D

The reason why I said use it in the basebullet is that the way you have it will run into graphical errors when there are more than just one gun shooting off. I tested it and confirmed this. Its mainly when they are taking cover. There are also times where the glow will stay at the spawn of the bullet through the lifespan of the bullet, making the person shooting the gun very vulnerable at night.

You could make an expanded basebullet (how food is derived), which should work just fine, keeping it all in one nice "neat" file. But to put it on the actual labeled bullet def will lead to complications.
Logged

Berengar

  • Colonist
  • ***
  • Posts: 159
  • Refugee
    • View Profile
Re: {Mod Request} Glowing Projectiles
« Reply #14 on: January 08, 2015, 04:44:11 PM »

What an amazing idea! when you dont have anithing against, i will put that in my mod. ^^
Logged