MechSlayer 18 Posted May 6, 2019 Is there a fix for that? Share this post Link to post Share on other sites
sarogahtyp 1105 Posted May 6, 2019 short question, short answer. I like it. 1 1 Share this post Link to post Share on other sites
phronk 895 Posted May 7, 2019 Did something like this for my radio script, back when it used to attachTo a radio to the player: player addEventHandler["GetInMan",{ ((attachedObjects player)#0)attachTo[objectParent player,[0,0,0]]; }}; player addEventHandler["GetOutMan",{ ((attachedObjects objectParent player)#0)attachTo[player,[0,0,0]]; }}; 1 1 Share this post Link to post Share on other sites
johnnyboy 3744 Posted May 7, 2019 11 hours ago, phronk said: Did something like this for my radio script, back when it used to attachTo a radio to the player: player addEventHandler["GetInMan",{ ((attachedObjects player)#0)attachTo[objectParent player,[0,0,0]]; }}; player addEventHandler["GetOutMan",{ ((attachedObjects objectParent player)#0)attachTo[player,[0,0,0]]; }}; Clever. Share this post Link to post Share on other sites
pierremgi 4740 Posted May 7, 2019 2 hours ago, johnnyboy said: Clever. That can't work for several reasons: - the least is the syntax. - The main is that ((attachedObjects objectParent player)#0) will always return objNull in the getoutMan EH. You need to script with parameters (it's better) but also define the object you need to reach. - The secondary is that can't work as is, if two or more players are in the same vehicle. Not mentioning the flickering problem in MP. Share this post Link to post Share on other sites
LSValmont 789 Posted May 7, 2019 44 minutes ago, pierremgi said: That can't work for several reasons: - the least is the syntax. - The main is that ((attachedObjects objectParent player)#0) will always return objNull in the getoutMan EH. You need to script with parameters (it's better) but also define the object you need to reach. - The secondary is that can't work as is, if two or more units are in the same vehicle. Not mentioning the flickering problem in MP. attachto simply destroys in game performance, both in SP and in MP but it is particularly devastating in MP. The problem is that it updates the objects attached position every second and with just more than 2 attached objects it can cause serious delays to other scripts not to mention what it does to network performance. It is also know to mess with the object's physics if the object has complex physics. Adding the attached item to a "virtual inventory" is the way to go for me, even if it doesn't look as realistic (you don't see the object). At least until BI fixes/optimizes the the attachTo command to perhaps allow the object to loose all its physics and position calculations as an optional parameter. There shouldn't be a reason to double calculate the position of a attached item since its position is the same as the unit/object it is attached to minus the offset (Yet this is Arma and it does double/triple checks on things it doesn't need to). So, my suggestion is to stay away from attachto as much as possible 😃 1 Share this post Link to post Share on other sites
johnnyboy 3744 Posted May 7, 2019 2 hours ago, johnnyboy said: Did something like this for my radio script, back when it used to attachTo a radio to the player: I think you can probably make it work...he was just giving an example from memory, not working code I believe. He says "Did something like this..." Share this post Link to post Share on other sites
johnnyboy 3744 Posted May 7, 2019 2 minutes ago, LSValmont said: So, my suggestion is to stay away from attachto as much as possible Maybe sound advice for MP. But I use attachTo all the time in many scripts (flying chickens, attacking dogs, birds of prey, fish jumps, civilian long boats, etc.). attachTo opens up many possibilities. 3 Share this post Link to post Share on other sites
LSValmont 789 Posted May 7, 2019 26 minutes ago, johnnyboy said: Maybe sound advice for MP. But I use attachTo all the time in many scripts (flying chickens, attacking dogs, birds of prey, fish jumps, civilian long boats, etc.). attachTo opens up many possibilities. Agreed! attachto is a great immersion creating command that should really be optimized by BI so we can get its full potential without any regrets in our missions. PS: I love have you've done with your civilian long boats script! 2 Share this post Link to post Share on other sites
pierremgi 4740 Posted May 7, 2019 Right! (for both nice johnnyboy scenarios in SP, and for ugly MP rendering of attachTo command). I tested with HALO jump (just the current backpack on ventral during the chute). It's fine for the player, badly flickered for other units jumping at the same time. I abandoned the idea to make it work for every units. Non-played ones simply recover their backpack after touching ground. It's a great idea to "put" (add) the object inside the cargo (or to delete it, recover it when getting out). 1 Share this post Link to post Share on other sites
Dedmen 2590 Posted May 9, 2019 ACE does a similar thing with chemlights. They detach on GetIn, store it in a variable on the player, and reattach on GetOut. But they don't get attached to the vehicle itself. Share this post Link to post Share on other sites