Is there a way to grab and connect nodes from lua? I noticed a function call in the "Click to Enter Vehicle" mod by Angelo234: be.nodeGrabber:clearVehicleFixedNodes Are there any additional be.nodeGrabber functions available? What I'm trying to do is programmatically load a dummy on an ambulance stretcher, then secure the dummy to the stretcher. It's not easy to do this manually with the node grabber, so I'm trying to build a script to do it. I think I've got the dummy loading part figured out, but I'm a bit clueless on securing it.
That is a really cool idea for a mod, but why don't you just make the dummy part of the vehicle? No need to mess with LUA then
--- Post updated --- I'd like to be able to extricate dummies from wrecked cars. The dummy loader would be part of a small tool pack for ambulance roleplay. The pack would also include a tool kinda like the jaws of life, which I'd have to build too. A player would use the JoL to unwrap the car from around the dummy, I mean "patient". The player would then drag the patient from the car and use the loader script to load the patient onto the gurney. Getting the now-loaded gurney out of the ambulance would be the easy part (and fast & not safe). I've already enabled the gurney to be jettisoned out the back of the ambulance. If you've seen Richard Hammond's Top Gear ambulance, then you know what I'm going for. ...and the Jaws of Life tool would definitely emit the sound of hydraulics. It just wouldn't be complete without it.
That is a really cool idea, I hope you can figure it out! If I knew how to help I would, but I don't.
Thank you. I suppose the Jaws of Life tool could also be used for chop shop roleplay, or general destruction enjoyment.
There is a function called be.nodeGrabber:fixCurrentNode() which does connect two nodes together. The catch is that it can only connect nodes you hover over with your mouse cursor, since the function is used for connecting two nodes by hand. But I don't know of any other function that will do exactly what you want.
I might have a rough idea, how about making couplers like for trailers? Like both the stretcher and the dummy have couplers that connect together and are controlled by a LUA file
Doh! I was afraid of that. I was hoping there was a function like be.nodeGrabber:fixNodesById(obj1Id, obj1NodeId, obj2Id, obj2NodeId). Maybe something like that might appear someday. That would allow for all kinds of neat stuff: harpoons, sticky mines, lotsa stuff. Thanks for letting me know these aren't the droids I'm looking for. I would've kept looking for a while. --- Post updated --- That's a GREAT idea! With couplers, I don't think I'll have to teleport the dummy to the gurney. All the player has to do is activate the couplers and get the dummy close enough to the gurney. Having to drag the dummy is more realistic than teleporting it in terms of roleplay anyway. Here was my original Plan B: When a vehicle is spawned inside of another vehicle, they get stuck together. Maybe I can stick a dummy to a gurney if I teleport the dummy to a position where its volume slightly overlaps the gurney's volume. ...but your Plan B is much better. Can the couplers be made unique, such that each of the dummy couplers will only connect with a particular gurney coupler? Edit: I just checked some docs, and it looks like I can make unique couplers. Yes! This might work! Thank you!
Yeah unique couplers work, but they don't modify the camera zoom properly, and could have issues with resetting the car that require some LUA to fix. (check the T-Series dump upfit for example)