RS30002 28 Posted March 11, 2022 Hey all, looking for some tips, or mainly how i would go about it -if pilot is alive and touches water (is in water, stationary) -a life raft (pook's for example) is created on his position -fade to black for a bit, optionally with some sound indicating inflating of the raft -move crashed pilot onto the raft So far i have this, untested, because i went to write this post immediately after realizing i don't know how to detect if player hit the water and is stationary.....the code required for that should be above what i have up until now, but idk how... _raft = "pook_floatraft_8" createVehicle position f35d; playSound "RaftInflate" titleCut ["", "BLACK IN", 3]; f35d moveInAny _raft; exit ....for the record, i've been looking at the commands and i think it would go something like this if (speed f35d < 5) then {"pook_floatraft_8" createVehicle position f35d}; but i don't know how to fuse it all together with _raft variable which i think i need to move the pilot into the raft (the idea is to wait in the raft for the boat pickup from the LHD to come get you......have plans to create a script that deletes the raft when you get in the rescue boat, but i guess i'll cross that bridge when i get to it 🙂 ) Many thanks for any replies Share this post Link to post Share on other sites
TeTeT 1523 Posted March 11, 2022 Unsung and Unsung Redux sports a liferaft, which comes as a magazine and fits in the pilots inventory: class UNS_EAM2Braft: uns_IMagazine { scope = 2; scopeArsenal = 2; displayName = "EAM-2B Life Raft"; model = "\uns_weap_w\items\mag_univ.p3d"; picture = "\uns_weap_w\items\ico\items\gear_picture_liferaft_ca.paa"; descriptionShort = "EAM-2B Life Raft, contains all necessaries for survival at sea"; mass = 10; }; An AnimStateChanged eventhandler checks if the unit with the raft in inventory starts swimming and add an action to inflate the raft: // Written by TeTeT for Unsung in arma 3 // When swimming and a life raft mag is on the _unit, allow the Inflate life raft action params ["_unit"]; // diag_log format ['liferaft: %1', _unit]; _unit addEventHandler ["AnimStateChanged", { params ["_unit", "_anim"]; // systemChat str _anim; if (_anim select [0,4] in ["aswm", "assw"] and (_unit getVariable ["uns_liferaft_action", -1]) == -1 ) then { //swimming if ("UNS_EAM2Braft" in magazines _unit) then { systemChat "Life raft available"; private _actionId = _unit addAction [ "Inflate life raft", "_this call uns_mbox_fnc_inflateraft;", nil, 5, false, true, "", "'UNS_EAM2Braft' in magazines _this" ]; _unit setVariable ["uns_liferaft_action", _actionId]; }; // else { // systemChat "DEBUG: No raft in magazines"; // }; }; // else { // if (_unit getVariable ["uns_liferaft_action", -1 ] > -1) then { // _unit removeAction (_unit getVariable "uns_liferaft_action"); // }; // }; }]; _unit; When inflating the raft, we teleport the unit inside: params ["_unit"]; _unit removeMagazine "UNS_EAM2Braft"; private _raft = createVehicle ["UNS_floatraft_3", position _unit, [], 5, "CAN_COLLIDE"]; // we move the player into the raft so the player does not get slain by the raft when it spawns on top of him. _unit assignAsDriver _raft; _unit moveInDriver _raft; _unit removeAction (_unit getVariable "uns_liferaft_action"); _unit setVariable ["uns_liferaft_action", -1]; _unit; Cheers and good luck, TeTeT 3 Share this post Link to post Share on other sites
RS30002 28 Posted March 11, 2022 Thank you. There is probably a way to define the pook's raft as a magazine in the description and incorporate all of your scripts into what i want, but i think imma just download the Redux version, put the raft into the pilot pack and not really bother with it further. (essentially it's exactly what i wanted, your way is just extremely pimped up (difference between a coder that knows what he is doing and a copy/paster trial and error bro 😂 ) ) Thanks again. 🍻 edit after testing: exactly what i wanted! ✌️ Share this post Link to post Share on other sites
RS30002 28 Posted March 11, 2022 Might i bother someone with the second part of my plans? Namely, swimless embarking onto the rescue boat from the raft 🙂 In the boat's init id place this addAction ["Get on Boat", "RescueBoat.sqf", [],1,false,true,"","_this distance f35d < 5"]; RescueBoat.sqf would simply be: _raft = vehicle f35d; titleCut ["", "BLACK IN", 2]; f35d moveinAny boat_0; sleep 1; deletevehicle _raft; Would this work in theory? Have i declared _raft properly ? or is there another, better way? many thanks in advance again 🙂 Share this post Link to post Share on other sites
RS30002 28 Posted March 11, 2022 Okay, good news, everything works 😊 I just need to figure out how to remove actions now (i use add action and teleport to get on the deck of the LHD when the boat arrives in a trigger area near it), because they keep staying in the menu! And possibly a way via a getin event handler that adds the raft everytime i sit in the plane which respawns on the deck when i'm shot down. Fully fledged pilot recovery system bois!!!! 🤙 Share this post Link to post Share on other sites
TeTeT 1523 Posted March 12, 2022 12 hours ago, Rok Stuhne said: Okay, good news, everything works 😊 I just need to figure out how to remove actions now (i use add action and teleport to get on the deck of the LHD when the boat arrives in a trigger area near it), because they keep staying in the menu! And possibly a way via a getin event handler that adds the raft everytime i sit in the plane which respawns on the deck when i'm shot down. Fully fledged pilot recovery system bois!!!! 🤙 Very nice, glad you got it working. On the actions, https://community.bistudio.com/wiki/addAction shows what the params for the script are: params ["_target", "_caller", "_actionId", "_arguments"]; You can delete either the actionId when teleported. Or you can declare a condition for being in the raft (objectParent player isKindOf "pook_whatever_raft_class" most likely). I think the cleanest way for the raft item is to be in the loadout of the player, also after respawn, and not tie it to enter the plane. Cheers, TeTeT 1 Share this post Link to post Share on other sites
RS30002 28 Posted March 12, 2022 31 minutes ago, TeTeT said: Very nice, glad you got it working. On the actions, https://community.bistudio.com/wiki/addAction shows what the params for the script are: params ["_target", "_caller", "_actionId", "_arguments"]; You can delete either the actionId when teleported. Or you can declare a condition for being in the raft (objectParent player isKindOf "pook_whatever_raft_class" most likely). I think the cleanest way for the raft item is to be in the loadout of the player, also after respawn, and not tie it to enter the plane. Cheers, TeTeT hahahaha, i don't respawn, only the plane does. That's why i needed some "system" to get me back on the ship. (alt clicking teleport in editor and ladders were a trash solution) I did it in a noob way, connecting the boat to the ARMA helicopter transport module just to see if it works (i was amazed that it did for a boat), then i needed the life raft thingy (sometimes the rescue boat ran over me lmao + cosmetics) and after that i managed to cobble together two mini scripts that teleport me from the raft to the boat and from the boat to the deck of the ship. (if you have any ideas how to name boat transport as boat transport under 0-8 support module, pls share 🙂 (right now it says helicopter transport and when i enter the menu there's there 1 chopper and 1 boat options listed - minor nuisance, but it irks me every time lol) Share this post Link to post Share on other sites