Skip to content

New Block Format

HammerGuy edited this page Nov 24, 2014 · 17 revisions

Overview

In order to migrate away from the previous way of handling tiles and make the format more universal, here is the proposed specifications of a new JSON format.

As part of giving the properties more universality, whenever something claims to be a direction table that means that the lua that represents it will be {0, 1, 0, 1} and the json would be [false, true, false, true] where each element, in order, corresponds to the north, east, south, and west face of a block.

It is very confusing for the bottom side of a block to act like a coin and for the top side to be solid so please try not to exploit these behaviors or else you'll make people mad.

Properties

  • BaseImage string default: "" If not defined, will look for a graphic that corresponds to the filename of the tile. If this references a filename other than itself, it will look for that.
  • OffsetX number default: 0 The x coordinate of the tile's graphic position in BaseImage.
  • OffsetY number default: 0 The y coordinate of the tile's graphic position in BaseImage.
  • TilePalette array? default: nil? The palette set(s) that this tile can access and use.
  • FlipX boolean _default: false Flips the graphic being pulled by its X axis.
  • FlipY boolean _default: false Flips the graphic being pulled by its Y axis.
  • Rotate number default: 0 Rotates the graphic a factor of 90.

  • Solid direction table default: true If true, things will collide with this block's face. If a given face is marked as non-solid the player will be able to enter the block from that direction. Once inside the block, the player will be able to leave from any direction. Setting the left side to be non-solid and the right to be solid will allow the player to walk through it from left to right but will prevent him from re-entering from the right.
  • Visible boolean default: true If false, this block will not be visible but will retain its other properties.
  • Breakable direction table default: false If true, super mario and koopa shells will destroy this block on this face.
  • Breaklevel number default: 0 Dictates whether something is is strong enough to break this tile. 0 would be completely solid/unbreakable. 5 would be a standard brick. With lower numbers bar 0 being increasingly fragile. In combination with above, would provide something of a strong block that breaks only on one side with the right strength.
  • Coin boolean default: false If true, will give the player a coin when touched.
  • CoinAmount number default: 1 How much the coin would yield. I'd laugh if this can go into the negatives.
  • Portalable direction table default: true If false, the player will not be able to place portals on this block's face nor will this block's face be usable to host neighboring portals.
  • Mirror direction table default: false If true, portals shot at a given face will reflect at the angle they are shot from.
  • Grate direction table default: false If true, portals will be able to enter and leave through faces set as grates.
  • Water boolean default: false If true, players inside this block will be swimming.
  • Hurt direction table default: false If true, will hurt players that collide with the block from that direction.
  • Background boolean default: false If true, this block will be behind the majority, if not all, objects.
  • Foreground boolean default: false If true, this block will be in front of things.
  • Bounce direction table default: false If true, the player will bounce from that/those direction(s).
  • Kill direction table default: false If true, will outright destroy an unprotected player when they come in contact akin to that of the hurt block.
  • ItemBlock direction table default: false If true, will give the player what is in the contents of the block; by default if nothing is in it, it will yield a coin. (If a player truly wants nothing, should probably have a nothing entity or something.)
  • Bump direction table default: false If true, when the player comes in contact with this, it will turn into whatever is the bump target.
  • Climbable direction table default: false If true, The player can climb upon this tile in the directions allowed.

  • Triggerable boolean default: false If true, this block will be able to receive a signal from the animatedtiletrigger entity to begin animating.
  • FrameDuration decimal (seconds/frame) default: 0.0 The length, in seconds, that this block should use its current graphic before advancing to its next frame.
  • NextFrame string default: "" The name of the tile to change to. When this happens, this tile will no longer exist and an instance of the specified tile will replace it -- including all the properties.
  • Switchable:boolean default: false If true, this block will turn into its next frame.
  • Switchback: string default: "" The tile will turn into this when the switch is no longer in effect.
  • Switchtype: string default: "" What makes this switch tick? "pswitch"? "onoffblock"? "exclamationswitch(es)"?
  • NoMercy: boolean default: false If true, hurt/kill blocks will harm player without any bias (Example: A starman has no effect in say, extremely hot lava.)
  • BumpTarget string default: "" The tile the bumped tile will turn into.
  • DropThrough boolean default: false If true, Mario can hold against the direction of what would be a solid and go through. (Example, dropping through a platform to get to a lower ledge.)

  • Platform This property could be reduced to the solid property.
  • Bridge This property could be remade with triggers.
Clone this wiki locally