• SmartSnap (snap the mouse to objects)
    552 replies, posted
  • Avatar of Syranide
  • [release]Current version: [b]1.0.0[/b], released on [b]2008-03-30[/b], compatible with the GMOD update! [b]If SmartSnap does not work for you, get the latest version first! FPS drops when showing the grid has been FIXED![/b] [url=http://www.garrysmod.org/downloads/?a=view&id=35405][img]http://www.garrysmod.org/img/?t=dll&id=35405[/img][/url][url=http://upl.vs-hs.com/d/7e979b9c8b49a63f56d3fe9317d662aa][img]http://upl.vs-hs.com/info_imgs/7e979b9c8b49a63f56d3fe9317d662aa.jpg[/img][/url][/release][release][b]●●●● Introduction ●●●●[/b] This is a [b]client-side[/b] tool for building contraptions with [b]extreme precision[/b], aligning objects for either aesthetic or functional perfection. To accomplish this task a grid is projected onto the object you are pointing at and by pressing the use-button your weapon will lock onto that point and allow you to place objects with pin-point accuracy. For all entities be them [b]square, round or uneven[/b] this tool will bring you perfect precision. This is a remake of the classic AutoSnap with a multitude of improvements. We all loved AutoSnap, and since the development of it had almost come to a halt I decided it was time to bring it back to life, the code has been written from scratch. [b]If you have any feedback or ideas to improve this addon I would be very happy to hear them![/b][/release][release][b]●●●● Model addons ●●●●[/b] Get the latest model addons here, corrected model offsets are included in each separate addon. PhoeniX-Storms: [url]http://forums.facepunchstudios.com/showthread.php?t=488601[/url] Primitive Mechanics: [url]http://forums.facepunchstudios.com/showthread.php?t=507452[/url] Tiled Building Blocks: [url]http://forums.facepunchstudios.com/showthread.php?p=9284781[/url][/release][release][b]●●●● Changelog ●●●●[/b] [b]2008-03-30, v1.0.0 (important update):[/b] ● FPS drops when the grid is showing have been fixed, it is not directly caused by SmartSnap, but the use of SmartSnap increases per frame memory consumption and the garbage collector obviously handles this very poorly. Please give me some feedback on how this works out for you all. ● "default model offset" has been removed to improve consistency for model addons, it now hardcoded to 0.25 which appears to the default for the source models. ● Bumped to version 1 because it is about time now! [b]2008-03-30, v0.9.5 (useful update):[/b] ● Grid offset only affects the outer border of the grid now and does not scale the entire grids, provides better snapping for "building blocks". ● Per model offsets are now provided for each separate model addon instead, update your model addons! (links above) ● Added "click grid" mode, disables the grid until USE is clicked while looking at a prop, looking away from a prop disables the grid again. ● Fixed a very rare bug that causes SmartSnap errors (thanks kevkev) [b]2008-01-17, v0.9.4 (compatibility update):[/b] ● Using presets for settings instead (also fixes rare cases of the grid not showing) ● Should be fully compatible with the GMod update, complain here otherwise (Your settings will be reset when updating to this version) [b]2007-12-23, v0.9.3 (minor update):[/b] ● Fixed per-model offsets, broke in last update ● Added default model offsets, should make corners useable on more models (option provided) ● Some minor optimizations (SmartSnap can be installed on servers and will downloaded to clients automatically) [b]2007-11-28, v0.9.2 (compatibility update):[/b] ● Fixed errors that would appear when running the latest GMod10 beta ● New option to turn off the grid, leaving only the marker ● General optimizations and code improvements [b]2007-07-22, v0.9.1 (compatibility update):[/b] ● Fixed settings not appearing in the spawnmenu since the GMod10 update [b]2007-05-07, v0.9.0 (major update):[/b] ● Custom per-model offsets (more information below) ● New snap mode, perfect precision from "any" angle on any model, even rounded or uneven (more information below) ● New grid system, there are no longer gaps between the black and white lines, and the lines no longer go haywire when you are too close ● Easy access grid toggling, set "toggle delay" to enable, double-click the snap-key within that time to toggle the grid, console command "snaptogglegrid" ● Rewrote the square face picking routines ● Context mouse snapping is available again ● Thick center line for the grid (optional) ● New options (I'm open for more suggestions) ● And a lot of minor fixes everywhere [b]2007-04-27, v0.8.1 (major changes):[/b] ● There is now a "lock snap mode", that will keep the snap without holding a key by binding a key to the "snaplock" (idea by Vampired) ● Based on the previous there is now a "smart snap lock" that will activate after a short delay, off by default and adjustable delay (idea by Vampired) ● The snap button can now be assigned to another key by binding that key to "+snap", "snap_disableuse 1" to disable default snap key ● The settings are no longer lost when restarting the game [b]2007-04-25, v0.8.0 (initial release):[/b] ● The grid is black and white, visible on both light and dark objects ● The cursor indicates potentially bad angle with colors, red/yellow/green (new mode as of 0.9.0) ● The cursor is tilted to provide better visiblited ● The cursor turns turquoise in context mode if you are too far away and the margin of error will be noticeable (the cursor is imprecise) ● The aim now snaps completely to the grid, wobbling the mouse does not affect placement, also allows you to place objects from the other side of the map with pinpoint accuracy ● The snap does not release or shift when moving, it always sticks to the same snap point, you can even walk around the object while still attached to the same point ● The square grid works for all objects, regardless of the model ● The grid has been offset inwards slightly too minimize the common gap that was always present (for most square objects there is no gap now) ● The grid has been offset from the edges so that the outer lines of the grid are useable as well ● The objects' bounding box is made visible by blue markers on each corner ● The grid is selected by the aim/mouse and not the viewing angle, you can now point at any visible side and see the grid without moving ● The grid is smart, for smaller objects, less snap points will be available ● The snap point finding algorithm runs in constant time, meaning that regardless of number of snap points, it will always be as fast [b]●●●● Suggested improvements ●●●●[/b] ● Quickly accessible grid size settings (idea by AfTeRsHoCk) [/release][release][b]●●●● Installation ●●●●[/b] Simply unzip the archive into your garrysmod/addons-directory and it should be working, read the instructions on how to use it. [b]●●●● Instructions ●●●●[/b] If you have used AutoSnap before, there should not be any problem to understand this either, although there are some major improvements that might make it feel different, especially the new ultra precise mouse snap. For the uninitiated, it is very simple to use this addon, simply install it, start a game, spawn a prop, bring up the [b]toolgun[/b], look at the prop and a grid should appear. If you press use (e), the mouse should snap to the point you look at, and will signal with colors how precise the placement will be. Options for this addon is located under "Spawnmenu/Options/Smartsnap Settings". [b]If you have any questions, I will be more than happy to answer them![/b][/release][release][b]●●●● The new snap mode ●
  • Avatar of Syranide
  • Thanks you all for the comments! ;) [QUOTE=Metroid48]Nice, does seem really similar to autosnap. Is this client side, like autosnap?[/QUOTE] Yes, this is "autosnap", but I rewrote it from scratch and added all the improvements mentioned in the first topic. So you will feel very familiar, and it is 100% client side.
  • Avatar of Razot
  • um... what does it do [b][highlight](User was banned for this post (Reason: RCP (in post "Re: SmartSnap (snap the mouse to objects)" by garry)))[/highlight][/b]
  • Avatar of Syranide
  • [QUOTE=Razot]um... what does it do[/QUOTE] Just like Autosnap, it allows you to "snap" the view to a grid, allowing you place thrusters/gates/whatever or weld/etc with perfect precision on most square objects. So it's a tool for building precisely aligned contraptions and groups of objects.
  • Avatar of TheTiger
  • just similar with auto snap but better but anoying thing that some of grid goes inside prop but better corner grid's than in autosnap gold star for you
  • Avatar of Phasy
  • It does not work. It's in the addons folder, I installed it on both my server and on my client, yet there is no menu for it in options, and it doesn't seem to work at all.
  • Avatar of Syranide
  • [QUOTE=TheTiger]just similar with auto snap but better but anoying thing that some of grid goes inside prop but better corner grid's than in autosnap gold star for you[/QUOTE] Aha, that will be fixed in a coming version, it will then be possible to specify offsets for specific props, which allow it to align perfectly for all square props. Expect to see this any day. I temporarily have a global inward offset for the grid at the moment because it allows for an overall smaller gaps. [b]Edit:[/b] [QUOTE=Phasy]It does not work. It's in the addons folder, I installed it on both my server and on my client, yet there is no menu for it in options, and it doesn't seem to work at all.[/QUOTE] Oh sorry, this is most likely because you have to have a tool-weapon (e.g. nailer, thruster etc) in your hands for it to show! Very sorry that I forgot to mention this in the initial post, will fix it immediately.
  • Avatar of conman420
  • THANK YOU! I was so annoyed by the bug in auto-snap where the corners where off the prop :( You are my saviour! Was this built from scratch or did you just edit robbis's code? Never mind about that bit I just read a post above. Nice work!
  • Avatar of Phasy
  • [QUOTE=Syranide]Oh sorry, this is most likely because you have to have a tool-weapon (e.g. nailer, thruster etc) in your hands for it to show! Very sorry that I forgot to mention this in the initial post, will fix it immediately.[/QUOTE]Yeah, now that you mention it, that's probably it. I don't think it works on vehicles, does it? [b]Edit:[/b] By the way, if it only shows when your holding a tool weapon, does that mean it also only shows in the options menu when your holding a tool weapon?
  • Avatar of Syranide
  • [QUOTE=Phasy]Yeah, now that you mention it, that's probably it. I don't think it works on vehicles, does it?[/QUOTE] Only works on props at the moment, but I will add an option for it to show up on everything in the next release, although, it might not align very well for most vehicles as they tend to have non-square forms, but it should be useable still if you just make sure to have a green cursor before placing.
  • Avatar of Phasy
  • Yeah. Anyway, the option problem was my fault and it works now. Good work, have a gold star for the mod and the support.
  • Avatar of Joel_Yeah
  • [quote=Syranide]I made an [B]untalented[/B] video where I show off[/quote] Fixed :eng101: Also, looks great, got my download :D [spoiler]tl;dr... Looks great though :ninja:[/spoiler]
  • Avatar of conman420
  • You might want to increase the gap between the corner. On the cargo container you get the annoying corner bug! [QUOTE=Robbis_1]That's not bugged.. I added 4 sliders for each corner. The way it scales depends on the prop. If you're so clever now, go ahead and make it better.[/QUOTE] Robbis asked for it there didn't he?
  • Avatar of Syranide
  • [QUOTE=conman420]You might want to increase the gap between the corner. On the cargo container you get the annoying corner bug![/QUOTE] Will be fixed when I implement the per prop "offset" for the grid (should be very very soon), increasing the default grid edge offset would become problematic with thin props (which are already quite tight). (And I will most likely specify such offsets in advance for most props, so you don't have to do every single one yourself)
  • Avatar of AfTeRsHoCk
  • [QUOTE=NisseOwned]Oh snap! ...[/QUOTE] Indeed. One suggestion though, could you add a feature so that it allows you to change the settings of the snap-grid via something other than the settings menu? Like, maybe a second context panel or something equally (most likely) impossible and ridiculous. It's just kind of a hassle to keep going back and forth between the STool menu and the settings menu when you're working on different props. Other than that, great job!
  • Avatar of darkstar7878
  • Thank you so much, I wish I could rate you twice... but I'm just gonna rate you winner... Because you are a winner. :P
  • Avatar of Syranide
  • [QUOTE=AfTeRsHoCk][QUOTE=NisseOwned]Oh snap! ...QUOTE] Indeed. One suggestion though, could you add a feature so that it allows you to change the settings of the snap-grid via something other than the settings menu? Like, maybe a second context panel or something equally (most likely) impossible and ridiculous. It's just kind of a hassle to keep going back and forth between the STool menu and the settings menu when you're working on different props. Other than that, great job![/QUOTE] The best I can come up with at the moment is console command for those that you can bind to different buttons (increase/decrease size). Possibly if I have time I might add a secondary button instead, which would bring up something like a quick options-dialog where the cursor is, allowing you to edit the most common ones.
  • Avatar of AfTeRsHoCk
  • [QUOTE=Syranide] The best I can come up with at the moment is console command for those that you can bind to different buttons (increase/decrease size). Possibly if I have time I might add a secondary button instead, which would bring up something like a quick options-dialog where the cursor is, allowing you to edit the most common ones.[/QUOTE] That would great, awesome, thanks! :D