Skip to content

Expandable projectiles

KylianB edited this page Dec 23, 2020 · 2 revisions

Expandable projectile def can be used to create flames or other liquid-shaped projectiles that need to expand in size. The basic XML example is:

	<VFECore.ExpandableProjectileDef ParentName="BaseBullet">
		<defName>Flamethrower</defName>
		<label>flamethrower</label>
		<thingClass>VFECore.FlamethrowProjectile</thingClass> <!-- this class inherited from the ExpandableProjectile class, it inherits the DoDamage method, which is responsible for the appearance of fire and damaging all things under the projectile -->
		<graphicData>
			<texPath>Flamer</texPath> <!-- main texture series, it's just a folder with textures. it sorts them alphabetically, there is no need to fill in A-Z at the end and you are also not limited to all letters of the alphabet, 01, 02 will do -->
			<texPathFadeOut>FlamerFadeOut</texPathFadeOut> <!-- optional, if set, fading out textures will be used in final projectile moments -->
			<shaderType>MoteGlow</shaderType> <!-- optional, if not set, it will use defaul shader>
			<color></color> <!--optional, you can set the opacity via alpha channel -->
		</graphicData>
		<projectile> <!-- vanilla projectile field -->
			<damageDef>Flame</damageDef>
			<speed>25</speed>
			<damageAmountBase>1</damageAmountBase>
			<explosionRadius>0.1</explosionRadius >
			<ai_IsIncendiary>true</ai_IsIncendiary>
		</projectile>
		<drawOffscreen>true</drawOffscreen> <!-- needed to draw them properly -->
		<lifeTimeDuration>70</lifeTimeDuration> <!-- total life time duration, the counter counts every tickFrameRate property -->
		<widthScaleFactor>0.75</widthScaleFactor> <!-- optional, will scale the width of the projectile textures -->
		<heightScaleFactor>1</heightScaleFactor> <!-- optional, will scale the heigth of the projectile textures -->
		<startingPositionOffset>(0, 0, -1)</startingPositionOffset> <!-- if you need to position starting projectile position (for big dragons and flamethrowers etc -->
		<totalSizeScale>1.15</totalSizeScale> <!-- optional, will scale the size of projectile textures. was needed in order to scale Oskars textures properly to fit them after the shooter -->
		<tickFrameRate>3</tickFrameRate> <!-- speed of changing textures per ticks -->
		<finalTickFrameRate>9</finalTickFrameRate> <!-- speed of changing fade out textures per ticks -->
		<tickDamageRate>1</tickDamageRate> <!-- determines through which each tick the damage is done by the custom class (fire class for example) -->
		<minDistanceToAffect>2</minDistanceToAffect> <!-- can be set to ignore the affected cells nearby (useful if you do not need to burn sandbags or other buildings)
	</VFECore.ExpandableProjectileDef>

VFE Core

General Comp classes

General DefModExtensions

Item Processor

PipeSystem

Custom Structure Generation

Multi Verb Combat Framework - MVCF

Animal Behaviours

Genes

Apparel

Cuisine

Furniture

Plants

Deprecated

Clone this wiki locally