Beny.cz 10 Posted October 4, 2009 Hi, Me and my friend are working on a coop mission where players start on an LHD. There are some vehicles avaible - MH60, Harrier, 4 Trucks, 4 105s and more. The players shall be able to attach trucks under helis and to tow howitzers behind trucks. I managed to do that in this test mission I created: http://leteckaposta.cz/538759655 OK, so it works fine. The thing is, in the current status, only ONE howitzer can be towed by ONE truck and ONE truck by the MH60. So, what is the easiest way to make all the howitzers towable by all the trucks? Thanks, Beny Share this post Link to post Share on other sites
JDog 11 Posted October 4, 2009 You can only do one because your script is using the unit names, in this case "nakladak" and such. You either have to make a script for each group of stuff to be attached, or better yet, make new scripts that will make the units into private variables so you can use the same script on all of them. For example, instead of "nakladak", you'll end up using something like "_nakladak = this select #" and then "_nakladak attachTo...". Sorry don't really have time to answer more thoroughly right now but will later if still needed. Share this post Link to post Share on other sites
Beny.cz 10 Posted October 5, 2009 I think I get the idea, but I dunno where to put the arguments. Share this post Link to post Share on other sites
JDog 11 Posted October 5, 2009 (edited) Depends how you create your script. For example, if you have this: _chopper = _this select 0; _truck = _this select 1; _truck attachTo [_chopper[#,#,#]]; Then when you call the script in game, the chopper name will be your first argument, followed by the truck name. Like this: [heli1, nakladak] execVM "script.sqf"; Edited October 5, 2009 by JDog Share this post Link to post Share on other sites
Beny.cz 10 Posted October 6, 2009 Great, I got it to work, thanks man. Now I have a small problem. When a howitzer is detached from the heli, it gets stucked in air. Is there any way how to make it "land" ? Share this post Link to post Share on other sites
JDog 11 Posted October 6, 2009 Yea I don't think static weaonry (at least not the M119s, I know from experience) are affected by physics, and they sit wherever you place them in space. You'd have to use setPos to bring it down, but then it'll look like it's teleporting and not falling... which shouldn't be an issue if it's only a few feet off the ground anyway. this setPos [getPos this select 0, getPos this select 1, 0]; Share this post Link to post Share on other sites
Big_Daddy 10 Posted October 6, 2009 Yeah, you have to attach something to it that does effect physics. like a deletecollected book. :) Share this post Link to post Share on other sites