grandbravo 11 Posted May 20, 2020 So, a while ago I've stumble across a bug with attachTo and static AI weapons (.50 cal, launchers, Preatorian 1C etc). If you attachTo a MG .50 cal (or any other static MG, launcher, etc) to the H-barrier Watchtower, house, bunker or a Praetorian 1C to the freedom carrier / destoryer, the AI starting to glitch. The turret rotates without reason in a shocky way. This however, doesn't seems to happen if you attach the weapon to a sandbag barrier of some sort. First I thought this glitch appears when a static weapon is placed inside the object virtual box (boundingBox) but that seems not to be the case when I attach it far outside the object. Using workarounds like a VR Cube as a sort of attachTo bridge between the two doesn't seem to do the trick eighter. Detach object is a fix, but most cases you dont want that for a good reason. Its a shame though, using attachTo for the carrier and destroyer is impossible and buggy but very necessary. I’m out of options and hope someone here has a simple solution. Share this post Link to post Share on other sites
the_one_and_only_Venator 162 Posted May 20, 2020 3 hours ago, grandbravo said: So, a while ago I've stumble across a bug with attachTo and static AI weapons (.50 cal, launchers, Preatorian 1C etc). If you attachTo a MG .50 cal (or any other static MG, launcher, etc) to the H-barrier Watchtower, house, bunker or a Praetorian 1C to the freedom carrier / destoryer, the AI starting to glitch. The turret rotates without reason in a shocky way. This however, doesn't seems to happen if you attach the weapon to a sandbag barrier of some sort. First I thought this glitch appears when a static weapon is placed inside the object virtual box (boundingBox) but that seems not to be the case when I attach it far outside the object. Using workarounds like a VR Cube as a sort of attachTo bridge between the two doesn't seem to do the trick eighter. Detach object is a fix, but most cases you dont want that for a good reason. Its a shame though, using attachTo for the carrier and destroyer is impossible and buggy but very necessary. I’m out of options and hope someone here has a simple solution. You can attach it to a metal barrel and then hide that. that has something to do with the type of what u attach it to. Share this post Link to post Share on other sites
Harzach 2507 Posted May 22, 2020 I tend to use BIS_fnc_attachToRelative over attachTo when it comes to static objects. Never had this problem. Give it a whirl. Share this post Link to post Share on other sites
grandbravo 11 Posted May 27, 2020 On 5/20/2020 at 6:58 PM, the_one_and_only_Venator said: You can attach it to a metal barrel and then hide that. that has something to do with the type of what u attach it to. Turret attachTo [carrier, [x,y,z], "staticWeapon"] doesn't seem to work. On 5/22/2020 at 7:08 AM, Harzach said: I tend to use BIS_fnc_attachToRelative over attachTo when it comes to static objects. Never had this problem. Give it a whirl. That function is only usefull if you have 2 objects in the editor/zeus that you want to attach with each other without actual x, y, z coords. Anyhow I bet I found the issue: If you attach 1 object to 2 objects, it will detach from the first attachment and then attach to the second object. Example: obj1 attachTo [obj2, [pos]]; obj1 attachTo [obj3, [pos]]; (this will cause obj1 to detach from obj2) doing it reverse: obj2 attachTo [obj1, [pos]]; obj3 attachTo [obj1, [pos]]; (no issue, but obj2 and obj3 have no vehicle collision, aka simpleObject) with static MG (and other turrets) I bet that the game use attachTo as for AI manning these static weapons but in reverse order: StaticMG attachTo [AI, [pos]]; If you want to attach the StaticMG to a bunker: StaticMG attachTo [bunker, [pos]]; causes the issue This limits the option for me to weaponize the freedom carrier or destroyer and have to place them losely. If someone has a working way to weaponize these ships, I'm happy to hear all about it! Share this post Link to post Share on other sites
the_one_and_only_Venator 162 Posted May 28, 2020 The good thing about the metal barrel is that it is not affected by gravity but still is 'simulated enough' to not cause problems with AI attaching turrets to it. Try to put the barrel inside whatever object you want to attach sth to (e.g. carrier, bunker) and then hide it by using the eden special state. Then place the turret where u want it and use the mentioned attachToRelative function together with nearest object and classname of the barrel to make it copypasteable. That works fine for me. I can place turrets where I like. Just make sure the eye point is not within an object or it will probably not fire or detect anything. Share this post Link to post Share on other sites
Harzach 2507 Posted May 29, 2020 On 5/27/2020 at 4:17 PM, grandbravo said: That function is only usefull if you have 2 objects in the editor/zeus that you want to attach with each other without actual x, y, z coords. Nonsense. Place an invisible helipad somewhere. Name it. Attach all the things to it via BIS_fnc_attachToRelative. Done. Share this post Link to post Share on other sites
grandbravo 11 Posted May 29, 2020 On 5/28/2020 at 11:44 AM, the_one_and_only_Venator said: The good thing about the metal barrel is that it is not affected by gravity but still is 'simulated enough' to not cause problems with AI attaching turrets to it. Try to put the barrel inside whatever object you want to attach sth to (e.g. carrier, bunker) and then hide it by using the eden special state. Then place the turret where u want it and use the mentioned attachToRelative function together with nearest object and classname of the barrel to make it copypasteable. That works fine for me. I can place turrets where I like. Just make sure the eye point is not within an object or it will probably not fire or detect anything. Hmm... I don't see the solution here.. You attach the gun to the barrel ("Land_MetalBarrel_F") or barrel to the gun? Try this little code in the editor Debug Console: _bunker = createVehicle ["Land_HBarrierTower_F", [0,0,0], [], 0, "CAN_COLLIDE"]; _bunker setPos ((getPos player) vectorAdd [0, 10, 0]); _MG = createVehicle ["O_G_HMG_02_high_F", [0,0,0], [], 0, "CAN_COLLIDE"]; createVehicleCrew _MG; _MG attachTo [_bunker, [0,-2,1.9]]; _MG setDir 180; You'll see my issue with the AI static MG. If you have a different/working way of attaching a MG to a bunker while using code and no Eden editor or zeus powers, I would love to see a code example! Share this post Link to post Share on other sites
grandbravo 11 Posted May 30, 2020 On 5/29/2020 at 5:21 AM, Harzach said: Nonsense. Place an invisible helipad somewhere. Name it. Attach all the things to it via BIS_fnc_attachToRelative. Done. Found the solution! https://forums.bohemia.net/forums/topic/219251-setposing-the-liberty-and-its-turrets/?tab=comments#comment-3313614 attach the static MG to a game logic seems to do the trick. Tnx for the help! 1 Share this post Link to post Share on other sites
Harzach 2507 Posted May 30, 2020 46 minutes ago, grandbravo said: Found the solution! Oh, I forgot about that thread, glad you got it sorted! 1 Share this post Link to post Share on other sites