Beam ThingDefs - SmArtKar/AthenaFramework GitHub Wiki

Beam thingdefs must follow some conditions: drawOffscreen must be set to true or you might experience random disappearances when more than a half of the beam is offscreen tickerType must be set to normal drawerType must be set to RealtimeOnly to prevent tearing

It's also recommended to set these three fields to the following values to prevent your beams from being selected by the player

    <useHitPoints>false</useHitPoints>
    <selectable>false</selectable>
    <neverMultiSelect>true</neverMultiSelect>

Here's an example of a beam thingdef that has 3 frames, changes a frame every 5 screen updates and has 3 variations based on it's range

  <ThingDef>
    <defName>AthenaBeam</defName>
    <label>athena beam</label>
    <description>An active beam made using athena framework.</description>
    <thingClass>AthenaFramework.Beam</thingClass>
    <graphicData>
      <texPath>Things/Effects/AthenaBeam</texPath>
      <shaderType>MoteGlow</shaderType>
      <graphicClass>Graphic_Single</graphicClass>
      <drawSize>(5, 1)</drawSize>
    </graphicData>
    <drawOffscreen>true</drawOffscreen>
    <category>Projectile</category>
    <tickerType>Normal</tickerType>
    <altitudeLayer>MoteOverhead</altitudeLayer>
    <useHitPoints>false</useHitPoints>
    <selectable>false</selectable>
    <neverMultiSelect>true</neverMultiSelect>
    <drawerType>RealtimeOnly</drawerType>

    <modExtensions>
      <li Class="AthenaFramework.BeamExtension">
        <maxRange>25.9</maxRange>
        <textureFrameAmount>3</textureFrameAmount>
        <textureChangeDelay>5</textureChangeDelay>
        <sizeTextureAmount>3</sizeTextureAmount>
      </li>
    </modExtensions>
  </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️