DRG Fly to Map Tile - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allow the pawn to "fly" to another world tile. This acts almost exactly the same as its mundane counterpart, with the only difference being that the resource acts as fuel. First, the ability comp looks like this:

        <comps>
            <li Class="EBSGFramework.CompProperties_DRGLaunch">
            </li>
        </comps>

The comp has 3 options available:

  • baseCost : Default (0) : Cost removed before calculating max distance
  • costPerTile : Default (0.1) : Amount of the resource to take per tile
  • maxDistance : The maximum number of world tiles that can be traveled, regardless of the amount of stored resource
  • skyfallerLeaving : Default (DropPodLeaving) : The ThingDef that determines the visuals and sounds related to the pawn leaving. Must be a skyfaller. One of the limitations previously mentioned are that the pawn's graphics themselves can't be used (due to how rimworld would try to handle the textures), but a generic pawn shape in a glowing aura could be used.
  • worldObject : Default (TravelingTransportPods) : The WorldObjectDef used to determine visuals and speed. Two of the three limitations are related to this, namely that the visual is static like with skyfallerLeaving, and the speed is determined by the worldObjectClass, which won't be customizable without a custom worldObjectClass. If / when one is added to the framework those words will link to it

Note 1: As you can probably tell from the descriptions, the main limitations are the fact that visuals are a statically set texture, meaning they can't use something dynamic like the pawn's image. To handle this issue, I recommend using more generic visuals for skyfallerLeaving that make it less obtrusive for players, and using a symbol of some sort for worldObject

Note 2: Note 1 is not applicable if the pawn is supposed to be entering or transforming into something. For example, if the pawn is supposed to turn into a blue shell from Mario Kart, then you don't need generic glows and symbols, you need a blue shell


This example causes the pawn to fly over to another map tile, with their take off graphic being a generic looking cloud and the world map visual being the mechanoid drop pod visual

    <AbilityDef ParentName="EBSG_TestAbilityBase">
        <defName>Launch</defName>
        <label>go launch yourself</label>
        <description>Fly to another world tile.</description>
        <targetWorldCell>True</targetWorldCell>
        <displayGizmoWhileUndrafted>true</displayGizmoWhileUndrafted>
        <disableGizmoWhileUndrafted>false</disableGizmoWhileUndrafted>
        <comps>
            <li Class="EBSGFramework.CompProperties_DRGLaunch">
                <skyfallerLeaving>PawnLeaving</skyfallerLeaving>
                <worldObject>PawnFlying</worldObject>
                <mainResourceGene>SHG_Archetypes_Radiomancer</mainResourceGene>
            </li>
        </comps>
    </AbilityDef>

    <WorldObjectDef>
        <defName>PawnFlying</defName>
        <label>pawn flying</label>
        <description>Pawn in flight.</description>
        <worldObjectClass>TravelingTransportPods</worldObjectClass>
        <texture>Things/Special/DropPodMechanoid</texture>
        <useDynamicDrawer>true</useDynamicDrawer>
        <expandingIcon>true</expandingIcon>
        <expandingIconTexture>Things/Special/DropPodMechanoid</expandingIconTexture>
        <expandingIconPriority>60</expandingIconPriority>
        <expandMore>true</expandMore>
        <allowCaravanIncidentsWhichGenerateMap>true</allowCaravanIncidentsWhichGenerateMap>
    </WorldObjectDef>

    <ThingDef ParentName="SkyfallerBase">
        <defName>PawnLeaving</defName>
        <label>pawn (leaving)</label>
        <thingClass>FlyShipLeaving</thingClass>
        <graphicData>
            <texPath>Things/Mote/SparkFlash</texPath>
            <graphicClass>Graphic_Single</graphicClass>
          <shaderType>CutoutFlying</shaderType>
          <drawSize>10</drawSize>
        </graphicData>
        <skyfaller>
          <movementType>Decelerate</movementType>
          <reversed>true</reversed>
          <shadow>Things/Skyfaller/SkyfallerShadowDropPod</shadow>
          <shadowSize>(1, 1)</shadowSize>
          <anticipationSound>DropPod_Leaving</anticipationSound>
          <anticipationSoundTicks>-10</anticipationSoundTicks>
          <ticksToImpactRange><min>-40</min><max>-15</max></ticksToImpactRange>
        </skyfaller>
    </ThingDef>
⚠️ **GitHub.com Fallback** ⚠️