jakerod 254 Posted August 4, 2009 It works for me but I didn't know you could fly whit the MV22 folded ! Nice looking base you got there. Share this post Link to post Share on other sites
Rupert_The_Bear 10 Posted September 23, 2009 It works for me but I didn't know you could fly whit the MV22 folded ! I almost fell off my chair watching that xD I've got a small problem. At first: When the mission starts, the choppers are unfolded and then they start folding. Is it possible to spawn them directly folded? And my other problem is, why the hell do they spawn above the deck and me also, but I fell down on deck and can walk around. Others just stay flying above the deck and when I tell them to go there they fall on deck and die.:eek: Thanks in advance for the help. Share this post Link to post Share on other sites
M3th0s 10 Posted September 24, 2009 (edited) I almost fell off my chair watching that xDI've got a small problem. At first: When the mission starts, the choppers are unfolded and then they start folding. Is it possible to spawn them directly folded? And my other problem is, why the hell do they spawn above the deck and me also, but I fell down on deck and can walk around. Others just stay flying above the deck and when I tell them to go there they fall on deck and die.:eek: Thanks in advance for the help. I've got same problem too! :( I tried the script but doesn't works... so I changed the line: this addaction ["Pack","airpack.sqf"] and now it work! But I've got a problem with unpack: I put the file manually in DTA now I've got the 2 files: pack & unpack and now it works... But when I put the map in server in this way I have to send each player the dta/scripts folder! Can you fix it? Please? Another question is: how I can make the animation slow? because it's too fast! Thaks! Edited September 24, 2009 by M3th0s Share this post Link to post Share on other sites
BigRon 10 Posted February 20, 2010 ok here is how i did the scripts to fold and unfold stuff to start folded put this in the vehicles init _xtype = [this,0] execvm "airpack.sqf" to start unfolded use this _xtype = [this,0] execvm "airunpack.sqf" i edited the sqfs to look like this airpack.sqf _aircraft = _this select 0; _caller = _this select 1; _id = _this select 2; _type = typeof _aircraft; waituntil {!isEngineOn _aircraft}; switch (_type) do { case "AH1Z": {_xtype = [_aircraft,1] execvm "\ca\air\Scripts\AH1Z_fold.sqf"}; case "UH1Y": {_xtype = [_aircraft,1] execvm "\ca\air2\UH1Y\Scripts\fold.sqf"}; case "MV22": {_xtype = [_aircraft,1] execvm "\ca\air2\mv22\scripts\pack.sqf"}; }; _aircraft removeaction _id; _aircraftunpack = _aircraft addAction ["Unfold Aircraft", "airunpack.sqf"]; airpack.sqf _aircraft = _this select 0; _caller = _this select 1; _id = _this select 2; _type = typeof _aircraft; waituntil {!isEngineOn _aircraft}; switch (_type) do { case "AH1Z": {_xtype = [_aircraft,0] execvm "\ca\air\Scripts\AH1Z_fold.sqf"}; case "UH1Y": {_xtype = [_aircraft,0] execvm "\ca\air2\UH1Y\Scripts\fold.sqf"}; case "MV22": {_xtype = [_aircraft,0] execvm "\ca\air2\mv22\scripts\pack.sqf"}; }; _aircraft removeaction _id; _aircraftpack = _aircraft addAction ["Fold Aircraft", "airpack.sqf"]; in place of "unfold aircraft" or "fold aircraft" you can put whatever you want to show up in the action menu as far as the files, i put them in the mission root folder (with mission.sqm ect...) BTW, thanks to ghost for helping me with this! Share this post Link to post Share on other sites
xeno426 10 Posted May 5, 2011 (edited) Sorry to necro an old thread, but this is directly related to what I am trying to do, as I am trying to prevent this kind of stuff from happening: It works for me but I didn't know you could fly whit the MV22 folded I thought I might try the "engine" eventhandler code, placing this in the vehicle's config entry class eventhandlers { engine = "_this execVM ""\TGW_VehFixes\scr\MV22_folded.sqf"""; }; The code itself went like this _mv22 = _this select 0; while { _mv22 animationphase "turn_wing" !=0} do {_mv22 engineOn false}; Unfortunately this appears to do absolutely nothing. I don't want to use an "init" eventhandler because the code would be checking constantly, and it only needs to be checked when someone tries to turn the engines on (and automatically shut them off if the rotor is folded). I also tried the following code _mv22 = _this select 0; while {_mv22 animationphase "turn_wing" !=0} do {_mv22 setVelocity [0,0,0]}; Which actually works at preventing the player from moving, but doesn't remove the sillyness of the rotors spinning when they clearly shouldn't. It looks even dumber on the AH-1Z and UH-1Y as they suddenly sprout an extra set of rotors. I am very much a n00b when it comes to scripting, so I would really appreciate it if someone could help me out here. Edited May 6, 2011 by Xeno426 Share this post Link to post Share on other sites
liquidpinky 11 Posted May 5, 2011 Which actually works at preventing the player from moving, but remove the sillyness of the rotors spinning when they clearly shouldn't. It looks even dumber on the AH-1Z and UH-1Y as they suddenly sprout an extra set of rotors. I am very much a n00b when it comes to scripting, so I would really appreciate it if someone could help me out here. this setFuel 0 then check if they are unfolded then this setFuel 1 Share this post Link to post Share on other sites
xeno426 10 Posted May 6, 2011 You mean like this? _mv22 = _this select 0; while {_mv22 animationphase "turn_wing" !=0} do {_mv22 setFuel 0}; while {_mv22 animationphase "turn_wing" == 1} do {_mv22 setFuel 1}; Unfortunatly that doesn't seem to work right. setFuel, it seems, directly sets the total amount of fuel available; just 1 wouldn't be enough. Additionally, this would allow someone to refuel the aircraft "for free" simply by packing and then unpacking the rotors. Share this post Link to post Share on other sites
smile04 10 Posted September 30, 2011 ok here is how i did the scripts to fold and unfold stuffto start folded put this in the vehicles init _xtype = [this,0] execvm "airpack.sqf" to start unfolded use this _xtype = [this,0] execvm "airunpack.sqf" i edited the sqfs to look like this airpack.sqf _aircraft = _this select 0; _caller = _this select 1; _id = _this select 2; _type = typeof _aircraft; waituntil {!isEngineOn _aircraft}; switch (_type) do { case "AH1Z": {_xtype = [_aircraft,1] execvm "\ca\air\Scripts\AH1Z_fold.sqf"}; case "UH1Y": {_xtype = [_aircraft,1] execvm "\ca\air2\UH1Y\Scripts\fold.sqf"}; case "MV22": {_xtype = [_aircraft,1] execvm "\ca\air2\mv22\scripts\pack.sqf"}; }; _aircraft removeaction _id; _aircraftunpack = _aircraft addAction ["Unfold Aircraft", "airunpack.sqf"]; airpack.sqf _aircraft = _this select 0; _caller = _this select 1; _id = _this select 2; _type = typeof _aircraft; waituntil {!isEngineOn _aircraft}; switch (_type) do { case "AH1Z": {_xtype = [_aircraft,0] execvm "\ca\air\Scripts\AH1Z_fold.sqf"}; case "UH1Y": {_xtype = [_aircraft,0] execvm "\ca\air2\UH1Y\Scripts\fold.sqf"}; case "MV22": {_xtype = [_aircraft,0] execvm "\ca\air2\mv22\scripts\pack.sqf"}; }; _aircraft removeaction _id; _aircraftpack = _aircraft addAction ["Fold Aircraft", "airpack.sqf"]; in place of "unfold aircraft" or "fold aircraft" you can put whatever you want to show up in the action menu as far as the files, i put them in the mission root folder (with mission.sqm ect...) BTW, thanks to ghost for helping me with this! thank a lot man this really works...very nicely :) I LOVE YA! watch :) http://www.youtube.com/watch?v=N2syqt7Q_Sc for noobs like me...you have to put (make) two files airpack.sqf and airunpack.sqf in the root of your unpacked mission (then open files in notepad) and copy content of first hal of code to airpack.sqf and second half to airunpack.sqf and both save...then it will work...yeha! :D Share this post Link to post Share on other sites
odyseus 19 Posted September 15, 2012 Hey guys! Is a list of all aircraft that can fold wings? i KNOW ALL THESES CAN . But are there other ones. If so what would be their line of code? "AH1Z": {_xtype = [_aircraft,0] execvm "\ca\air\Scripts\AH1Z_fold.sqf"}; case "UH1Y": {_xtype = [_aircraft,0] execvm "\ca\air2\UH1Y\Scripts\fold.sqf"}; case "MV22": {_xtype = [_aircraft,0] execvm "\ca\air2\mv22\scripts\pack.sqf"}; Share this post Link to post Share on other sites
spades_neil 3 Posted December 19, 2012 Sorry to necro an old thread, but this is directly related to what I am trying to do, as I am trying to prevent this kind of stuff from happening:I thought I might try the "engine" eventhandler code, placing this in the vehicle's config entry class eventhandlers { engine = "_this execVM ""\TGW_VehFixes\scr\MV22_folded.sqf"""; }; The code itself went like this _mv22 = _this select 0; while { _mv22 animationphase "turn_wing" !=0} do {_mv22 engineOn false}; Unfortunately this appears to do absolutely nothing. I don't want to use an "init" eventhandler because the code would be checking constantly, and it only needs to be checked when someone tries to turn the engines on (and automatically shut them off if the rotor is folded). I also tried the following code _mv22 = _this select 0; while {_mv22 animationphase "turn_wing" !=0} do {_mv22 setVelocity [0,0,0]}; Which actually works at preventing the player from moving, but doesn't remove the sillyness of the rotors spinning when they clearly shouldn't. It looks even dumber on the AH-1Z and UH-1Y as they suddenly sprout an extra set of rotors. I am very much a n00b when it comes to scripting, so I would really appreciate it if someone could help me out here. HUE HUE HUE NECRO I'm trying to do the same thing. Here's my suggestion: If possible, have the option to fold/unfold only available from outside of the vehicle. Make it not only fold the wings, but turn off the engine, AND lock the vehicle, AND kick out all occupants. To access the vehicle, you have to unlock it again from outside the vehicle. Share this post Link to post Share on other sites
xeno426 10 Posted December 19, 2012 This has already been solved in my TGW Vehicle Fixes thread. I made use of a variable that stored the current amount of fuel; when folded, the vehicle is emptied of fuel which prevents take-off. When unfolded, the fuel is returned. Share this post Link to post Share on other sites
spades_neil 3 Posted December 19, 2012 This has already been solved in my TGW Vehicle Fixes thread. I made use of a variable that stored the current amount of fuel; when folded, the vehicle is emptied of fuel which prevents take-off. When unfolded, the fuel is returned. Wait, is this a mod/addon or a script to vanilla? Because I can't do anything with a mod, unless it's a serverside addon that the clients don't need for it to work. Regardless I still need the script I'm seeking. I don't really understand what is going on here and I don't know enough about scripting to know the syntax. Share this post Link to post Share on other sites
xeno426 10 Posted December 19, 2012 Wait, is this a mod/addon or a script to vanilla? Because I can't do anything with a mod, unless it's a serverside addon that the clients don't need for it to work.Regardless I still need the script I'm seeking. I don't really understand what is going on here and I don't know enough about scripting to know the syntax. Check out how I implemented it in my mod here. Defunkt is the guy that figured it out. Share this post Link to post Share on other sites
spades_neil 3 Posted December 19, 2012 Check out how I implemented it in my mod here. Defunkt is the guy that figured it out. I'm not understanding how this thread helps me. This is an addon. I don't want a whole addon. I just want a script. If I have a whole addon it means I have to force players playing on my mission to also have the addon. I just want the script to open and close the folding wings on vehicles that can without making it possible to still turn on the engines. Share this post Link to post Share on other sites
xeno426 10 Posted December 19, 2012 Step 1) Download my addon Step 2) Extract the config.cpp file Step 3) Look at how it was implemented in my mod Step 4) ???? Step 5) Profit. Share this post Link to post Share on other sites
spades_neil 3 Posted December 19, 2012 Step 1) Download my addonStep 2) Extract the config.cpp file Step 3) Look at how it was implemented in my mod Step 4) ???? Step 5) Profit. Nevermind. You seem to have this idea that I have the faintest clue what I'm doing here. PBO extracting programs break on my computer, and even if I got it open and extracted the config.cpp file, I have absolutely no idea what the syntax means, so this information is useless to me going through lines of script I don't understand. The objective is to have someone explain it to me so I do understand the syntax. Share this post Link to post Share on other sites
panther42 52 Posted December 20, 2012 (edited) Here's a simple explanation of what Xeno426 is talking about: Check if the engine is running Check animation phase of wing/rotor Check if player is driver Check if speed of vehicle is 0 if packed, use a global variable to track stowed fuel, while setting fuel to 0. Cannot start engine w/o fuel/variable check This is added via his mod to all MV-22, AH1Z and UH1Y Edited December 20, 2012 by panther42 Share this post Link to post Share on other sites
TitanBC 10 Posted March 22, 2014 I whipped up a set of pack/unpack addaction scripts. There pretty basic but do the job. Works with UH1Y, AH1Z and MV22. Put this in the init line of the vehicle and name the vehicle to have action of packing for when vehicle starts unfolded. Can the animation be slowed down and can it be made so that the wings can be folded and then unfolded, or visa versa? It'd be cool if I could get in the aircraft with wings folded, then unfold them, take off and carry out the mission, and then return to land on the LHD and refold the wings and use the towing tractor to park the aircraft. Share this post Link to post Share on other sites