Block Entry INI config (Config pack)

From Moondust Wiki
Jump to navigation Jump to search

block-*.ini - the settings file which declares single entry of block types. When this file is a part of the config pack, almost all parameters are required. The default location of these files is specifying in the main lvl_blocks.ini file by the "config-dir" field of the "[blocks-main]" section.

When this file is created inside level or episode, all parameters are optional: the role of episode/level side configuration is overriding of default properties are declared on a side of config pack.

[ block ]
Parameter Allowed values Example value Description
image string image = "block-1.png" Image filename of a block.
editor-image string editor-image = "block-1-editor.png" Alternative image filename of a block for Editor.
name string name = "Wood block" Title of block.
group string group = "Common blocks" Group name where included this block.
category string category = "Wood" Category name where included this block.
description string description = "Knock it!" A short description about this element.
extra-settings string extra-settings = "mylayout.json" Filename of GUI layout for extra settings if they are needed for this element.
is-meta-object boolean is-meta-object = false Make this element be meta-object: It will be hidden on exported images/screeshots in dependence from a choice.
grid >=1 grid = 32 Size of aligning grid
default-invisible [0,1,true,false] default-invisible = false Set default invisible flag for this block
default-slippery [0,1,true,false] default-slippery = false Set default slippery flag for this block
default-content +/- integer default-content = -12
Notice Note: Supported since May 22, 2021

Set default content of this block
>0 - ID of NPC
<0 - coins number

if is 0 - empty block.
default-npc-content +/- integer default-npc-content = 12
OOjs UI icon notice-destructive.svg WARNING: Deprecated since May 22, 2021. Use "default-content" instead. This field will still work. However, if the file contains the "default-content" field defined, the "default-npc-content" field will be overridden and ignored.

Set default content of this block using SMBX-internal value format
>=1001 - ID of NPC with 1000 added

1...999 - coins number
if is 0 - empty block
sizable [0,1,true,false] sizable = false Makes this block be re-sizable
sizable-border-width >=0 or -1 sizable-border-width = -1 Common border size of sizable block. Default for all undefined side specific sizes. If not defined or less than zero, global value will be used.
sizable-border-width-left >=0 or -1 sizable-border-width-left = -1 Border size of sizable block at left side. If not defined or less than zero, common value will be used.
sizable-border-width-top >=0 or -1 sizable-border-width-top = -1 Border size of sizable block at top side. If not defined or less than zero, common value will be used.
sizable-border-width-right >=0 or -1 sizable-border-width-right = -1 Border size of sizable block at right side. If not defined or less than zero, common value will be used.
sizable-border-width-bottom >=0 or -1 sizable-border-width-bottom = -1 Border size of sizable block at bottom side. If not defined or less than zero, common value will be used.
z-layer string z-layer = background Default Z-Order layer of block:
background,
foreground
view string view = background Alias to "z-layer" field
danger -3...4 danger = 0 Block will hurt player on touch with this block at the specified side(s):

0 - block is safe
1 left
-1 right
2 top
-2 bottom
3 left-right
-3 top-bottom

4 - all sides hurts
clip-mode 0..2 clip-mode = 1 Clip players and NPCs at sides:

1 - all sides (solid)
2 - top side (semi-solid)

0 - no clipping
collision 0..2 collision = 1 Alias to "clip-mode".
slope-slide [0,1,true,false] slope-slide = false Allow player to slide on slopes (triangle shape blocks only)
shape -2..3 shape = 0 Hitbox shape of this block: (see picture below)
shape-type -2..3 shape-type = 0 Alias to "shape".
lava [0,1,true,false] lava = false Burn of all NPC's and playable characters who had to touch with this block. Except of lava-immune NPC's.
destroyable [0,1,true,false] destroyable = false Can be destroyed by thrown items or by a head bump.
destroyable-by-bomb [0,1,true,false] destroyable-by-bomb = false Can be destroyed by a bomb explosion.
destroyable-by-fireball [0,1,true,false] destroyable-by-fireball = false Can be destroyed by a fireball-marked NPC
spawn-on-destroy string/integer spawn-on-destroy = "0" Object type-ID for spawn after destroy
Examples:
0 - nothing
, block-*
, npc-*
where * - is an positive integer
destroy-effect +integers destroy-effect = 1 Play effect ID on destroy, 0 - no effect
bounce [0,1,true,false] bounce = false Make this block bounsy. Playable character who standing on this block, will be immediately bounced up.
bumpable [0,1,true,false] bumpable = false This block can be always bumped up. Otherwise, this block can be bumped in only condition when it has any NPC content or coins.
hitable [0,1,true,false] hitable = false Alias to "bumpable".
transform-onhit-into >=0 transform-onhit-into = 2 if enabled hit transform, block will be transformed into block of ID=2,
if value is 0, block will not be transformed, even if contains NPC
algorithm >=0 algorithm = 0 Special block algorithm, for example: on/off switcher, invisible block, player switch block
animated [0,1,true,false] animated = false Enable animation
animation-revers [0,1,true,false] animation-revers = false Enable reversed animation sequence
animation-bidirectional [0,1,true,false] animation-bidirectional = false Animation will turn back on edge frames in sequence
frames >=1 frames = 14 Number of animation frames on sprite.
editor-frames >=1 editor-frames = 14 Editor alternative number of animation frames on sprite.
frame-delay >=1 frame-delay = 128 Delay between animation frames in milliseconds
frame-speed >=1 frame-speed = 128 Alias to frame-delay
framespeed >=1 framespeed = 8 Delay between animation frames in 1/65 seconds
frame-sequence string, sequence of integers frame-sequence = "1,3,2,0" Initial custom animation frames sequence (first frame is 0, last is n-1). Empty string is usage of default sequence.
display-frame >=0 display-frame = 3 If animation is disables, will be displayed this frame (first frame is 0 value)
hit-sound-id >=0 hit-sound-id = 3 Play custom sound when something hits this block (if 0 - play default sound)
destroy-sound-id >=0 destroy-sound-id = 3 Play custom sound when something destroys this block (if 0 - play default sound)

Switch blocks
switch-button [0,1,true,false] switch-button = false Hit of this block will cause toggle switch by defined ID
switch-block [0,1,true,false] switch-block = false Switchable block which will be transformed on toggling specific switch ID
switch-id integer switch-id = 2 ID of switch group. All blocks including in this group will be toggled with button which in same group which got hit
switch-transform >=1 switch-transform = 2 Target transform BLOCK-ID. Block will be transformed when switch ID was toggled

Player switch blocks (hit will transform a playable character to another)
player-switch-button [0,1,true,false] player-switch-button = true Hit of this block will transform playable character to another specified
player-switch-button-id integer player-switch-button-id = 2 ID of playable character to transform.
player-switch-frames-true string, sequence of integers player-switch-frames-true = "1,3,2,0" Animation sequence while current playable character of specified ID is exists on a level
player-switch-frames-false string, sequence of integers player-switch-frames-false = "1,3,2,0" Animation sequence while current playable character of specified ID is NOT exists on a level

Player filter blocks (through this block can pass only playable character of specified ID)
player-filter-block [0,1,true,false] player-filter-block = true This block will be non-collidable for a playable character of specified ID
player-filter-block-id integer player-filter-block-id = 2 ID of playable character to transform.
player-filter-frames-true string, sequence of integers player-filter-frames-true = "1,3,2,0" Animation sequence while current playable character of specified ID is exists on a level
player-filter-frames-false string, sequence of integers player-filter-frames-false = "1,3,2,0" Animation sequence while current playable character of specified ID is NOT exists on a level


Shapes of the blocks

Lvl blocks shapes.png