[QUOTE=Syranide]
Saving the options, using CreateConVar(..., ..., true, ...) doesn't not save it, that only implies that a convar is saved when you save a game (I've tried it, resets everytime you restart) ... but I have implemented a custom method for saving the settings (also next release). I've looked around, although I know this is automatic for TOOLs, I haven't found a way to create global convars without having a tool.[/QUOTE]
That's strange I was almost sure it did. Although I haven't tried it I found /cfg/gmod_cvars_cl.txt is where all the values are stored including gmod_toolmode. This is the line where gmod_toolmode convar is defined:
[lua]
gmod_toolmode = CreateClientConVar( "gmod_toolmode", "rope", true, true )
[/lua]
Maybe I'm wrong, but if you already have a method for saving it's probably good. Good luck on this.
This is great, the camera lock on is perfect. (By the way, does placing the nailer from across the map in the video remind anyone of a cheesy viagra ad?)
[b]0.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 "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, 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
There are some other minor changes, you can now set the grid offset by hand (until the per-model grid offset is available). And some other minor things.
Per-model grid offsets are coming along pretty nicely, and should be available pretty soon.
[QUOTE=Vampired]That's strange I was almost sure it did. Although I haven't tried it I found /cfg/gmod_cvars_cl.txt is where all the values are stored including gmod_toolmode. This is the line where gmod_toolmode convar is defined:
[lua]
gmod_toolmode = CreateClientConVar( "gmod_toolmode", "rope", true, true )
[/lua]
Maybe I'm wrong, but if you already have a method for saving it's probably good. Good luck on this.[/QUOTE]
I'll have to look into that, but from what I can see, that is a tool (tools have convars that automatically save, I haven't found any similar support for hooks/generic lua)... I now save them myself instead into a file (works, but would be much more neat with convars saved the "correct" way, if possible, so I'll look further into it sometime).
Implemented your idea with the "lock snap", although I rewrote it all because I found many more "advanced" uses for it (now you can lock snap, and then bring up the context menu, and walk around the prop) ... and a lot of special cases, you don't want lock snap in the content menu and so on, etc etc... Superb idea and you have been given credits for it!
Nice job, this is a pro-builder must-have. Gold star and a Download!
I'd try this new version but my Steam isn't working right. :S
New release , good job! This is very useful! Thanks!
[QUOTE=Rysoke24]I don't know if you should be calling people disabled -> You spelled, disabled wrong. :downs:[/QUOTE]
Are you sure that wasn't intentional? :v: [spoiler]I feel stupid :downs:[/spoiler]
If i install this on my server, can peoples who join use it?
You will have to put
[lua]
AddCSLuaFile("client.lua")
AddCSLuaFile("menu.lua")
[/lua]
in a separate file in /autorun/server/ to make it send to the clients.
Anyway Syranide, I just testing this out and it's even better, the delay thing is much better than what I did.
Edit: That reminds me, I think you should change the file names of client.lua and menu.lua because if another addon uses the same file names one of them will be overwritten.
As long as they remain in their individual addon directories there is no problem with the names.
I'm happy to announce that I have now implemented per-model offsets, for square props you can now have a perfectly aligned grid AND perfectly placed objects (you can place props even at 85 degrees without any error) as there now is a snap-offset too that displaces the cursor to the bounding box, while allowing you to have a grid that is consistent with what you see.
Although! I will not release it just yet, and that is not because I want to hold it back, or tease you, it's because I'm working on something even greater and if successful would allow you to place objects with perfect precision even on round and uneven surfaces! That does not imply a grid that aligns to the curvature of the object, but rather that the mouse is displaced according to the surface, so although you wouldn't get evenly spaced placement for round objects, you could easily have symmetrical placement or aligned placement.
So hold on to your hats! :v:
[QUOTE=Vampired]You will have to put
[lua]
AddCSLuaFile("client.lua")
AddCSLuaFile("menu.lua")
[/lua]
in a separate file in /autorun/server/ to make it send to the clients.
Anyway Syranide, I just testing this out and it's even better, the delay thing is much better than what I did.
Edit: That reminds me, I think you should change the file names of client.lua and menu.lua because if another addon uses the same file names one of them will be overwritten.[/QUOTE]
Glad that you like it! (I did! ;))
I'll look into that with the filenames, although I'm fairly sure what spbogie said is correct, but I'll see what I can find just to be on the safe side.
Nevermind saw it in original post. Looks great :)
I have no idea what you just said in your post #72 Syranide but this tool is freaking awesome! Glad to see a new version. Here have another Lua King. Oh and here's a cookie ;P.
:lol: looks like an aimbot... not that I'd know what that looks like...:ninja:
[QUOTE=Overkill1010]I have no idea what you just said in your post #72 Syranide but this tool is freaking awesome! Glad to see a new version. Here have another Lua King. Oh and here's a cookie ;P.[/QUOTE]
COOKIE!
And here is a cookie for you!
Perhaps this will put my words into something more tangible ;)
[URL=http://img201.imageshack.us/my.php?image=curvetr3.jpg][IMG]http://img201.imageshack.us/img201/8625/curvetr3.th.jpg[/IMG][/URL]
Perfectly aligned placement on non-square props, works well on uneven too (but note the grid and the spacing, this is because as you can see the grid does not follow the entity, but the mouse is displaced towards the entity instead, however, I will most likely add a "sine grid" or something that will allow you to position perfectly on round objects (while still having a box grid))
Although there are still some kinks in it, so no promises, but it is looking very promising, another important consequence of this is that it now works on any prop without predefining any stuff. Only the grid needs to be offset, and there is no longer explicit need for it as it mostly serves as a visual aid (and to make edges usable).
EDIT: LOL, I just found out what was causing the major kink... on certain props it would spawn very oddly, and try to spawn it in the air, I just found out why... it was TOO precise it kept hitting exactly where the model-seams were, and obviously some bug made it possible to then spawn them inside the prop :v: (I'll just have to add an (insignificantly) small error margin for when that happens)
Before you release can you put some sort of marker where the half way spot is?
[QUOTE=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][/QUOTE]
:downs:
[QUOTE=conman420]Before you release can you put some sort of marker where the half way spot is?[/QUOTE]
I'm not exactly sure what you mean.
But for clarity, there will be two modes (toggle):
1. the mouse will look at the "grid snap" (but you will actually shoot at the "shoot snap")
2. the mouse will look at the "shoot snap" (and revert to the grid when the snap is released)
And obviously, since the gap between the "grid snap" and "shoot snap" can be quite big there will be some visual que to where it will be placed, I will be trying different methods for this.
Ohh i get it now Syranide, thanks. Here, have another cookie! :D.
Wow we are all replying rather quick today!
What I mean is say you have 16 grid lines on your prop and you want to know which grid line is closet to the centre of that prop.
Here's a paint picture:
[img]http://img179.imageshack.us/img179/8310/gridhq1.png[/img]
As you can see the middle grid line is highlighted blue (Or any colour you choose) This would be useful if their was 16 grid lines where you have to count along 8 lines to find the centre. (Yes I am aware of the unevenness of those lines)
This is really great, i tried it out the other day. I was wondering how hard it would be to do a rotational snap when using easy weld, as the two objects can be welded in the exact spot you want them, but the rotation has to be done by eye
Wow I was amazed by the final shot in the video.
[QUOTE=conman420]Wow we are all replying rather quick today!
What I mean is say you have 16 grid lines on your prop and you want to know which grid line is closet to the centre of that prop.
Here's a paint picture:
[img]http://img179.imageshack.us/img179/8310/gridhq1.png[/img]
As you can see the middle grid line is highlighted blue (Or any colour you choose) This would be useful if their was 16 grid lines where you have to count along 8 lines to find the centre. (Yes I am aware of the unevenness of those lines)[/QUOTE]
I do agree that this is a good idea, although not a big blob in the middle, just maybe a different shade of the grid colour along the centre horizontal and vertical lines.
As for what spbogie said, I think he's right it's just when I typed in lua_openscript_cl, the script came up as autorun/client.lua. But it's not my script it's yours :)
[QUOTE=Vampired]I do agree that this is a good idea, although not a big blob in the middle, just maybe a different shade of the grid colour along the centre horizontal and vertical lines.
As for what spbogie said, I think he's right it's just when I typed in lua_openscript_cl, the script came up as autorun/client.lua. But it's not my script it's yours :)[/QUOTE]
Yes that is what I had in mind but I just wanted show that there was something different about the centre.
[QUOTE=conman420]Yes that is what I had in mind but I just wanted show that there was something different about the centre.[/QUOTE]
I've been meaning to add this, although as you say, thicker lines or something for the middle-most lines (most likely adjustable to how many squares, e.g. 1/4 2/4 3/4 markers too, etc), but this will probably wait until I implement the new grid, that works better with rotation.
Anyway, here is a treat for all you dedicated people, it is a devloper beta of the upcoming SmartSnap 0.9.0, with per-model grid offsets and what's even better, perfect precision for placement on any model, round or uneven and from "any" angle (as long as the model doesn't obstruct the view), NOTE: the grid does not fold around the objects, but the placement of the objects follow the curvature over the object. And note, it isn't very polished yet, so things will change. [b](NOTE: the cursor no longer relates to the angle, but the effective margin of error when placing from your current position, a green cursor means extremely small error (or zero), yellow means very small, and red is everything above (or obstructed view). You should rarely get yellow cursors, if you do, the error is still very small, and you can often get it green by trying different angles)[/b]
[b]DOWNLOAD REMOVED, NEW BETA AVAILABLE IN THE INITIAL THREAD[/b]
The grid-offset functionality is accessed using "snap_dev_gridoffset <distance>", and "snap_dev_saveoffset".
By mapping "snap_dev_gridoffset 0.1" to a button, while looking at a face of the prop and pressing that key, will make the grid on the face of the prop offset inwards... "snap_dev_gridoffset -0.1", outwards. I have also included the closed red container and most square PHX construct props as default offsets with 0.01 precision. REMEMBER: You must point at the model and then execute "snap_dev_saveoffset" for the offsets to be saved! Personal recommendation is to use material/matte white when offsetting grids.
There are some other minor tweaks too, and oh, [b]the context snapping is disabled in this version[/b].
[QUOTE=greenarrow]This is really great, i tried it out the other day. I was wondering how hard it would be to do a rotational snap when using easy weld, as the two objects can be welded in the exact spot you want them, but the rotation has to be done by eye[/QUOTE]
Thanks! That's outside the reach of this addon, you'd have to poke on garry or someone to either implement some kind of snapping similar to the physgun in the easy-weld or create some external addon that can affect rotation of things.
Does the grid like fold around the round props in this version?
This is fucking Amazing!!!
i have been waiting for something like this since 2006 when i started playing!
[QUOTE=Da_Masta]This is fucking Amazing!!!
i have been waiting for something like this since 2006 when i started playing![/QUOTE]
There already was something like this before called [url=http://forums.facepunchstudios.com/showthread.php?t=270592]autosnap[/url]
[QUOTE=TheFoxz]This looks useful. Does the grid like fold around the round props?[/QUOTE]
It doesn't, that would be extremely hard, if not next to impossible to get it done right, and might not be as useful as one might think either (for anything but perfectly round or square objects)... as I've said before, there might come a cylindrical/round grid later on, but there is currently too much work and too little payoff to implement as with the new system, it would only imply visual difference.
The idea behind the new system is that the grid is only used for snapping the mouse to the surface, but then the mouse actually goes in/out of the grid to where the collision box is, so as you can see in the picture somewhere above, you can place with perfect precision on round models, BUT, the grid is still square (there will be a grid for round models later, NOTE, not round grid, but a grid with snap points distributed so that it acts like a round grid, placement-wise).
[QUOTE=Da_Masta]This is fucking Amazing!!!
i have been waiting for something like this since 2006 when i started playing![/QUOTE]
Like TheFoxz said, I've merely remade and improved the previous Autosnap, which had the same purpose.
Sorry, you need to Log In to post a reply to this thread.