Skip to content
View in the app

A better way to browse. Learn more.

Learn more

Block Grid Snap

Featured Replies

  • Administrator

When placing or moving blocks, a toggle snaps them to a configurable grid and to the edges of nearby blocks, so courses line up neatly without pixel-pushing.

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

  • 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).
  • 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.

Install

Download the ZIP above and copy its folders into cstrike/. Compile the .sma in addons/amxmodx/scripting with the AMX Mod X 1.10 compiler, put the .amxx in addons/amxmodx/plugins, and add it to plugins.ini.

Files: addons/amxmodx/scripting/include/olds_blockmaker.inc, addons/amxmodx/scripting/olds_bmsnap.sma, test/bm_stub.sma

Idea: daemon · Plugin: daemon · Tested automatically (compiled on AMX Mod X 1.8.2, 1.9 and 1.10, played on a CS 1.6 test server)
License: GPL-3.0-or-later. Written for the olds.ro plugin workshop (IDEA-1FF6EB95975C2247).

Block Grid Snap
v1.0.0Counter-Strike 1.6PluginNot tested yet
AMX Mod X 1.10Server engine HLDS, ReHLDSNeeds ReAPI NoMetamod Metamod-R0 downloads4.7 KBUpdated 4 hours ago
Sign in to download
Pawn (AMX Mod X) · 174 lines
/*
 * Block Grid Snap (olds.ro workshop card IDEA-1FF6EB95975C2247)
 *
 * Blockmaker add-on: while a builder places or moves a block, its origin snaps
 * to a grid and to the edges of nearby blocks, so courses line up without
 * pixel-pushing. Each builder turns it on or off for themselves:
 *   say /snap                  toggle (the start value is olds_bmsnap_default)
Show all 174 lines

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.