Wheels and spinning module

d-luX

New Member
#1
Hey guys ,
I built a simple wheel, which works great as well.
But now I would like to use the wheel for acceleration and have inserted the "spinning" module in my XML file.
There is an error message:

SpinningModule (at line 78 , column 2 in Dragster.xml) must contain ToggleModeToggle element!

I searched the documentation and the api for "ToggleModeToggle" but I didn't find nothing helpful about "ToggleModeToggle".
What does it mean?

This is my xml file.
Maybe there is something wrong?

XML:
<Block>
    <!-- Block definition file.
         Optional elements are mostly out-commented.
         Remember to insert appropriate values where specified,
         the mod will not load correctly until you do.
         Restart the game to load the block once this file is completed.
    
         Values that should always be changed are marked with "TODO".
    
         See the documentation for further information on any of these elements.
    -->

    <!-- Optional. Enables debug mode.
         In debug mode, colliders and adding points are shown visually
         to assist in positioning them correctly.
         (Capsule colliders are shown as cubes, imagine their edges were rounded off.) -->
    <Debug>false</Debug>

    <!-- ID of your block. See "Note on IDs" in Mod.xml.
         The ID must be unique among blocks in your mod.
         It may conflict with blocks of other mods, the mod loader handles this.
         The easiest way of assigning IDs is to use 1, 2, 3, etc.-->
    <ID>1</ID>

    <!-- Name of the block, shown in the user interface. -->
    <Name>Dragster</Name>

    <!-- TODO: Change the mass to something appropriate -->
    <Mass>1</Mass>

    <!-- Additional keywords that can be used to search for this block
         in the search tab of the block bar.
    
         Blocks can always be searched for by name and author,
         additional keywords can be specified here. -->
    <SearchKeywords>
        <Keyword>Wheel</Keyword>
    </SearchKeywords>

    <!-- Optional.
         Only has an effect if the OnFlip method in the block script is not overriden.
    
         Causes the Flipped property for the script to be set correctly. This is also used by
         certain modules, like Spinning or Steering.
         If an Arrow element is included, it is automatically flipped too. -->
    <!-- <CanFlip>true</CanFlip> -->

    <!-- Specify that this block is a replacement of an old modded block.
         If this block has an equivalent that was created with the old community mod/block loader,
         specifying its id here will make the game load this block when loading machines that contain the old block. -->
    <!-- <Replaces>410</Replaces> -->

    <!-- Normally, when a machine with a modded block is loaded, but that block is not loaded, the block will be ignored.
         If the block has a fallback specified here, the fallback block is loaded instead in this scenario.
    
         Valid values are entries of the BlockType enum or the numeric ID of a block. Only normal blocks can be specified as
         fallback, not modded blocks. -->
    <!--<Fallback>DoubleWoodenBlock</Fallback>-->

    <!-- <Script>Full Name of a BlockScript class, optional.</Script> -->

    <!-- Blocks can have certain predefined behaviour added without any custom code.
         These behaviours are called modules.
         The Shooting, Spewing, Spinning, and Steering modules are included by default
         and mods can also add new modules.
         Check the documentation for more information on how to use modules. -->
    
    
    <Modules>
        <Spinning>
            <Forward key="forward" />
            <Backward key="backward" />
            <SpeedSlider key="speed" />
            <AccelerationSlider key="acceleration" />
            <AutomaticToggle key="automatic" />
            <Axis>Y</Axis>
            <MaxAngularSpeed>50</MaxAngularSpeed>
        </Spinning>
    </Modules>

    <!-- Include to make block take damage. -->
    <Health>4</Health>

    <!-- Optional.
         The game generates "stripped" versions of the prefab,
         these have some components and child objects removed and are used in MP where the full
         object is not always necessary.
         If you find that this stripping removes some components or child objects that you added to the prefab manually
         and need on the stripped version, you can include a list of objects to keep using this. -->
    <!-- <KeepWhenStripped>
        <Object>SomeObjectName</Object>
    </KeepWhenStripped> -->

    <!-- Include to enable block to burn.
         The Trigger element is optional. -->
    <!-- <FireInteraction burnDuration="5">
        <SphereTrigger>
            <Position x="0" y="0" z="0.61" />
            <Radius>1.5</Radius>
        </SphereTrigger>
    </FireInteraction> -->

    <!-- Include to make block freezable. -->
    <!-- <IceInteraction /> -->

    <!-- Optionally specify type of damage done to entities.
         Can be one of "Blunt", "Sharp", "Fire" -->
    <!-- <DamageType>Blunt</DamageType> -->

    <Mesh name="Dragster_Mesh"> <!-- Must be defined as a resource in the manifest. -->
        <Position x="0.0" y="0.0" z="0.8" />
        <Rotation x="0.0" y="0.0" z="0.0" />
        <Scale x="1.0" y="1.0" z="1.0" />
    </Mesh>

    <Texture name="Dragster_Mat" /> <!-- Must be defined as a resource in the manifest. -->

    <Icon>
        <Position x="0.0" y="0.0" z="0.0" />
        <Rotation x="0.0" y="0.0" z="0.0" />
        <Scale x="0.5" y="0.5" z="0.5" />
    </Icon>

    <!-- Including this causes a direction arrow, like the one on wheels and other turnable blocks,
         to be displayed. The child elements define how and where it is displayed. -->
    <!--<Arrow>
        <Position x="0" y="0" z="0" />
        <Rotation x="0" y="0" z="0" />
        <Scale x="1" y="1" z="1" />
    </Arrow>-->

    <!-- Optional.
         Both child elements are optional.
         Hammer can be used to specify the position and rotation of the end of the nail at the start of the hammer animation.
         Colliders can be used to specify a different set of colliders to use for the ghost.
         If it is not present, the colliders of the normal block will be used.
         It is also possible to specify ignoreForGhost attributes for some of the normal colliders to use the normal set of
         colliders with a few of them removed on the ghost.
         If the Colliders element here is present, all ignoreForGhost attributes are ignored.

         Z Position muss auf 0.8 stehen
    
         -->
    <Ghost>
        <Hammer>
            <Position x="0" y="0" z="0.8" />
            <Rotation x="0" y="0" z="0" />
        </Hammer>
        <Colliders>
            <BoxCollider>
                <Position x="0.0" y="0.0" z="0.8" />
                <Rotation x="0.0" y="0.0" z="0.0" />
                <Scale x="1.0" y="1.0" z="1.0" />
            </BoxCollider>
        </Colliders>
    </Ghost>

    <Colliders>
        <!-- TODO: Insert Collider definitions here.
             Examples:
        
             Z Position muss überall auf 0.8 stehen
        
             -->
        <BoxCollider>
            <Position x="0.0" y="0.0" z="0.8" />
            <Rotation x="0.0" y="0.0" z="0.0" />
            <Scale x="1.0" y="1.0" z="1.0" />
        </BoxCollider>
        <SphereCollider>
            <Position x="0.0" y="0.0" z="0.8" />
            <Radius>1.0</Radius>
        </SphereCollider>
        <CapsuleCollider>
            <Position x="0.0" y="0.0" z="0.8" />
            <Rotation x="0.0" y="0.0" z="0.0" />
            <Capsule direction="X" radius="1.0" height="2.0" />
        </CapsuleCollider>
    </Colliders>

    <!-- y muss auf true stehen -->

    <BasePoint hasAddingPoint="true">
        <Stickiness enabled="true" radius="0.6" />
        <!-- Can only have motion if sticky -->
        <Motion x="false" y="true" z="false" /> <!-- Optional -->
    </BasePoint>

    <AddingPoints>
        <!-- TODO: Insert AddingPoint definitions here. Example:
    
        Position muss überall auf 0 Stehen
    
        -->
        <AddingPoint>
            <Position x="0" y="0.0" z="0.0" />
            <Rotation x="0.0" y="0.0" z="0.0" />
            <Stickiness enabled="true" radius="0.6"/>
        </AddingPoint>
    </AddingPoints>
</Block>
Regards Chris
 
Last edited:
Top