Ludeon Forums

RimWorld => Mods => Topic started by: Seikikai on August 09, 2016, 05:39:17 PM

Title: [Request] Firefoam Mortar
Post by: Seikikai on August 09, 2016, 05:39:17 PM
Glitertech Mod Have A Cool Weapon Set Called APB-1 That Are Laser Weapons That Makes The Target Burn. It's The Perfect Gun Against All Enemies Specially Those Ones With Heavy Weapons. The Only Problem Is That It Creates Fires All The Time Making Fires Become So Annoying.

Because That I Decided To Create A Mortar Type Turred That Fires Firefoam Poppers -To Don't Add A 1 Single Use Item-. The Final Product Was A Manned Mortar That Fire A Non-Damage Projectile That Creates A 8r Firefoam Area Preventing Future Fires But It Doesn't Extinguish Fires In Objects (Grass, Corpses..) Also It Can't Be Reloaded Because I Wasn't Able To Found A Way To Use Minified Poppers As Ammo.

Atm I'm Trying To Learn Programming In C# And About Rimworld Modding, But Been Dificult For The Lack Of Tutorials Or Info So Is Possible That Finish This Take Me A Long Time. I Know That Many People Would Like Something Like This So If Anyone Can And Is Interested Please Do It :)
Title: Re: [Request] Firefoam Mortar
Post by: Illusion Distort on August 09, 2016, 09:48:19 PM
If you have something you've worked on, feel free to post it, could maby help getting someone to do it.
I can look into it, no promisses tho.
Title: Re: [Request] Firefoam Mortar
Post by: Reviire on August 09, 2016, 11:37:13 PM
I might fuck around a bit and see if I can do it.
EDIT: http://puu.sh/qvX7A.jpg
http://puu.sh/qvX8I.jpg

<ThingDef ParentName="BaseBullet">
    <defName>Bullet_MortarFoam</defName>
    <label>foam mortar bomb</label>
    <graphicData>
      <texPath>Things/Projectile/ShellEMP</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
    <thingClass>Projectile_Explosive</thingClass>
    <projectile>
      <damageDef>Extinguish</damageDef>
      <damageAmountBase>200</damageAmountBase>
      <speed>41</speed>
      <explosionRadius>8.5</explosionRadius>
      <flyOverhead>true</flyOverhead>
      <soundHitThickRoof>ArtilleryHitThickRoof</soundHitThickRoof>
      <soundExplode>ExtinguisherExplosion</soundExplode>
      <soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
      <soundAmbient>MortarRound_Ambient</soundAmbient>
  <preExplosionSpawnThingDef>FilthFireFoam</preExplosionSpawnThingDef>
  <explosionSpawnChance>1.0</explosionSpawnChance>
    </projectile>

  </ThingDef>

This projectile works in vanilla, you'll need to add a new type of mortar to use it though, probably.
Title: Re: [Request] Firefoam Mortar
Post by: Seikikai on August 10, 2016, 02:04:21 AM
This Is What I Have Atm :)


<?xml version="1.0" encoding="utf-8" ?>
<ThingDefs>

<ThingDef ParentName="BaseBullet">
<defName>Bullet_FirefoamCapsule</defName>
<label>Firefoam Capsule</label>
<graphicData>
    <texPath>Things/Projectile/FirefoamCapsule</texPath>
    <graphicClass>Graphic_Single</graphicClass>
    <shaderType>TransparentPostLight</shaderType>
</graphicData>
<thingClass>Projectile_Explosive</thingClass>
<projectile>
    <damageDef>Extinguish</damageDef>
    <damageAmountBase>100</damageAmountBase>
    <speed>60</speed>
    <explosionRadius>8</explosionRadius>
    <preExplosionSpawnThingDef>FilthFireFoam</preExplosionSpawnThingDef>
    <explosionSpawnChance>1</explosionSpawnChance>
    <flyOverhead>true</flyOverhead>
<soundHitThickRoof>ArtilleryHitThickRoof</soundHitThickRoof>
    <soundExplode>Explosion_Stun</soundExplode>
    <soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
    <soundAmbient>MortarRound_Ambient</soundAmbient>
</projectile>
</ThingDef>

<ThingDef ParentName="BaseArtilleryWeapon">
<defName>Artillery_MortarFirefoam</defName>
    <label>Firefoam Mortar</label>
    <description>Firefoam mortar launcher. Lobs fire-extinguisher capsules over walls. Must be manned. Inaccurate but long-ranged.</description>
    <techLevel>Industrial</techLevel>
    <destroyOnDrop>True</destroyOnDrop>
    <menuHidden>True</menuHidden>
    <tradeability>Never</tradeability>
    <statBases>
    <MarketValue>1500</MarketValue>
    <AccuracyTouch>0.79</AccuracyTouch>
    <AccuracyShort>0.42</AccuracyShort>
    <AccuracyMedium>0.18</AccuracyMedium>
    <AccuracyLong>0.06</AccuracyLong>
    <RangedWeapon_Cooldown>34</RangedWeapon_Cooldown>
    </statBases>
    <weaponTags>
    <li>Artillery</li>
    </weaponTags>
    <verbs>
    <li>
        <verbClass>Verb_Shoot</verbClass>
        <forceNormalTimeSpeed>false</forceNormalTimeSpeed>
        <hasStandardCommand>true</hasStandardCommand>
        <projectileDef>Bullet_FirefoamCapsule</projectileDef>
        <forcedMissRadius>8</forcedMissRadius>
        <ai_IsIncendiary>true</ai_IsIncendiary>
        <warmupTicks>500</warmupTicks>
        <minRange>30</minRange>
        <range>500</range>
        <burstShotCount>1</burstShotCount>
        <soundCast>Mortar_LaunchA</soundCast>
        <muzzleFlashScale>16</muzzleFlashScale>
    </li>
    </verbs>
</ThingDef>

<ThingDef ParentName="BuildingBase">
<defName>Turret_MortarFirefoam</defName>
<label>firefoam mortar</label>
<thingClass>Building_TurretGun</thingClass>
<graphicData>
<texPath>Things/Building/Security/TurretFirefoamMortarBase</texPath>
<graphicClass>Graphic_Single</graphicClass>
<drawSize>(4,4)</drawSize>
<damageData>
<rect>(0.38,0.2,0.56375,0.8)</rect>
<cornerTL>Damage/Corner</cornerTL>
</damageData>
</graphicData>
<minifiedDef>MinifiedFurniture</minifiedDef>
<altitudeLayer>Building</altitudeLayer>
<hasInteractionCell>false</hasInteractionCell>
<interactionCellOffset>(0,0,-1)</interactionCellOffset>
<stealable>false</stealable>
<statBases>
<MaxHitPoints>180</MaxHitPoints>
<Flammability>1.0</Flammability>
<WorkToMake>2700</WorkToMake>
<Beauty>-60</Beauty>
</statBases>
<tickerType>Normal</tickerType>
<comps>
<li Class="CompProperties_Explosive">
<explosiveRadius>4.9</explosiveRadius>
<explosiveDamageType>Flame</explosiveDamageType>
</li>
<li Class="CompProperties_Forbiddable"/>
</comps>
<description>A mortar that launches firefoam capsules. Explodes when damaged.</description>
<size>(2,2)</size>
<passability>PassThroughOnly</passability>
<pathCost>50</pathCost>
<fillPercent>0.4</fillPercent>
<castEdgeShadows>true</castEdgeShadows>
<stuffCategories>
<li>Metallic</li>
</stuffCategories>
<costStuffCount>100</costStuffCount>
<costList>
<Steel>150</Steel>
<Component>4</Component>
</costList>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<designationCategory>Security</designationCategory>
<building>
<turretGunDef>Artillery_MortarFirefoam</turretGunDef>
<turretShellDef>ArtilleryShell</turretShellDef>
<turretBurstWarmupTicks>300</turretBurstWarmupTicks>
<turretBurstCooldownTicks>3000</turretBurstCooldownTicks>
<turretTopgraphicPath>Things/Building/Security/FirefoamGun</turretTopgraphicPath>
<buildingTags>
<li>Artillery</li>
</buildingTags>
</building>
<designationHotKey>Misc4</designationHotKey>
<placeWorkers>
<li>PlaceWorker_NotUnderRoof</li>
</placeWorkers>
<researchPrerequisites>
<li>Mortars</li>
    <li>Firefoam</li>
</researchPrerequisites>
</ThingDef>

</ThingDefs>
Title: Re: [Request] Firefoam Mortar
Post by: Reviire on August 10, 2016, 02:05:50 AM
Quote from: Seikikai on August 10, 2016, 02:04:21 AM
This Is What I Have Atm :)
Well tell me if you get it all sorted.
Title: Re: [Request] Firefoam Mortar
Post by: Seikikai on August 10, 2016, 12:07:02 PM
Not Yet, That Code Is The Code That Had Before Creating The Topic :1
Title: Re: [Request] Firefoam Mortar
Post by: Master Bucketsmith on August 11, 2016, 08:12:31 AM
Quote from: Reviire on August 09, 2016, 11:37:13 PM
I might fuck around a bit and see if I can do it.
EDIT: http://puu.sh/qvX7A.jpg
http://puu.sh/qvX8I.jpg

<ThingDef ParentName="BaseBullet">
    <defName>Bullet_MortarFoam</defName>
    <label>foam mortar bomb</label>
    <graphicData>
      <texPath>Things/Projectile/ShellEMP</texPath>
      <graphicClass>Graphic_Single</graphicClass>
      <shaderType>TransparentPostLight</shaderType>
    </graphicData>
    <thingClass>Projectile_Explosive</thingClass>
    <projectile>
      <damageDef>Extinguish</damageDef>
      <damageAmountBase>200</damageAmountBase>
      <speed>41</speed>
      <explosionRadius>8.5</explosionRadius>
      <flyOverhead>true</flyOverhead>
      <soundHitThickRoof>ArtilleryHitThickRoof</soundHitThickRoof>
      <soundExplode>ExtinguisherExplosion</soundExplode>
      <soundImpactAnticipate>MortarRound_PreImpact</soundImpactAnticipate>
      <soundAmbient>MortarRound_Ambient</soundAmbient>
  <preExplosionSpawnThingDef>FilthFireFoam</preExplosionSpawnThingDef>
  <explosionSpawnChance>1.0</explosionSpawnChance>
    </projectile>

  </ThingDef>

This projectile works in vanilla, you'll need to add a new type of mortar to use it though, probably.
Could that be a case of simply taking a vanilla mortar and changing the projectile part?
I'd prefer to have an automated solution, if that makes it any easier to mod.
If it's a relatively easy copy-paste-esque job then I might see if I can Frankenstein it together myself. :)
Title: Re: [Request] Firefoam Mortar
Post by: Reviire on August 11, 2016, 08:25:49 AM
I think it is, I dunno. I just tested it by replacing the projectile for the EMP mortar with that, it's a useless fucking mortar most of the time anyway.
Title: Re: [Request] Firefoam Mortar
Post by: Master Bucketsmith on August 11, 2016, 09:29:59 AM
Holy shit, I'm so happy and proud with myself! :D
Thanks to this thread and your work, I have made my first working mod!

It's a mannable turret that requires ammunition, at the moment. A very rough mod on the EMP mortar, based on the projectile Reviire provided.

It works well, just a matter of tweaking values to get what one wants.

I'm going to look into making it a cluster projectile, with multiple smaller explosions! And then perhaps an automated version that's more expensive, but I'm not sure if I can get that done.

If anyone is interested in seeing my proof-of-concept, let me know! :D
Title: Re: [Request] Firefoam Mortar
Post by: Reviire on August 11, 2016, 10:05:29 AM
Automated is not possible with just XML. Unmanned is, but still requires force firing. Cluster projectiles like you want are only possible with combat realism, otherwise a sort of shotgun mortar might be possible, I'd need to be on my PC to try, but I'm in bed
Title: Re: [Request] Firefoam Mortar
Post by: Master Bucketsmith on August 11, 2016, 10:12:09 AM
Quote from: Reviire on August 11, 2016, 10:05:29 AM
Automated is not possible with just XML. Unmanned is, but still requires force firing. Cluster projectiles like you want are only possible with combat realism, otherwise a sort of shotgun mortar might be possible, I'd need to be on my PC to try, but I'm in bed
Why is the automated part not possible? Because it would have to seek fire? Hmm yes.

I thought the cluster thing was already done in Glitter Tech, but it is actually a burst mortar, not a cluster mortar.

I guess the next step is to make it a single radius explosion but not use artillery shells as ammo.
Title: Re: [Request] Firefoam Mortar
Post by: Master Bucketsmith on August 11, 2016, 11:21:31 AM
Here you go!
https://ludeon.com/forums/index.php?topic=23545.0
Title: Re: [Request] Firefoam Mortar
Post by: Seikikai on August 13, 2016, 01:21:24 AM
Just Tested The Mod, Really Good :D

Thanks Bro