Fly to Map Tile - KonradHeinser/EBSGFramework GitHub Wiki

This ability comp allow the pawn to "fly" to another world tile. The basic ability comp stuff looks like this:

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

The comp has 3 options available:

  • maxDistance : Default (10) : The maximum number of world tiles that can be traveled
  • 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 graphic will be replaced with the pawn's. The default uses this class, so you only need to include this if you want to change the class, label, description, skyfaller information, or add an EffecterDef
  • 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. The default uses this class, so only use this if you want a different class, label, and/or description
  • 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
  • noMapTravelWhileImobilized : 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>

Note 2: An EffecterDef can be added to the leaving texture by adding the EBSG extension to the ThingDef and using the effecter tag:

        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <effecter>INSERTEFFECTERDEFNAMEHERE</effecter>
            </li>
        </modExtensions>

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>
        <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** ⚠️