Results 1 to 12 of 12

Thread: New thoughts on Snaps: Pegs and Sockets

  1. #1
    Join Date
    Feb 2017
    Posts
    178

    New thoughts on Snaps: Pegs and Sockets

    In addition to the "snap channel" concept that I discussed in another thread, I'd like to propose another change to the snap system: Pegs and Sockets.

    Right now, an object that snaps to a snap-point does so based on the object's origin. What if you wanted an object to snap from a location (or multiple locations) other than its origin? This is a peg. A peg snaps to another type of snap point called a socket. This means that pegs don't snap on to other pegs and sockets never snap on to other sockets. Heck, I would make it so that Sockets never snap on to pegs. (if you want that effect, then you should create a peg and a socket in the same location for back and forth).

    Edit: in regards to rotation, both a peg and a socket should have the option for orientation, as current snaps do. If both a peg and a socket have an orientation, then the object is rotated so that the orientation of the peg matches that of the socket.

    Combine this with the snap channel system and I'm in heaven.

  2. #2
    It is an interesting idea and the names work exactly like you would expect them to. My only worry is what sort of detection range are you putting on it? Coz if you have a peg on a model and you have to do a bunch of rotating b4 it snaps, maybe that defeats the point (tho not necessarily). I agree with the sockets not snapping to pegs though.

  3. #3
    Join Date
    Feb 2017
    Posts
    178
    It'd be nice to set the magnetic strength of a socket to dictate how far away a peg will be drawn to the socket.
    I imagine the rotational aspect to work more like current rotation snaps work. You don't have to pre-rotate the model for the peg to snap into the socket, rather that the object will auto-rotate while it moves on to the socket in such a way as the pegs rotation matches the socket. I can go visual if you like.

  4. #4
    Imo, what would be better than a "magnetic" strength, which would mean a sphere, setting dimensions for a cube or cylinder like size (offset in xyz and scale in xyz for cube and scale in height+diameter for cylinder) would be better. I think they've had a lot of difficulty choosing the proper size for snapping points in general

  5. #5
    Join Date
    Feb 2017
    Posts
    178
    whatever mechanism or shape for "magnetic strength" that would be appropriate or easiest, sure - the point is that a some sort of snap range system would be a good idea. Honestly, it's probably a projected circle right now, but who knows.

  6. #6
    Join Date
    Feb 2017
    Posts
    178
    There are about four different projects that I'd love to knock out that are pretty dependant on this feature. I don't suppose there is any kind of milestone roadmap out there for TTS?

  7. #7
    While this is a nice concept, it's very specific and snap points are enough for most people. You can have that behavior (or any other specific one) by scripting around onObjectPickUp, onObjectDropped.

  8. #8
    Join Date
    Feb 2017
    Posts
    178
    Curious: how would you use scripting to replicate this effect. Preferably without looping through all objects on the table to find a nearby socket.

  9. #9
    Store all sockets and pegs in a table (as objects if they are tied to objects or as positions if you want them static). You can handle their creation either purely by script or by e.g. having a pawn with buttons that creates new ones (that player can move around). If you want some kind of object to always have a peg/socket, handle that in OnObjectSpawn trigger.

    In the OnObjectDropped trigger you check if your objects has a peg/socket (only looping through the mentioned table), grab a list of all pegs/sockets it can attach to (again, looping through above, logic on what snaps to what can be applied) and deduct the closest one. If it's close enough, snap.

    If your pegs/sockets count isn't going by thousands, getting the closest one could simply loop over all applicable counterparts (not everything, just stuff that current obj can snap to of course) and get the one with minimal distance.

    This can be done very cleanly, without using update() or getAllObjects() at all I think.

  10. #10
    Join Date
    Feb 2017
    Posts
    178
    I'll have to give this a try. The only thing that I'm worried about is keeping these scripted socket and peg definitions on all the objects. I'd rather not use the global script if I can help it because of how I organize my mods. I still think this would be a good, if small, addition to the game, however.

  11. #11
    Quote Originally Posted by FoaS View Post
    I'll have to give this a try. The only thing that I'm worried about is keeping these scripted socket and peg definitions on all the objects. I'd rather not use the global script if I can help it because of how I organize my mods. I still think this would be a good, if small, addition to the game, however.
    You can have the "master" script on a single object and essentially turn this on by spawning it. I feel like that's the way to go if you want to stay modular.

  12. #12
    I don't think it is so specific. A problem that TTS seems to have at the moment is the lack of abstraction, you often find yourself in a corner, needing to go to blender or to mess with your folders manually because it can't be solved in the game. It might put people off.

    This peg system would be a really nice addition, useful for all manners of war gamers, it would solve the problem of turrets always trying to snap midway through the barrel. Going into blender is a quick fix, but it still a real pain to have to go to blender every 15 minutes because you have to modify the resources for your campaign because you have no in game workaround.

    It gives the game a really cheap indie feel, which is not deserved, TTS is great but it needs to get slightly more friendly and player being able to solve their problem IG is part of it. It makes for a much better user experience, and would probably increase the amount of workshop content, as it would alleviate the barrier of entry.

Similar Threads

  1. Dose anyone know why snaps sometimes do not work?
    By Tragic in forum General Discussion
    Replies: 0
    Last Post: 05-27-2017, 07:55 PM
  2. [SOLVED] Xia needs some snaps added!!
    By Tragic in forum Xia: Legends of a Drift System
    Replies: 2
    Last Post: 03-26-2017, 02:04 AM
  3. [DISCUSSION] Thoughts from me and my nephew
    By TheRaven81 in forum Scuttle!
    Replies: 0
    Last Post: 03-25-2017, 08:10 PM
  4. Interprocess comunication or tcp sockets
    By CmdSoda in forum Scripting
    Replies: 7
    Last Post: 07-29-2016, 10:36 AM
  5. Some thoughts after 2 months of playing...
    By BrashFink in forum General Discussion
    Replies: 1
    Last Post: 03-11-2015, 01:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •