• SmartSnap (snap the mouse to objects)
    552 replies, posted
Oh.. now I understand :D
This rocks!
Syranide, this is even more wonderful than before! To be honest, when you explained about the new thing with rounded object I didn't understand it a bit but I now I do and I love it. I also like the fact that if the prop has a inset the the second cursor would snap there. How does this work? Does it do a trace from the grid point in the direction of the normal? Also how did you manage to make the STools snap to the second cursor when you click? Keep up the great work.
[QUOTE=Vampired]Syranide, this is even more wonderful than before! To be honest, when you explained about the new thing with rounded object I didn't understand it a bit but I now I do and I love it. I also like the fact that if the prop has a inset the the second cursor would snap there. How does this work? Does it do a trace from the grid point in the direction of the normal? Also how did you manage to make the STools snap to the second cursor when you click? Keep up the great work.[/QUOTE] Yeah, I figured that nobody would understand what I meant, and it's hard to explain without pictures, but people will understand eventually ;) (it sounds kindy cheesy, but damn I love the new snap, so precise it's insane) To achieve the new snapping I used tracing, yes, from the "grid snap" along the normal towards the model (which had some interesting problems as there are often seams in the model there, which could make it trace straight through and so on)... Hehe, regarding how I snap the aim at one point and shoot at another is that you can override the view vector, what you are looking at while snapped is not what you are actually looking at (server-wise), this means that your weapon is actually aimed towards the "model snap" while your view has simply been overriden to look at the "grid snap". I'll try to keep it up ;) On another note, the grid has been remade and is working flawlessly, there is no longer a gap or overlap for the black/white lines. Now I'll just have to find out how to make center-lines and so on stand-out without looking out-of-place.
Ah I see, the CalcView hook, never heard of that one before. Anyway, after more testing it seems that this new feature, (tracing to the model to find the right position) it doesn't quite work for me. The way I work your script is to align my aim point near enough to the spot I want, press [i]and release[/i] E, now I'm aimed at the right point and I click. However, using your CalcView thingy you've set it so you have to be locked on (Pressed E) to make it snap to the right place. I tried removing that bit but all hell broke loose so I'll just leave it for someone else. GAGH On second thought's it really needs to see if we're aimed at the grid first, and that's a lot of work. I'm being too picky.
[QUOTE=Vampired]Ah I see, the CalcView hook, never heard of that one before. Anyway, after more testing it seems that this new feature, (tracing to the model to find the right position) it doesn't quite work for me. The way I work your script is to align my aim point near enough to the spot I want, press [i]and release[/i] E, now I'm aimed at the right point and I click. However, using your CalcView thingy you've set it so you have to be locked on (Pressed E) to make it snap to the right place. I tried removing that bit but all hell broke loose so I'll just leave it for someone else. GAGH On second thought's it really needs to see if we're aimed at the grid first, and that's a lot of work. I'm being too picky.[/QUOTE] Ah very good point there! I had totally forgot about that, it kinda breaks the "smart snap lock" yes... and the idea that you can simply click and then place. I'll have to see what I can do, it should be possible to have a secondary mode (mainly) for the "smart snap lock", that doesn't revert the aim to the "grid snap" again, but keeps it at the "model snap", and the cursor for the grid would then show colors as well (even when you don't hold e) so that you could still veriy that the snap is precise before placing. Does that sound like a possible solution? (I think it's basically the only solution) ... Just to clarify, this would make your eyes aim at the actual snap point once you release. Hmm... I could possibly make a small "hack", that would keep the "tricked" view even after you have released (e), but that would release the second you try to move or look around. Another thing that I might implement either way is to have the "smart snap lock" activate using a quick double-tap (e) as another way to activate it. My comments... 1st: would cause the aim to twitch every time you release (e) in order for your weapon to align from the "grid snap" to the "model snap"... alternatively it would always snap to the "model snap" when you press (e), but that might look out of place. 2nd: possibly the best I can come up with, doesn't cause any twitching, the only minimal thing is that it might be unintuitive that just touching your mouse would put it horribly out of place (as you are actually aiming at the grid ... and might be hard/not possible to implement. What do you think? (Just for the note, this is not strictly the new snap mode, it's because the old snap mode assumed that everything was squared and that the grid offset was the same as the snap offset = bad) (A little hastily written, but I hope you understand the most of it ;))
Hmm I wouldn't like the twitching, a great part of this script is that you can move around freely while locked and it still snaps to the place smoothly. I'd go for the second option but I don't understand thoroughly what you meant. Are you saying that it would stick to the model snap until you move the mouse? Maybe that's the best way. Unless you could specify an amount to move the mouse by? Edit: After writing that I maximised GMod again and nothing was working. I could press Escape and go to menu but I couldn't move or look around, also there was no HUD. [code] ERROR: Hook 'Snap.CalcView' Failed: autorun/client/view.lua:24: attempt to call method 'InVehicle' (a nil value) Removing Hook 'Snap.CalcView' [/code] Edit2: Oh Sh--! that's not your script!
[QUOTE=Vampired]Hmm I wouldn't like the twitching, a great part of this script is that you can move around freely while locked and it still snaps to the place smoothly. I'd go for the second option but I don't understand thoroughly what you meant. Are you saying that it would stick to the model snap until you move the mouse? Maybe that's the best way. Unless you could specify an amount to move the mouse by?[/QUOTE] The key idea with the first idea is that sometime during/after the snap, the aim would snap to the "actual snap"-point, that is, not look at the grid anymore. The other idea, would be like you say, it would simply retain the snap even after you have let go of the button (e), until you make any kind of movement, even though it might be possible to retain the snap for minor mouse movements, I don't quite see the point because the slightest change would cause quite a big error (and either way you'd see the cursor turn red if you move it to show that you are now off target, and people that are shaky with the mouse just have to hold the button ;)), and I think it would be hard to do as I then have to keep faking it.
You're confusing me, maybe I need to go to bed. So imagine you're looking at the grid point, you press E and it aims at the model snap instead, and so long as you're holding E it 'sticks' or 'follows' that point when you move. Now if you let go it will release and look at the grid point again. That's how I imagined it, I don't see a problem with that. I have this feeling that I still don't know what I'm talking about. Edit: But now that leaves the problem that I mentioned in the first place... I'm so sorry I'm talking crap...
DUDE! This [u]WINS YOU AN INTERNET.[/u] No, two! This makes aligning things so much goddamn easier! Like spellcheck in Firefox. I got the beta, with the attachment to curves. INFINITELY USEFUL! I love it!
New beta is available of 0.9.0, this as said before, a huge update from 0.8.1 with a new snap system, per-model offsets, improved grid system and more. ● Custom per-model offsets. (more information to below) ● New snap mode, perfect precision from "any" angle on any model. (more information to 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. ● Rewrote the square face picking routines ● And a lot of minor fixes everywhere ● [b]No context mouse snapping in the beta![/b] As of these new techniques, it has changed quite a bit, and I would be very happy to hear feedback (both good and bad) on what you think of the new system, both visually and technically so that I can better adjust it. If you have a few minutes to spare, I suggest you read the information on the new functionality as well. [b]Download available on the first page[/b] Enjoy! EDIT: I also posted the solution for the "flippy lines" here: [url]http://forums.facepunchstudios.com/showthread.php?t=324523[/url] , if anyone is interested or has been having the same problems.
Great mod Syranide! Really useful. is thier a possibility you can make it work on LifeSupport Devices? The old Autosnap addon does this and it makes spaceship building much easier. Thanks!
[QUOTE=Phydeaux00]Great mod Syranide! Really useful. is thier a possibility you can make it work on LifeSupport Devices? The old Autosnap addon does this and it makes spaceship building much easier. Thanks![/QUOTE] Yes of course, I've simply forgot about it. ;) In the mean time you can hardcode it yourself: Simply go to line 361 in client.lua: [lua]if (entity:GetClass() != "prop_physics") then return end[/lua] And remove that line, and it will now work on all entities. I've have now added an option for this in the next release.
I'm sorry, but this has probably been asked 20 times already but is it client side? If so, that's a LUA King for you!
[QUOTE=kartracer00]I'm sorry, but this has probably been asked 20 times already but is it client side? If so, that's a LUA King for you![/QUOTE] Yes.
[QUOTE=MrDoomBringr]Yes.[/QUOTE] Thanks! :D
[QUOTE=Syranide]Yes of course, I've simply forgot about it. ;) I've have now added an option for this in the next release.[/QUOTE] Awesome, thanks for the quick reply/fix! :)
Syr please try autosnap with phoenix large wheel and fix asap .)
[QUOTE=Qjet]Syr please try autosnap with phoenix large wheel and fix asap .)[/QUOTE] I'm not quite sure what you are referring to and what's wrong? I tried snapping on most of the wheels in the phoenix pack and I had no problems. (Although that could be that I accidentally fixed something in my version) Please specify further and I will have a look.
the large wheels seem to have issues when tracing snap is right on the edge. the tracer for the snap extends several units into the wheel then stops. This can be noticed on the large wheel, try auto snapping on the side of the wheel right in the middle, you might notice how the tracer extends into the model. this isn't good.
Prop has two snap points. One is actual, another is wrong one and when I press "E" , mouse snaps to the wrong point, which is located somewhere else...
[QUOTE=dkikisb]Prop has two snap ponts. One is actual, another is wrong one and when I press "E" , mouse snaps to the wrong point, which is located somewhere else...[/QUOTE] It's not a fault, it's the new system, the snap on the grid basically indicates where on the grid you are looking at. The other one, that is offset from the grid is the actual snap, this is perfectly aligned with the object, and this is what allows you to place position things on round and uneven entities, as well as having a grid that matches the visual representation of the entity even though the bounding box is not aligned with what you see. (Note: the visual representation is seldom the same as the actual bounding box, therefore it will seem like you are placing slightly off, but you aren't) So it's no bug at all, it simply allows you to place objects with extreme accuracy (most often with an error margin less than 0.0001 (green) ... a difference of 0.01 is basically small enough that you won't see the difference, you get my point ;)) I suggest you spawn a tire, cannon ball or something that is uneven, and try it out and you will see that regardless from where you are snapping, the placement will always be at the same place (namely the snap point that is not located on the grid). Here is a picture showing just this (see where aim is and where the grid snap is, and you will also notice that where the aim is also where the object also should be placed): [URL=http://img103.imageshack.us/my.php?image=kkkkdh3.jpg][IMG]http://img103.imageshack.us/img103/8366/kkkkdh3.th.jpg[/IMG][/URL][URL=http://img103.imageshack.us/my.php?image=lllllt0.jpg][IMG]http://img103.imageshack.us/img103/3554/lllllt0.th.jpg[/IMG][/URL] I added a second image there, showing me placing 2 thrusters from two different angles, and they both end up perfectly horizontally aligned. EDIT: I'll have to explain this somewhere on the first page as well I think, thanks for pointing it out.
Oh :D , I didn't notice that :D Yeah, it isn't bug, works very well!
Sorry for taking my time with the final 0.9.0, not much has happened since the beta, but I was busy with other things, either way: ● 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 Be sure to read the information on the new snap mode if you feel that it behaves strangely (because it isn't, it's much more precise now). But it has changed and improved a lot. For those of you who haven't used the beta, this is a [b]major[/b] update with probably bigger and better improvements than the introduction of SmartSnap. I'm open for feedback and suggestions! Enjoy!
Bump for awesomeness. Would it be possible to make grid maps? For example on the PHX trains we could specify where the most common places you would want to easy weld (The track endings) Then we could just press E rather than aiming on the cross.
[QUOTE=Syranide]:words:[/QUOTE] I love you :love: This is one of the most useful things I've seen in a long while.
I was just thinking about requesting something like this. Downloading and lua king'ed!
Thanks for the comments! [QUOTE=conman420]Bump for awesomeness. Would it be possible to make grid maps? For example on the PHX trains we could specify where the most common places you would want to easy weld (The track endings) Then we could just press E rather than aiming on the cross.[/QUOTE] I'm not exactly sure what you mean... placing arbitrary points on the grid as additional snap points, or place arbitrary points on the grid that overrides the grid entirely? It sounds like you intend some system where you can snap to one single point by just looking at the prop? (As you can already weld train tracks together perfectly by just selecting the same two relative snap points on the grid when easy-welding, there is no need for welding exactly at the cross on the track) Or am I way off?
its awesome and solves some problems with aligning props corectly, But do u think the next version could include a tool that lets us cut the props into sections along grid lines, and move them independently [b]Edit:[/b] its awesome and solves some problems with aligning props corectly, But do you think the next version could include a tool that lets us cut the props into sections along grid lines, and move them independently
cutting props is almost impossible :( but lua king'ed! smartsnap is awesome, built all my fort's and car's with this thing :D
Sorry, you need to Log In to post a reply to this thread.