Turret missing top

Started by fanatictentacle, February 16, 2023, 06:45:35 AM

Previous topic - Next topic

fanatictentacle

Hi!
I am trying to add a new turret to the Science never stops mods (SNS). I am adding the turret through a new mod with a dependency to SNS. The turret becomes available after the correct research, it is buildable and it works as intended. During the blueprint phase (building) the complete turret is visible, but after completing the work only the base of the turret is visible. The top (gun) disappears. It can shoot, it seems that only the graphic is gone.

I have a copy of the gun graphic in my modfolder, I tried using the original gun from SNS.

This is the Def xml of the new turret:
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Perdition Stellar Turret -->

<ThingDef ParentName="BaseWeaponTurret">
<defName>SNS_Gun_Turret_EternalPerditionStellar</defName>
<label>eternal perdition stellar turret gun</label>
<description>The gun of an eternal perdition stellar turret.</description>
<graphicData>
<texPath>Things/Building/Security/SNS/turrets/SNSGunTurretEternalLight</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<statBases>
<AccuracyTouch>0.85</AccuracyTouch>
<AccuracyShort>0.85</AccuracyShort>
<AccuracyMedium>0.75</AccuracyMedium>
<AccuracyLong>0.65</AccuracyLong>
<RangedWeapon_Cooldown>0.17</RangedWeapon_Cooldown>
<DeteriorationRate>0</DeteriorationRate>
<Mass>1.5</Mass>
<Flammability>0</Flammability>
</statBases>
<verbs>
<li>
<verbClass>Verb_Shoot</verbClass>
<defaultProjectile>SNS_Gun_Turret_Bullet_LightCosmic</defaultProjectile>
<warmupTime>0</warmupTime>
<range>40</range>
<ticksBetweenBurstShots>0</ticksBetweenBurstShots>
<burstShotCount>1</burstShotCount>
<soundCast>Shot_ChargeRifle</soundCast>
<soundCastTail>GunTail_Medium</soundCastTail>
<muzzleFlashScale>10</muzzleFlashScale>
</li>
</verbs>
</ThingDef>

<ThingDef ParentName="BuildingBase">
<defName>SNS_Turret_EternalPerditionStellar</defName>
<label>eternal perdition stellar turret</label>
<description>A light automatic turret. Fires like at a rapid pace, spewing its reserves at whatever crosses its path without remorse or cooldown. It does not require refurbishment or refueling, ever, nor can it break down.</description>
<thingClass>Building_TurretGun</thingClass>
<graphicData>
<texPath>Things/Building/Security/SNS/bases/SNSTurretBaseSmall</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(2.5,2.5)</drawSize>

<damageData>
<rect>(0.2,0.2,0.6,0.6)</rect>
</damageData>

<shadowData>
<volume>(0.27,0.25,0.27)</volume>
<offset>(0,0,0)</offset>
</shadowData>
</graphicData>

<uiIconPath>Things/Building/Security/SNS/icons/SNSBuildingIcon_02PerditionLightTurret</uiIconPath>
<uiIconScale>0.90</uiIconScale>
<minifiedDef>MinifiedThing</minifiedDef>
<altitudeLayer>Building</altitudeLayer>
<stealable>false</stealable>
<rotatable>false</rotatable>

<thingCategories>
<li>BuildingsSecurity</li>
</thingCategories>

<statBases>
<MaxHitPoints>1500</MaxHitPoints>
<Flammability>0</Flammability>
<WorkToBuild>2800</WorkToBuild>
<Mass>1.5</Mass>
<Beauty>10</Beauty>
<ShootingAccuracyTurret>0.96</ShootingAccuracyTurret>
</statBases>

<tickerType>Normal</tickerType>

<comps>
<li Class="CompProperties_Forbiddable"/>
<li Class="CompProperties_Power">
<compClass>CompPowerTrader</compClass>
<basePowerConsumption>500</basePowerConsumption>
</li>
<li Class="CompProperties_Flickable"/>
</comps>

<passability>PassThroughOnly</passability>
<pathCost>50</pathCost>
<fillPercent>0.4</fillPercent>
<hasTooltip>true</hasTooltip>

<costList>
<SNS_Unobtainium>100</SNS_Unobtainium>
<SNS_CosmicMatter>50</SNS_CosmicMatter>
<Plasteel>50</Plasteel>
<ComponentIndustrial>4</ComponentIndustrial>
</costList>

<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<designationCategory>Security</designationCategory>
<constructionSkillPrerequisite>7</constructionSkillPrerequisite>

<building>
<combatPower>200</combatPower>
<ai_combatDangerous>false</ai_combatDangerous>
<turretGunDef>SNS_Gun_Turret_EternalPerditionStellar</turretGunDef>
<turretBurstCooldownTime>0.17</turretBurstCooldownTime>
</building>

<placeWorkers>
<li>PlaceWorker_TurretTop</li>
<li>PlaceWorker_ShowTurretRadius</li>
</placeWorkers>

    <researchPrerequisites>
      <li>SNS_Research_IV_cosmicturrets_III</li>
    </researchPrerequisites>
</ThingDef>

</Defs>

Whats wrong here?

blitz1259

Have you tried not using the full path to the graphic? i.e. instead of

<texPath>Things/Building/Security/SNS/turrets/SNSGunTurretEternalLight</texPath>

try just

<texPath>SNSGunTurretEternalLight</texPath>

Not sure if that will solve your issue, but that's how I refer to graphics.

Hope that helps!