Fly to Map Tile - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allow the pawn to "fly" to another world tile:

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

These are the options that restrict where the the pawn can go:

  • maxDistance : Default (10) : The maximum number of world tiles that can be traveled
  • distanceFactorStat : A StatDef that multiplies the maxDistance
  • checkJammer : Default (True) : If Odyssey is active, this will check if the destination has requiresSignalJammerToReach set to True, and if so it will prevent traveling there

These are the options that handle the pawn's transportation out, between, and into maps. All of the defaults use the same defName and Name to make it easy to create variations of these with slight tweaks, and use the various classes that cause the graphic to use the pawn's appearance. The xml for the defaults can be found here:

  • pawnTransporter : Default (EBSG_FlightPod) : This ThingDef contains CompProperties_Transporter, which stores the pawn. You can also set dropPodFaller and dropPodActive in this def to change the graphic used for arrival, with EBSG_FlightPod using EBSG_PawnArriving and EBSG_PawnLanding. If you do override this, make sure you have the final thingClass set to EBSGFramework.Building_LaunchAbilityPod or a child of that because that class is what the Harmony patch looks for when determining if a pawn can go somewhere
    • EBSG_PawnArriving is the ThingDef for the skyfaller going into the map. If you are planning on overriding this, use EBSG_PawnArriving for the ParentName if you want to keep the pawn themselves as the main part of the graphic, or DropPodIncoming if you're planning on using a different graphic
    • EBSG_PawnLanding is the ThingDef used briefly between the pawn ending their arrival and being controllable again. It uses the EBSGFramework.FlyPawnLanding thingClass to display the pawn, though it usually lasts so briefly that it won't be noticed. ActiveDropPod can be used as a parent if you're overriding this and don't want the pawn's body as the graphic
  • skyfallerLeaving : Default (EBSG_PawnLeaving) : The ThingDef that determines the visuals and sounds related to the pawn leaving. Must be a skyfaller. If you use the EBSGFramework.FlyPawnLeaving thingClass, the main graphic will be replaced with the pawn's
  • worldObject : Default (EBSG_PawnFlying) : The WorldObjectDef used to determine visuals and speed. If the WorldObjectDef uses the EBSGFramework.FlyingPawn worldObjectClass, its textures will be replaced to the pawn's

These options restrict whether or not the pawn can fly away from a caravan:

  • noMapTravelWhenTooMuchMass : Default (True) : If this is true and the pawn uses this while in a caravan, the total mass of everything, including animals and other pawns, is compared to the caster's carry capacity. If the pawn doesn't have enough carry capacity, then they can't use the ability unless the caravan is split. This usually results in a pawn being unable to transport anything other than itself and a few other things
  • noMapTravelWhileImmobilized : Default (True) : If noMapTravelWhenTooMuchMass is false, then this will only stop the caster from transporting the caravan if it is immobilized due to mass. If both this and noMapTravelWhenTooMuchMass are false, then there are no limitations on when the caster can move the caravan

Note 1: If you are using skyfallerLeaving or worldObject just to replace the label/description, you can copy one of the below code blocks to have most of the code completed. Skyfaller code for the ThingDef can be added to this base as needed:

    <WorldObjectDef ParentName="EBSG_PawnFlying">
        <defName>NEW_PawnFlying</defName>
        <label>flying pawn</label>
        <description>Pawn in flight.</description>
    </WorldObjectDef>
    <ThingDef ParentName="EBSG_PawnLeaving">
        <defName>NEW_PawnLeaving</defName>
        <label>flying pawn</label>
    </ThingDef>

This example causes the pawn to fly over to another map tile, with no leaving or flying stuff specified so it uses the generic flying pawn stuff:

    <AbilityDef>
        <defName>Launch</defName>
        <label>go launch yourself</label>
        <description>Fly to another world tile.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <targetWorldCell>True</targetWorldCell>
        <showGizmoOnWorldView>true</showGizmoOnWorldView>
        <displayGizmoWhileUndrafted>true</displayGizmoWhileUndrafted>
        <disableGizmoWhileUndrafted>false</disableGizmoWhileUndrafted>
        <casterMustBeCapableOfViolence>false</casterMustBeCapableOfViolence>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>0.9</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_Launch">
                <maxDistance>30</maxDistance>
            </li>
        </comps>
    </AbilityDef>
⚠️ **GitHub.com Fallback** ⚠️