Nano's Parenting Tool

// Parenting Tool\

http://img34.imageshack.us/img34/975/releasepicjpg.jpg

By Nanospork (Non-FP name)


tl;dr Version: Parenting (super weld) that doesn't blow. Download below.

Version 0.55 (With Dupe Support!) now out.

[release]
[tab]Current Version:[/tab]
0.55
[tab]Download:[/tab]http://www.garrysmod.org/img/?t=dll&id=69479[/release]

Long-ish version:
We all know parenting sucks. A lot. Most parenting tools out there suffer from:
[release]
-Incompatibility with multiplayer
-Server-crashing or prop-deleting glitches
-Undo difficulties
-No “unparenting”
-No chain-linking
-Poor collision
-Duplicator issues
[/release]
Upon realizing this, I set out to make a super parenting tool. For those who don’t know, Parenting is when the game engine locks one entity’s movement to another. It is absolutely secure, unlike welding, and causes significantly less lag. But almost all the currently existing parenting tools suffer from the above issues. The tool I have created, however, has these fixes:

[release]
-Child props (props that have been parented) can be fully undone.
-Child props can be reverted to standard physics props via right-click.
-All children can be removed from an entity via reload.
-Significantly better collision than other parenting tools:
This is achieved through a little tip I gained while mapping - dynamic props parent a hell of a lot better than physics props. Therefore, I wrote up the system to convert physics props to dynamic props for parenting - and back. This ensures players do not fall or slide through child props they’re on, and that children have proper, full collision with other props.
-Props can be parented in chains (parent A to B, B to C, C to D; however, after that you can’t parent E to B, but you could parent E to D)
-Fixes to prevent disappearing props (parenting to a child, etc.) and server crashes.
-Option to freeze un-parented props. (Stuff will stay still until you unfreeze it with the physgun if you unparent it either individually through right-click or all at once with reload- makes for much neater mass unparenting.)
-Duplicator Support[/release]

Remaining limitations (hopefully to be overcome in later versions or changes to the source engine)
[release]-Parented props cannot have anything attached to them. All traces just go straight through parented props to the world or whatever’s behind them (the right-click remove uses a special technique that unfortunately only works built into the tool.)
-Collision is only still bugged in two ways:

  1. Players have no friction against parented props (full collision, you’ll just slide if it moves from under you. You can still walk on it normally.)
  2. Parented props will go through entities on one condition: The entity being collided with is frozen, or an entity behind it stopping its movement is frozen. This means stuff will go through the world, but you could do that with Advanced Ballsocket anyway.
    -Weight, buoyancy, and similar physical properties are void.[/release]
    It’s not perfect due to the limitations of the Source Engine, but I hope you’re all happy with it anyway. So long as you don’t use it for a moving surface you walk on or for, say, landing gear, it works perfectly. Any kind of decorations, walls inside a structure or vehicle, railings, what have you, it’s all good.

Release Notes:
May 30, 2009 - 0.55 - Dupe support added.
May 27, 2009 - 0.50 - Released. Hopefully bug-free and fully compatible with multiplayer.

There is a consolecommand to enable duping with parents, i don’t know the exact command but you can look it up.

:stuck_out_tongue: N A N O ! HEY! :D! NICE !!! GOod work :smiley: Ill send PM Bugs o: :smiley:

Used it, works flawlessly. No bugs from what I can see.

From what I read, I think your chain linking could be made better. You could try making it like the multi parent tool.

The adv duplicator can unparent props. But yeah, its good you added a button for single props and not whole contraption like adv dupe Always do (its the spawn w/o cosntraint box).

Does any prop have friction to players? Cause when I make for example cars, I wont go in its direction unless there is something behind pushing me (or i sit in a pod).

@Feha: Yah, unfortunately the props do not exert friction. I’m not entirely sure why, but they don’t. The collision still works fine, of course, but I recommend leaving the base of your vehicle (say, your car chassis and “floor”) as a normal prop and then parenting on walls/railings/decorations (the body of the car.)

Also, I may make a multi-/smart-parent option so you can add stuff en mass.

If anyone knows that console command to allow parented props to dupe, it would be greatly appreciated. Thank you.

Oh, one more thing, forgot to mention this in the first post, I’ll add it: There is indeed a checkbox to freeze un-parented props. (Stuff will stay still until you unfreeze it with the physgun if you unparent it either individually through right-click or all at once with reload- makes for much neater mass unparenting.)

I meant, does they have friction when not parented? Judging by your answer you thought I asked about parentd props.

Also, Another thing you should get is a contraption mode for the parent tool (easy precision style)

Yah, I guess in the next version I’ll look into smart- and easy- styles of using it.

And yes, props that are not parented do have full friction.
See, what it does when you parent a prop is instead of just parenting it, it copies the data and creates a different type of prop that the engine handles better with parenting in its place. When you un-parent, it re-creates the original physics prop using that same data. So it should still have the friction.

Easy precision parents can be duped if there’s a constraint to the prop prior to being parented (for instance, nocolliding a child to parent, THEN parenting the child to the parent). I don’t believe it turns the prop into a prop dynamic, however it’s still worth a look I’d believe. Take a looksee and see what they did.

@Stickynade: Looks like a good idea. I’ll put that into the next version as a hacky fix until I can find the console command. Unfortunately, no-colliding does create a new constraint entity (parenting does not make a new entity - one of the reasons it’s so much more efficient) but it is the cheapest of the constraints, I believe, so I’ll try that.


Version 0.55 is now out, with duplicator support!

FUCK YEAH I DID SOMETHING IMPORTANT

Downloading new version now.

For some reason, the parent prop gets no-collided with everything, including world. Is it supposed to be like that?

The parent becomes no-collided? Interesting… I have an idea as to why this happens, but if you could find out more info on this it’d help me fix it (how many props were parented, if you had clicked on the world at some point and it said “Invalid Input” etc.)

What if I parent A to B, then parent C and D to B and continue in two separate chains? Is that possible?

Not entirely sure what you’re saying, so let me put it this way:
You can make any kinds of chains you want, but once a prop is parented, you can not parent other props to it. Parent props can have an unlimited number of children.
So you can do:
A to B, B to C, C to D
or
A to B, B to C and in another chain X to Y, then Y to Z, and then parent Z to C also.

I may be mixing the parent and child up, but one is completely no-collided to the world, not to me though.

Yah, the child is the first prop you click, the parent the second. The parent is the one you can still touch with the physgun and everything, whose movement the child is locked to.

Child props will not push immobile entities, and cannot exert force back on the parent, and are therefore forced to go through them, though they will have full collision with movable entities. That’s why in your observations the child prop will go through the world - it can’t push the world and can’t push back on its parent. It will have full collision with everything else though.

Here is a question, how useful would this tool be for building spacebuild spaceships. I mean, a would parenting be useful there? Welding the ship hull segments together, or is it simply more worthwhile to just put decorations, buttons and ship componants into the ship, rather then linking the hull together?

When i try and grab the child entity, it just comes along and then when i let go of it, it weld back to the parent.
Is that suppose to happen, because i cant build a car with stuff im not allowed to touch :frowning:

Meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeh