piedebeouf 10 Posted July 13, 2013 (edited) Hello , for a mission i'd like to charge the submarine SDV on a truck like HEMTT transport truck the open version . Then move whit it to a beach and upload it . The perfect thing it's also to see him on the truck , if you undrestand what i hope ? Thanks a lot for reading this . And other thanks for the persons who give me the solution ... Edited July 13, 2013 by piedebeouf Share this post Link to post Share on other sites
kylania 568 Posted July 13, 2013 (edited) sub attachTo [car, [0,-1.5,1.5]]; sub animate ["periscope", 3]; sub animate ["Antenna", 3]; this animate ["HideScope", 3]; sub animate["display_on_R", 1]; Edited July 13, 2013 by kylania Share this post Link to post Share on other sites
piedebeouf 10 Posted July 13, 2013 Thanks for this ! And can i ask you how to load SDV and also to move away with it in truc and unload it ? on a driver menu ? Share this post Link to post Share on other sites
kylania 568 Posted July 13, 2013 That's a muuuuch more complex process than just making it look good in the back of the truck. :) I had some code for it, but lost it. I'll try to see if I can find it again. Share this post Link to post Share on other sites
piedebeouf 10 Posted July 14, 2013 Thanks a lot, i try your command on un radio trigger , perfect . i have some trouble with the detach it's work , but the submarine stay in the truck . i try this but it doesn't work : detach sdv1; sdv1 SetPos [getPos sdv1 select -5, getPos sdv1 select 0, 0] I have a message division by zero ?? and if i enter positive number , the submarine disappear .... Share this post Link to post Share on other sites
kylania 568 Posted July 14, 2013 (edited) This code in a Radio Trigger would release the sub and "drop" it 10 meters behind the truck. detach sub; sub setPosATL (car modelToWorld [0,-10,0]); ---------- Post added at 04:28 AM ---------- Previous post was at 04:02 AM ---------- Here's the full system. Name your HEMTT "car" and your SDV "sub". Paste this into the init if your car: this addAction [ "Load SDV", { sub attachTo [car, [0,-1.5,1.5]]; sub animate ["periscope", 3]; sub animate ["Antenna", 3]; sub animate ["HideScope", 3]; sub animate["display_on_R", 1]; sub setVariable["attached", true, true]; },[],1,false,true,"", "(!isEngineOn car) && (driver _target == _this) && (sub distance car < 20) && !(sub getVariable 'attached')" ]; this addAction [ "Unload SDV", { detach sub; sleep 1; sub setPosATL [1,1,100]; sub setPosATL (car modelToWorld [0,-15,0]); sub setVariable ["attached", false, true]; },[],1,false,true,"", "(!isEngineOn car) && (driver _target == _this) && (sub getVariable 'attached')" ]; and this into the init of your sub: if (isNil {sub getVariable "attached"}) then {sub setVariable["attached", false, true];}; Then just drive the car up to within 20m of the sub, turn the engine off and the driver can load the sub. Drive wherever you want it and turn the engine off then the driver can drop it 15m behind the car. Edited July 14, 2013 by kylania Share this post Link to post Share on other sites
piedebeouf 10 Posted July 14, 2013 perfect , simple , effaces ! Thanks a lot . this is exactly what I looking for thanks a lot Share this post Link to post Share on other sites
daskunk 1 Posted July 14, 2013 Nice script Kylania very handy, this works great, however if you reload the SDV from the sea and off load, get back in it again you are given the view of being under the sea again lol, no biggie just thought I would let you know. :) Share this post Link to post Share on other sites
daskunk 1 Posted July 16, 2013 Kylania would it be possible to use this convert it to load other types of objects like ammo, containers, and supplies etc ? Share this post Link to post Share on other sites
kylania 568 Posted July 16, 2013 You'd probably want a more robust program like BTC's Logistics system. This was basically just a quick and dirty demo. :) The main problem is there's no easy "center in cargo" value for different sized items. Took me about 15 tries to get the sub to look decent in the back and on the ground. So you could certainly have this kind of thing support different items but it's gonna be a lot of debug consoling and ESC'ing to get the right values for whatever items you wanted to support. Share this post Link to post Share on other sites
daskunk 1 Posted July 17, 2013 Ok thanks for the reply I will have a go at it, thought i'll probably end up with it on the cab hahahahaa Share this post Link to post Share on other sites
clydefrog 3 Posted July 23, 2013 Kylania, how do you use these get/set variables so I could make it that the SDV's are instantly loaded onto the trucks when the mission starts, and do not have the load option but an unload option instead, but then after you unload them it works as normal? Share this post Link to post Share on other sites
kylania 568 Posted July 23, 2013 replace the sub's init field with: null = [] spawn { sub attachTo [car, [0,-1.5,1.5]]; sub animate ["periscope", 3]; sub animate ["Antenna", 3]; sub animate ["HideScope", 3]; sub animate["display_on_R", 1]; sub setVariable["attached", true, true];}; Share this post Link to post Share on other sites
clydefrog 3 Posted July 23, 2013 Thanks a lot, should this all work properly on a dedicated server? Share this post Link to post Share on other sites
kylania 568 Posted July 23, 2013 Who knows what works on a dedicated server or not? :) Share this post Link to post Share on other sites
clydefrog 3 Posted July 23, 2013 Who knows what works on a dedicated server or not? :) heh, well I'm guessing it will, don't see why it wouldn't. I'll obviously test it anyways. Share this post Link to post Share on other sites