Beam Extensions - SmArtKar/AthenaFramework GitHub Wiki
Athena Framework allows modders to create Thing-based beams. (instead of vanilla's mote stream beams)
Your thing's thingClass
should be set to BeamRenderer
or it's child. It'll also need a BeamExtension
mod extension which will hold your beam's parameters.
public class BeamExtension : DefModExtension
{
// Range at which the beam is cut
public float maxRange;
// Delay between beam frames
public int textureChangeDelay;
// Amount of texture frames
public int textureFrameAmount = 1;
// Amount of textures for different beam lengths
public int sizeTextureAmount = 1;
// Duration after which beam will be destroyed. Disabled if set to -1
public int beamDuration = -1;
}
AF's beams can cycle through multiple textures based both on current tick(like frames) and on beam's current length. Your beam's textures could be set in multiple ways:
When your beam only has one frame and one size texture:
BeamTexPath
Due to how game loads it's assets, it's important that BeamTexPath.png
still exists, even if your beam uses frame/size textures.
When your beam has only one size texture but multiple frames:
BeamTexPath
BeamTexPath1
BeamTexPath2
BeamTexPath3
When your beam has only one frame but multiple size textures
BeamTexPath
BeamTexPathA
BeamTexPathB
BeamTexPathC
When your beam has both multiple frames and size textures
BeamTexPath
BeamTexPathA1
BeamTexPathA2
BeamTexPathB1
BeamTexPathB2