Holdable
Attributes
Attribute | Type | Default value | Description |
---|---|---|---|
CanPush | bool | true | Is the item currently able to push characters around? True by default. Only valid if blocksplayers is set to true. |
Attached | bool | false | Is the item currently attached to a wall (only valid if Attachable is set to true). |
Aimable | bool | true | Can the item be pointed to a specific direction or do the characters always hold it in a static pose. |
ControlPose | bool | false | Should the character adjust its pose when aiming with the item. Most noticeable underwater, where the character will rotate its entire body to face the direction the item is aimed at. |
UseHandRotationForHoldAngle | bool | false | Use the hand rotation instead of torso rotation for the item hold angle. Enable this if you want the item just to follow with the arm when not aiming instead of forcing the arm to a hold pose. |
Attachable | bool | false | Can the item be attached to walls. |
Reattachable | bool | true | Can the item be reattached to walls after it has been deattached (only valid if Attachable is set to true). |
LimitedAttachable | bool | false | Can the item only be attached in limited amount? Uses permanent stat values to check for legibility. |
AttachedByDefault | bool | false | Should the item be attached to a wall by default when it’s placed in the submarine editor. |
HoldPos | Vector2 | “0.0,0.0” | The position the character holds the item at (in pixels, as an offset from the character’s shoulder). For example, a value of 10,-100 would make the character hold the item 100 pixels below the shoulder and 10 pixels forwards. |
AimPos | Vector2 | “0.0,0.0” | The position the character holds the item at when aiming (in pixels, as an offset from the character’s shoulder). Works similarly as HoldPos, except that the position is rotated according to the direction the player is aiming at. For example, a value of 10,-100 would make the character hold the item 100 pixels below the shoulder and 10 pixels forwards when aiming directly to the right. |
HoldAngle | float | 0 | |
AimAngle | float | 0 | |
SwingAmount | Vector2 | “0.0,0.0” | |
SwingSpeed | float | 0 | |
SwingWhenHolding | bool | false | |
SwingWhenAiming | bool | false | |
SwingWhenUsing | bool | false | |
DisableHeadRotation | bool | false | |
SpriteDepthWhenDropped | float | 0.55 | Sprite depth that’s used when the item is NOT attached to a wall. |
This component also supports the attributes defined in: Pickable, ItemComponent
Example
<Item identifier="smallplanter" category="Misc" Tags="planter,mediumitem" scale="0.5" isshootable="true">
<Holdable selectkey="Select" pickkey="Use" slots="Any,RightHand,LeftHand" msg="ItemMsgDetach" PickingTime="5.0" aimpos="85,-10" handle1="0,0" attachable="true" aimable="true" />
<ItemContainer capacity="1" maxstacksize="1" hideitems="true" drawinventory="false" uilabel="" allowuioverlap="true" allowdraganddrop="false" showcontainedstateindicator="false">
<Containable items="seed" />
</ItemContainer>
<LightComponent range="10.0" lightcolor="255,255,255,0" IsOn="true" castshadows="false" allowingameediting="false">
<sprite texture="Content/Items/Gardening/GrowablePlants_Temp.png" depth="0.025" sourcerect="896,512,128,128" origin="0.5,0.5" alpha="1.0" />
</LightComponent>
<Planter selectkey="Select" canbepicked="true" pickingtime="5.0" msg="ItemMsgPlantSeed">
<PlantSlot slot="0" offset="0,32" size="0.25" />
<SuitableFertilizer items="fertilizer" />
<SuitableSeed items="seed" />
</Planter>
[...]
</Item>