addonsVersion 1.0.0: First release.
README.txtVersion 1.0.0: First release.
README.txt2.2 KB
No file matches.
Block Grid Snap 1.0.0 (olds.ro)
===============================
A Blockmaker add-on. While a builder places or moves a block, it snaps to a
grid and to the edges of nearby blocks, so courses line up neatly without
pixel-pushing. Each builder turns it on or off with say /snap.
Requirements
- AMX Mod X 1.10.0.5490 or newer, fakemeta
- the olds.ro Block Maker core with the block API in
scripting/include/olds_blockmaker.inc (library "olds_blockmaker"): the
natives olds_bm_is_block / olds_bm_get_block and the forward
olds_bm_block_positioning, fired with the origin (changeable) on every
drag update and when a block is placed or let go. The LIB-0046 Block
Maker 1.0.0 does not have this API yet; the plugin does not load
without it. (This include is the one from Block Undo History plus the
positioning forward.)
Install
1. Put include/olds_blockmaker.inc next to the compiler's includes, compile
scripting/olds_bmsnap.sma and copy olds_bmsnap.amxx to
addons/amxmodx/plugins/ (after the core in plugins.ini).
2. Copy data/lang/olds_bmsnap.txt to addons/amxmodx/data/lang/.
No downloads.
Settings (addons/amxmodx/configs/plugins/olds_bmsnap.cfg, made on first run)
olds_bmsnap_grid 8 grid size in units (0 = no grid)
olds_bmsnap_edge 6 snap to another block's edge within this many
units (0 = no edge snap)
olds_bmsnap_default 0 1 = snap starts on for every builder
Builders
say /snap turn snap on or off (for you only; it lasts
until you leave)
How it works
- On each axis the block snaps to the nearest edge position of a nearby
block (flush against either side, or the same edge lined up) when one is
within olds_bmsnap_edge; otherwise the axis is rounded to the grid.
Nearby means the two boxes are no more than olds_bmsnap_edge apart on
every axis. Boxes come from the origin and size the core reports.
- Only the origin changes: the rotation is never touched.
- When the block is let go, the builder reads the snapped coordinates in
chat ("|" marks an axis lined up with a block edge); while dragging they
show in the centre of the screen, four times a second at most.