From b7bbdb029b232eb0a360823ab0e5c7269c97f9fd Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Fri, 26 Apr 2024 20:46:41 +0200 Subject: [PATCH 01/13] Add "Place carried" action to Cots --- .../Entities/ACE_Carrying_HelperCompartment.c | 25 +++++++------ .../ACE_Carrying/Tools/ACE_Carrying_Tools.c | 6 ++-- .../ACE_Carrying_PlaceOnEntityUserAction.c | 36 +++++++++++++++++++ .../Military/Furniture/CotMilitary_USSR_01.et | 30 ++++++++++++++++ .../Furniture/CotMilitary_USSR_01.et.meta | 17 +++++++++ .../Military/Furniture/CotMilitary_US_01.et | 29 +++++++++++++++ .../Furniture/CotMilitary_US_01.et.meta | 17 +++++++++ 7 files changed, 146 insertions(+), 14 deletions(-) create mode 100644 addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c create mode 100644 addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et create mode 100644 addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta create mode 100644 addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et create mode 100644 addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index 4b6ad9b8..fdf9b106 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -106,7 +106,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Terminates carrying: Moves out the carried player and schedules clean up [RplRpc(RplChannel.Reliable, RplRcver.Server)] - void Terminate() + void Terminate(array placementPos) { if (m_pCarrier) { @@ -121,7 +121,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (m_pCarried) { - MoveOutCarried(); + MoveOutCarried(placementPos); SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(m_pCarried.FindComponent(SCR_CharacterControllerComponent)); if (!carriedController) @@ -133,7 +133,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Moves the carried player out of the helper compartment - protected void MoveOutCarried() + protected void MoveOutCarried(array placementPos = null) { if (!m_pCarried) return; @@ -145,13 +145,16 @@ class ACE_Carrying_HelperCompartment : GenericEntity // Clean-up when carried has left the comparment compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); - vector target_pos; - vector target_transform[4]; - m_pCarrier.GetWorldTransform(target_transform); - // target_transform[2] is vectorDir in Arma 3 - SCR_WorldTools.FindEmptyTerrainPosition(target_pos, target_transform[3] + target_transform[2], SEARCH_POS_RADIUS_M); - target_transform[3] = target_pos; - compartmentAccess.MoveOutVehicle(-1, target_transform); + if (!placementPos) + { + vector target_pos; + vector target_transform[4]; + m_pCarrier.GetWorldTransform(target_transform); + // target_transform[2] is vectorDir in Arma 3 + SCR_WorldTools.FindEmptyTerrainPosition(target_pos, target_transform[3] + target_transform[2], SEARCH_POS_RADIUS_M); + target_transform[3] = target_pos; + compartmentAccess.MoveOutVehicle(-1, target_transform); + } // Broadcast teleport on network RplComponent carriedRpl = RplComponent.Cast(m_pCarried.FindComponent(RplComponent)); @@ -201,7 +204,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //! Callback for the release keybind protected void ActionTerminateCallback() { - Rpc(Terminate); + Rpc(Terminate, null); } //------------------------------------------------------------------------------------------------ diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c index ff9e30f4..1c1d2707 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c @@ -15,14 +15,14 @@ class ACE_Carrying_Tools //------------------------------------------------------------------------------------------------ //! Release the carried player by passing the carrier //! Calls Release method on helper compartment entity - static void ReleaseFromCarrier(notnull IEntity carrier) + static void ReleaseFromCarrier(notnull IEntity carrier, array placementPos = null) { ACE_Carrying_HelperCompartment helper = GetHelperCompartmentFromCarrier(carrier); if (!helper) return; - helper.Terminate(); + helper.Terminate(placementPos); } //------------------------------------------------------------------------------------------------ @@ -35,7 +35,7 @@ class ACE_Carrying_Tools if (!helper) return; - helper.Terminate(); + helper.Terminate(null); } //------------------------------------------------------------------------------------------------ diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c new file mode 100644 index 00000000..11ec3ea5 --- /dev/null +++ b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------------------------ +class ACE_Carrying_PlaceOnEntityUserAction: ScriptedUserAction +{ + [Attribute(desc: "Placement Info")] + private ref PointInfo m_ACE_Carrying_PointInfo; + + //------------------------------------------------------------------------------------------------ + override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent) + { + super.Init(pOwnerEntity, pManagerComponent); + + if (m_ACE_Carrying_PointInfo) + m_ACE_Carrying_PointInfo.Init(pOwnerEntity); + } + + //------------------------------------------------------------------------------------------------ + override bool CanBeShownScript(IEntity user) + { + return ACE_Carrying_Tools.IsCarrier(user); + } + + //------------------------------------------------------------------------------------------------ + override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity) + { + vector placementTransform[4]; + m_ACE_Carrying_PointInfo.GetWorldTransform(placementTransform); + + array placementPos = {placementTransform}; + + ACE_Carrying_Tools.ReleaseFromCarrier(pUserEntity, placementPos); + } + + //------------------------------------------------------------------------------------------------ + //! Methods are executed on the local player + override bool CanBroadcastScript() { return false; }; +} diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et new file mode 100644 index 00000000..a8019417 --- /dev/null +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et @@ -0,0 +1,30 @@ +StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/FurnitureMilitary_base.et" { + ID "5272E314F01B2DBE" + components { + ActionsManagerComponent "{6134DC9906AC249B}" { + ActionContexts { + UserActionContext "{6134DC99055BF0FB}" { + ContextName "default" + Position PointInfo "{6134DC991F3E2EC8}" { + Offset 0 0.54 0 + } + Radius 0.5 + } + } + additionalActions { + ACE_Carrying_PlaceOnEntityUserAction "{6134DC992974CC40}" { + ParentContextList { + "default" + } + UIInfo UIInfo "{6134DC99F2B42E43}" { + Name "Place carried" + } + Duration 0.7 + m_ACE_Carrying_PointInfo PointInfo "{6135218E4CEE71C6}" { + Offset 0 0.54 0 + } + } + } + } + } +} \ No newline at end of file diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta new file mode 100644 index 00000000..995c8746 --- /dev/null +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta @@ -0,0 +1,17 @@ +MetaFileClass { + Name "{C6BFE324CCCFE6C4}Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et" + Configurations { + EntityTemplateResourceClass PC { + } + EntityTemplateResourceClass XBOX_ONE : PC { + } + EntityTemplateResourceClass XBOX_SERIES : PC { + } + EntityTemplateResourceClass PS4 : PC { + } + EntityTemplateResourceClass PS5 : PC { + } + EntityTemplateResourceClass HEADLESS : PC { + } + } +} \ No newline at end of file diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et new file mode 100644 index 00000000..d95b11f3 --- /dev/null +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et @@ -0,0 +1,29 @@ +StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/FurnitureMilitary_base.et" { + ID "5272E314F01B2DBE" + components { + ActionsManagerComponent "{6134DCAE01DF536B}" { + ActionContexts { + UserActionContext "{6134DCAE233104A3}" { + ContextName "default" + Position PointInfo "{6134DCA0AF4EA371}" { + Offset 0 0.54 0 + } + Radius 0.5 + } + } + additionalActions { + ACE_Carrying_PlaceOnEntityUserAction "{6134DCA7B8CBA475}" { + ParentContextList { + "default" + } + UIInfo UIInfo "{6134DC99E11D6BEC}" { + Name "Place carried" + } + m_ACE_Carrying_PointInfo PointInfo "{613521899ADD7A0F}" { + Offset 0 0.54 0 + } + } + } + } + } +} \ No newline at end of file diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta new file mode 100644 index 00000000..d8a04834 --- /dev/null +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta @@ -0,0 +1,17 @@ +MetaFileClass { + Name "{C9CFDED29542A968}Prefabs/Props/Military/Furniture/CotMilitary_US_01.et" + Configurations { + EntityTemplateResourceClass PC { + } + EntityTemplateResourceClass XBOX_ONE : PC { + } + EntityTemplateResourceClass XBOX_SERIES : PC { + } + EntityTemplateResourceClass PS4 : PC { + } + EntityTemplateResourceClass PS5 : PC { + } + EntityTemplateResourceClass HEADLESS : PC { + } + } +} \ No newline at end of file From 69746582c90150a7f27da83fc90c5139f0a83698 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 02:42:42 +0200 Subject: [PATCH 02/13] Fix patient placement, shorten action time The moved out unit still ragdolls so not sure if this aproach is viable. --- .../Entities/ACE_Carrying_HelperCompartment.c | 11 ++++++++--- .../ACE_Carrying_PlaceOnEntityUserAction.c | 4 +++- .../Props/Military/Furniture/CotMilitary_USSR_01.et | 2 +- .../Props/Military/Furniture/CotMilitary_US_01.et | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index fdf9b106..84b6cb18 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -133,7 +133,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Moves the carried player out of the helper compartment - protected void MoveOutCarried(array placementPos = null) + protected void MoveOutCarried(array placementPos) { if (!m_pCarried) return; @@ -145,16 +145,21 @@ class ACE_Carrying_HelperCompartment : GenericEntity // Clean-up when carried has left the comparment compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); + vector target_transform[4]; if (!placementPos) { vector target_pos; - vector target_transform[4]; m_pCarrier.GetWorldTransform(target_transform); // target_transform[2] is vectorDir in Arma 3 SCR_WorldTools.FindEmptyTerrainPosition(target_pos, target_transform[3] + target_transform[2], SEARCH_POS_RADIUS_M); target_transform[3] = target_pos; - compartmentAccess.MoveOutVehicle(-1, target_transform); } + else + { + target_transform = {placementPos[0], placementPos[1], placementPos[2], placementPos[3]}; + } + + compartmentAccess.MoveOutVehicle(-1, target_transform); // Broadcast teleport on network RplComponent carriedRpl = RplComponent.Cast(m_pCarried.FindComponent(RplComponent)); diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c index 11ec3ea5..f42c63b9 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c @@ -25,7 +25,9 @@ class ACE_Carrying_PlaceOnEntityUserAction: ScriptedUserAction vector placementTransform[4]; m_ACE_Carrying_PointInfo.GetWorldTransform(placementTransform); - array placementPos = {placementTransform}; + array placementPos = {}; + foreach (vector v : placementTransform) + placementPos.Insert(v); ACE_Carrying_Tools.ReleaseFromCarrier(pUserEntity, placementPos); } diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et index a8019417..2c322904 100644 --- a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et @@ -19,7 +19,7 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur UIInfo UIInfo "{6134DC99F2B42E43}" { Name "Place carried" } - Duration 0.7 + Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{6135218E4CEE71C6}" { Offset 0 0.54 0 } diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et index d95b11f3..082c1d96 100644 --- a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et +++ b/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et @@ -19,6 +19,7 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur UIInfo UIInfo "{6134DC99E11D6BEC}" { Name "Place carried" } + Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{613521899ADD7A0F}" { Offset 0 0.54 0 } From 2b6e6015949794f9ca8f9a8e6dfee7d1556b03f3 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 11:35:46 +0200 Subject: [PATCH 03/13] Move prefab edits to Carrying addon --- .../Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et | 0 .../Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta | 0 .../Prefabs/Props/Military/Furniture/CotMilitary_US_01.et | 0 .../Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename addons/{medical => carrying}/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et (100%) rename addons/{medical => carrying}/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta (100%) rename addons/{medical => carrying}/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et (100%) rename addons/{medical => carrying}/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta (100%) diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et similarity index 100% rename from addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et rename to addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta similarity index 100% rename from addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta rename to addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et.meta diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et similarity index 100% rename from addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et rename to addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et diff --git a/addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta similarity index 100% rename from addons/medical/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta rename to addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et.meta From 178e328b10aafa1fb37523009f71e354a8d98623 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 11:40:41 +0200 Subject: [PATCH 04/13] Add place casualty translation --- .../Language/ACE_Carrying_localization.st | 27 +++++++++++++------ .../Military/Furniture/CotMilitary_USSR_01.et | 2 +- .../Military/Furniture/CotMilitary_US_01.et | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/addons/carrying/Language/ACE_Carrying_localization.st b/addons/carrying/Language/ACE_Carrying_localization.st index 171b19de..4ef33eed 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.st +++ b/addons/carrying/Language/ACE_Carrying_localization.st @@ -4,9 +4,9 @@ StringTable { CustomStringTableItem "{5DDEFB516A0DA608}" { Id "ACE_Carrying-AddonName" Target_en_us "ACE - Carrying" - Modified 1578023399 + Modified 1630934708 Author "kexanone" - LastChanged "kexanone" + LastChanged "veteran29" } CustomStringTableItem "{5DDEFB51C773DDD9}" { Id "ACE_Carrying-UserAction_Carry" @@ -14,9 +14,10 @@ StringTable { Target_fr_fr "Porter" Target_de_de "Tragen" Target_cs_cz "Nést" - Modified 1574895272 + Target_pl_pl "Podnieś" + Modified 1630934696 Author "kexanone" - LastChanged "apollo-jk" + LastChanged "veteran29" } CustomStringTableItem "{5E0C2A71118B03B7}" { Id "ACE_Carrying-UserAction_Carrying" @@ -24,9 +25,18 @@ StringTable { Target_fr_fr "Porter" Target_de_de "Am Tragen" Target_cs_cz "Nošení" - Modified 1577870149 + Target_pl_pl "Noszenie" + Modified 1630934692 Author "kexanone" - LastChanged "apollo-jk" + LastChanged "veteran29" + } + CustomStringTableItem "{613521B70C031A0D}" { + Id "ACE_Carrying-UserAction_PlaceCasualty" + Target_en_us "Place casualty" + Target_pl_pl "Połóż rannego" + Modified 1630934649 + Author "veteran29" + LastChanged "veteran29" } CustomStringTableItem "{5E0EB8A9BCC4201E}" { Id "ACE_Carrying-UserAction_Release" @@ -34,9 +44,10 @@ StringTable { Target_fr_fr "Déposer" Target_de_de "Ablegen" Target_cs_cz "Položit" - Modified 1578028452 + Target_pl_pl "Połóż" + Modified 1630934677 Author "kexanone" - LastChanged "apollo-jk" + LastChanged "filip" } } } \ No newline at end of file diff --git a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et index 2c322904..b484bbf4 100644 --- a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et +++ b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et @@ -17,7 +17,7 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur "default" } UIInfo UIInfo "{6134DC99F2B42E43}" { - Name "Place carried" + Name "#ACE_Carrying-UserAction_PlaceCasualty" } Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{6135218E4CEE71C6}" { diff --git a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et index 082c1d96..5ac5a762 100644 --- a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et +++ b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et @@ -17,7 +17,7 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur "default" } UIInfo UIInfo "{6134DC99E11D6BEC}" { - Name "Place carried" + Name "#ACE_Carrying-UserAction_PlaceCasualty" } Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{613521899ADD7A0F}" { From 8586d0b3a3a4f744cd7d57e917df835903440703 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 11:42:34 +0200 Subject: [PATCH 05/13] Regenerate runtime translations --- .../Language/ACE_Carrying_localization.cs_cz.conf | 4 ++-- .../Language/ACE_Carrying_localization.de_de.conf | 4 ++-- .../Language/ACE_Carrying_localization.en_us.conf | 4 ++-- .../Language/ACE_Carrying_localization.es_es.conf | 4 ++-- .../Language/ACE_Carrying_localization.fr_fr.conf | 4 ++-- .../Language/ACE_Carrying_localization.it_it.conf | 4 ++-- .../Language/ACE_Carrying_localization.ja_jp.conf | 4 ++-- .../Language/ACE_Carrying_localization.ko_kr.conf | 4 ++-- .../Language/ACE_Carrying_localization.pl_pl.conf | 10 +++++----- .../Language/ACE_Carrying_localization.pt_br.conf | 4 ++-- .../Language/ACE_Carrying_localization.ru_ru.conf | 4 ++-- .../Language/ACE_Carrying_localization.zh_cn.conf | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/addons/carrying/Language/ACE_Carrying_localization.cs_cz.conf b/addons/carrying/Language/ACE_Carrying_localization.cs_cz.conf index 6ac49dcd..dc875ad8 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.cs_cz.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.cs_cz.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Nést" "Nošení" + "Place casualty" "Položit" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.de_de.conf b/addons/carrying/Language/ACE_Carrying_localization.de_de.conf index d6891178..a6de9cb1 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.de_de.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.de_de.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Tragen" "Am Tragen" + "Place casualty" "Ablegen" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.en_us.conf b/addons/carrying/Language/ACE_Carrying_localization.en_us.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.en_us.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.en_us.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.es_es.conf b/addons/carrying/Language/ACE_Carrying_localization.es_es.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.es_es.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.es_es.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.fr_fr.conf b/addons/carrying/Language/ACE_Carrying_localization.fr_fr.conf index c5ec330c..bb672ed9 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.fr_fr.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.fr_fr.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Porter" "Porter" + "Place casualty" "Déposer" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.it_it.conf b/addons/carrying/Language/ACE_Carrying_localization.it_it.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.it_it.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.it_it.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.ja_jp.conf b/addons/carrying/Language/ACE_Carrying_localization.ja_jp.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.ja_jp.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.ja_jp.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.ko_kr.conf b/addons/carrying/Language/ACE_Carrying_localization.ko_kr.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.ko_kr.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.ko_kr.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.pl_pl.conf b/addons/carrying/Language/ACE_Carrying_localization.pl_pl.conf index 3a6c4917..35d786d7 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.pl_pl.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.pl_pl.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" - "Carry" - "Carrying" - "Release" + "Podnieś" + "Noszenie" + "Połóż rannego" + "Połóż" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.pt_br.conf b/addons/carrying/Language/ACE_Carrying_localization.pt_br.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.pt_br.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.pt_br.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.ru_ru.conf b/addons/carrying/Language/ACE_Carrying_localization.ru_ru.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.ru_ru.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.ru_ru.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file diff --git a/addons/carrying/Language/ACE_Carrying_localization.zh_cn.conf b/addons/carrying/Language/ACE_Carrying_localization.zh_cn.conf index 3a6c4917..d93ad2c3 100755 --- a/addons/carrying/Language/ACE_Carrying_localization.zh_cn.conf +++ b/addons/carrying/Language/ACE_Carrying_localization.zh_cn.conf @@ -1,16 +1,16 @@ StringTableRuntime { Ids { "ACE_Carrying-AddonName" - "ACE_Carrying-UserAction_AddCasualty" "ACE_Carrying-UserAction_Carry" "ACE_Carrying-UserAction_Carrying" + "ACE_Carrying-UserAction_PlaceCasualty" "ACE_Carrying-UserAction_Release" } Texts { "ACE - Carrying" - "Add Casualty" "Carry" "Carrying" + "Place casualty" "Release" } } \ No newline at end of file From 770572541c50ef8907316e284067681c889bae5f Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 11:56:00 +0200 Subject: [PATCH 06/13] Move hooking of OnCompartmentLeft to Helper.Init --- .../ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index 84b6cb18..59f408f9 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -56,7 +56,11 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (!compartmentAccess) return; + // Clean-up when carried has left the comparment + compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); + compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); + } //------------------------------------------------------------------------------------------------ @@ -142,9 +146,6 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (!compartmentAccess) return; - // Clean-up when carried has left the comparment - compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); - vector target_transform[4]; if (!placementPos) { From e39aa768d2cd2f9e1232012842d9c64bfc862b98 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 12:35:31 +0200 Subject: [PATCH 07/13] Add StrecherHelperCompartment --- .../workspaces/Player_StrecherInjured.asi | 79 +++++++++++++++++++ .../Player_StrecherInjured.asi.meta | 17 ++++ .../Wheeled/workspaces/Vehicles_Wheeled.aw | 1 + .../ACE_Carrying_StrecherHelperCompartment.et | 10 +++ ...Carrying_StrecherHelperCompartment.et.meta | 17 ++++ 5 files changed, 124 insertions(+) create mode 100644 addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi create mode 100644 addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi.meta create mode 100644 addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et create mode 100644 addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et.meta diff --git a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi new file mode 100644 index 00000000..720dc4ae --- /dev/null +++ b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi @@ -0,0 +1,79 @@ +AnimSetInstanceSource "{6136A0C37DBB6595}" { + Template "{7F633C1C12A72901}Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled_Template.ast" + Lines { + AnimSetInstanceSource_Line "Vehicle.CoDriver.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.Driver.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.Gunner.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerL.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerR.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.UniqueSeat.Idle" { + Resource "{C86BDABCDBE56196}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.CoDriver.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.Driver.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.Gunner.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerL.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerR.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.UniqueSeat.UnconsciousIdle" { + Resource "{13DFE41BA3B966C9}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_loop.anm" + } + AnimSetInstanceSource_Line "Vehicle.CoDriver.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.Driver.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.Gunner.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerL.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerR.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.UniqueSeat.UnconsciousIn" { + Resource "{74B1CC58CFA02178}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_in.anm" + } + AnimSetInstanceSource_Line "Vehicle.CoDriver.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + AnimSetInstanceSource_Line "Vehicle.Driver.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + AnimSetInstanceSource_Line "Vehicle.Gunner.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerL.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerR.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + AnimSetInstanceSource_Line "Vehicle.UniqueSeat.UnconsciousOut" { + Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" + } + } + RBF AnimSetInstanceSourceRBFArray "{5DC3656B0EF64C8C}" { + } +} \ No newline at end of file diff --git a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi.meta b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi.meta new file mode 100644 index 00000000..b1a7d2b9 --- /dev/null +++ b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi.meta @@ -0,0 +1,17 @@ +MetaFileClass { + Name "{3DB68DDD9D578EB6}Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi" + Configurations { + AnimSetInstanceResourceClass PC { + } + AnimSetInstanceResourceClass XBOX_ONE : PC { + } + AnimSetInstanceResourceClass XBOX_SERIES : PC { + } + AnimSetInstanceResourceClass PS4 : PC { + } + AnimSetInstanceResourceClass HEADLESS : PC { + } + AnimSetInstanceResourceClass PS5 : PC { + } + } +} \ No newline at end of file diff --git a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled.aw b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled.aw index 0fbe5f54..8a2d5e30 100755 --- a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled.aw +++ b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled.aw @@ -14,6 +14,7 @@ BaseSource { "{C1CCA4C15DEF005F}Assets/Vehicles/Wheeled/workspaces/Player_Wheeled_M998.asi" "{741E6D13EB6C6205}Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled_M998.asi" "{B241F1D8F215C583}Assets/Vehicles/Wheeled/workspaces/Player_CarryInjured.asi" + "{3DB68DDD9D578EB6}Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi" } AnimGraph "{66618A6A119CAD93}Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled_Graph.agr" PreviewModels { diff --git a/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et new file mode 100644 index 00000000..2a355230 --- /dev/null +++ b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et @@ -0,0 +1,10 @@ +ACE_Carrying_HelperCompartment : "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et" { + ID "4B42E71698F5739C" + components { + VehicleAnimationComponent "{50B812962B17E60B}" { + AnimInjection AnimationAttachmentInfo "{50B812961A339FD2}" { + AnimInstance "{3DB68DDD9D578EB6}Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi" + } + } + } +} \ No newline at end of file diff --git a/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et.meta b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et.meta new file mode 100644 index 00000000..0724f08b --- /dev/null +++ b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et.meta @@ -0,0 +1,17 @@ +MetaFileClass { + Name "{F9861A601F934DE7}Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et" + Configurations { + EntityTemplateResourceClass PC { + } + EntityTemplateResourceClass XBOX_ONE : PC { + } + EntityTemplateResourceClass XBOX_SERIES : PC { + } + EntityTemplateResourceClass PS4 : PC { + } + EntityTemplateResourceClass PS5 : PC { + } + EntityTemplateResourceClass HEADLESS : PC { + } + } +} \ No newline at end of file From f2b3b354b21f66d4a655848ff07b5e6f8fc106a5 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 27 Apr 2024 13:18:22 +0200 Subject: [PATCH 08/13] Place unit via comparment WIP does not work correctly right now --- .../Entities/ACE_Carrying_HelperCompartment.c | 42 +++++++++++++++++++ .../ACE_Carrying/Tools/ACE_Carrying_Tools.c | 13 +++++- .../ACE_Carrying_PlaceOnEntityUserAction.c | 13 +++--- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index 59f408f9..d6849089 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -62,6 +62,48 @@ class ACE_Carrying_HelperCompartment : GenericEntity compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); } + + //------------------------------------------------------------------------------------------------ + //! Place on the specified + //! This helper compartment is attached to the and the moves inside + void InitEntity(IEntity entity, IEntity carried, PointInfo placementInfo) + { + m_pCarrier = entity; + m_pCarried = carried; + + PrintFormat("placement node id %1", placementInfo.GetNodeId()); // TODO remove + + // TODO carried disappears for some reason + entity.AddChild(this, placementInfo.GetNodeId()); + SetLocalTransform(placementInfo.GetLocalTransform()); + + RplComponent rplParent = RplComponent.Cast(entity.FindComponent(RplComponent)); + if (!rplParent) + return; + + RplComponent rpl = RplComponent.Cast(FindComponent(RplComponent)); + if (!rpl) + return; + + // TODO this errors, I guess we need Identity not Id? + rpl.Give(rplParent.Id()); + + SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(carried.FindComponent(SCR_CharacterControllerComponent)); + if (!carriedController) + return; + + carriedController.m_OnLifeStateChanged.Insert(OnCarriedLifeStateChanged); + + SCR_CompartmentAccessComponent compartmentAccess = SCR_CompartmentAccessComponent.Cast(carried.FindComponent(SCR_CompartmentAccessComponent)); + if (!compartmentAccess) + return; + + // Clean-up when carried has left the comparment + compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); + + compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); + + } //------------------------------------------------------------------------------------------------ //! Called on carrier's machine diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c index 1c1d2707..5cca5084 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c @@ -2,13 +2,14 @@ //! Helper methods for carrying class ACE_Carrying_Tools { - protected static const ResourceName HELPER_PREFAB_NAME = "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et"; + protected static const ResourceName HELPER_CARRY_PREFAB_NAME = "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et"; + protected static const ResourceName HELPER_STRECHER_PREFAB_NAME = "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et"; //------------------------------------------------------------------------------------------------ //! Start to carry the specified static void Carry(notnull IEntity carrier, notnull IEntity carried) { - ACE_Carrying_HelperCompartment helper = ACE_Carrying_HelperCompartment.Cast(GetGame().SpawnEntityPrefab(Resource.Load(HELPER_PREFAB_NAME), null, EntitySpawnParams())); + ACE_Carrying_HelperCompartment helper = ACE_Carrying_HelperCompartment.Cast(GetGame().SpawnEntityPrefab(Resource.Load(HELPER_CARRY_PREFAB_NAME), null, EntitySpawnParams())); helper.Init(carrier, carried); } @@ -38,6 +39,14 @@ class ACE_Carrying_Tools helper.Terminate(null); } + //------------------------------------------------------------------------------------------------ + //! Place the carried player on entity + static void PlaceOnEntity(notnull IEntity entity, notnull IEntity carried, notnull PointInfo placementInfo) + { + ACE_Carrying_HelperCompartment helper = ACE_Carrying_HelperCompartment.Cast(GetGame().SpawnEntityPrefab(Resource.Load(HELPER_STRECHER_PREFAB_NAME), null, EntitySpawnParams())); + GetGame().GetCallqueue().Call(helper.InitEntity, entity, carried, placementInfo); + } + //------------------------------------------------------------------------------------------------ //! True if the given player is currently a carrier static bool IsCarrier(IEntity carrier) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c index f42c63b9..2be9fa64 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/UserActions/ACE_Carrying_PlaceOnEntityUserAction.c @@ -22,14 +22,11 @@ class ACE_Carrying_PlaceOnEntityUserAction: ScriptedUserAction //------------------------------------------------------------------------------------------------ override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity) { - vector placementTransform[4]; - m_ACE_Carrying_PointInfo.GetWorldTransform(placementTransform); - - array placementPos = {}; - foreach (vector v : placementTransform) - placementPos.Insert(v); - - ACE_Carrying_Tools.ReleaseFromCarrier(pUserEntity, placementPos); + IEntity carried = ACE_Carrying_Tools.GetCarried(pUserEntity); + if (!carried) + return; + + ACE_Carrying_Tools.PlaceOnEntity(pOwnerEntity, carried, m_ACE_Carrying_PointInfo); } //------------------------------------------------------------------------------------------------ From d46a7276d6f3f56bbadd1744ca4782574ee85870 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sun, 28 Apr 2024 01:03:20 +0200 Subject: [PATCH 09/13] Add death anim to strecher animset --- .../Wheeled/workspaces/Player_CarryInjured.asi | 2 +- .../workspaces/Player_StrecherInjured.asi | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_CarryInjured.asi b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_CarryInjured.asi index f9193a36..4eaa486a 100755 --- a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_CarryInjured.asi +++ b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_CarryInjured.asi @@ -1,4 +1,4 @@ -AnimSetInstanceSource { +AnimSetInstanceSource "{613764EA923CF6C4}" { Template "{7F633C1C12A72901}Assets/Vehicles/Wheeled/workspaces/Vehicles_Wheeled_Template.ast" Lines { AnimSetInstanceSource_Line "Vehicle.CoDriver.Idle" { diff --git a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi index 720dc4ae..01e7cb07 100644 --- a/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi +++ b/addons/carrying/Assets/Vehicles/Wheeled/workspaces/Player_StrecherInjured.asi @@ -73,6 +73,24 @@ AnimSetInstanceSource "{6136A0C37DBB6595}" { AnimSetInstanceSource_Line "Vehicle.UniqueSeat.UnconsciousOut" { Resource "{0CEDDDC58B74041F}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_unconscious_out.anm" } + AnimSetInstanceSource_Line "Vehicle.CoDriver.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } + AnimSetInstanceSource_Line "Vehicle.Driver.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } + AnimSetInstanceSource_Line "Vehicle.Gunner.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerL.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } + AnimSetInstanceSource_Line "Vehicle.PassengerR.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } + AnimSetInstanceSource_Line "Vehicle.UniqueSeat.Death" { + Resource "{2A948FDF4AD9B65E}anims/anm/player/vehicles/Ambulances/anm/p_ambulance_patient_death_idle.anm" + } } RBF AnimSetInstanceSourceRBFArray "{5DC3656B0EF64C8C}" { } From 4db6c3b10287fe4f3d688443e5e84a01792ab8a4 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sun, 28 Apr 2024 01:08:14 +0200 Subject: [PATCH 10/13] Fix strecher prefab name --- .../Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c index 5cca5084..728ba4bd 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c @@ -3,7 +3,7 @@ class ACE_Carrying_Tools { protected static const ResourceName HELPER_CARRY_PREFAB_NAME = "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et"; - protected static const ResourceName HELPER_STRECHER_PREFAB_NAME = "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et"; + protected static const ResourceName HELPER_STRECHER_PREFAB_NAME = "{F9861A601F934DE7}Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et"; //------------------------------------------------------------------------------------------------ //! Start to carry the specified From df55ac1d7f023499a8415c997c8b7fcfb220c8c7 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sun, 28 Apr 2024 01:11:18 +0200 Subject: [PATCH 11/13] Add guard check to OnCompartmentLeft It should only run if leaving the compartment that added the invoker --- .../Entities/ACE_Carrying_HelperCompartment.c | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index d6849089..728985f5 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -66,7 +66,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Place on the specified //! This helper compartment is attached to the and the moves inside - void InitEntity(IEntity entity, IEntity carried, PointInfo placementInfo) + void InitEntity(notnull IEntity entity, notnull IEntity carried, notnull PointInfo placementInfo) { m_pCarrier = entity; m_pCarried = carried; @@ -75,7 +75,9 @@ class ACE_Carrying_HelperCompartment : GenericEntity // TODO carried disappears for some reason entity.AddChild(this, placementInfo.GetNodeId()); - SetLocalTransform(placementInfo.GetLocalTransform()); + vector transform[4]; + placementInfo.GetLocalTransform(transform); + SetLocalTransform(transform); RplComponent rplParent = RplComponent.Cast(entity.FindComponent(RplComponent)); if (!rplParent) @@ -86,7 +88,8 @@ class ACE_Carrying_HelperCompartment : GenericEntity return; // TODO this errors, I guess we need Identity not Id? - rpl.Give(rplParent.Id()); + // rpl.Give(rplParent.Id()); // do we even need this for static objects? + PrintFormat("Helper role is %1", rpl.Role()); SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(carried.FindComponent(SCR_CharacterControllerComponent)); if (!carriedController) @@ -152,7 +155,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Terminates carrying: Moves out the carried player and schedules clean up [RplRpc(RplChannel.Reliable, RplRcver.Server)] - void Terminate(array placementPos) + void Terminate() { if (m_pCarrier) { @@ -167,7 +170,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (m_pCarried) { - MoveOutCarried(placementPos); + MoveOutCarried(); SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(m_pCarried.FindComponent(SCR_CharacterControllerComponent)); if (!carriedController) @@ -179,7 +182,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Moves the carried player out of the helper compartment - protected void MoveOutCarried(array placementPos) + protected void MoveOutCarried() { if (!m_pCarried) return; @@ -188,20 +191,12 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (!compartmentAccess) return; + vector target_pos; vector target_transform[4]; - if (!placementPos) - { - vector target_pos; - m_pCarrier.GetWorldTransform(target_transform); - // target_transform[2] is vectorDir in Arma 3 - SCR_WorldTools.FindEmptyTerrainPosition(target_pos, target_transform[3] + target_transform[2], SEARCH_POS_RADIUS_M); - target_transform[3] = target_pos; - } - else - { - target_transform = {placementPos[0], placementPos[1], placementPos[2], placementPos[3]}; - } - + m_pCarrier.GetWorldTransform(target_transform); + // target_transform[2] is vectorDir in Arma 3 + SCR_WorldTools.FindEmptyTerrainPosition(target_pos, target_transform[3] + target_transform[2], SEARCH_POS_RADIUS_M); + target_transform[3] = target_pos; compartmentAccess.MoveOutVehicle(-1, target_transform); // Broadcast teleport on network @@ -212,8 +207,11 @@ class ACE_Carrying_HelperCompartment : GenericEntity //------------------------------------------------------------------------------------------------ //! Clean-up when the carried player has left the compartment - protected void OnCompartmentLeft() + protected void OnCompartmentLeft(IEntity compartment) { + if (compartment != this) + return; + RplId carriedId = RplId.Invalid(); if (m_pCarried) From ced85f1488c0a431a76c65d7981185a4d5098fe0 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sun, 28 Apr 2024 01:29:36 +0200 Subject: [PATCH 12/13] Update placement offsets --- .../Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et | 3 ++- .../Prefabs/Props/Military/Furniture/CotMilitary_US_01.et | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et index b484bbf4..b7cb52ca 100644 --- a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et +++ b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_USSR_01.et @@ -21,7 +21,8 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur } Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{6135218E4CEE71C6}" { - Offset 0 0.54 0 + Offset 0 1.11 0.052 + Angles 0 -90 0 } } } diff --git a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et index 5ac5a762..22dac1d6 100644 --- a/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et +++ b/addons/carrying/Prefabs/Props/Military/Furniture/CotMilitary_US_01.et @@ -21,7 +21,8 @@ StaticModelEntity : "{5EC6836A5694F691}Prefabs/Props/Military/Furniture/Furnitur } Duration 0.5 m_ACE_Carrying_PointInfo PointInfo "{613521899ADD7A0F}" { - Offset 0 0.54 0 + Offset 0 1 0.052 + Angles 0 -90 0 } } } From 80a4e7cd3dc980affc8658971e9e486b93cba14a Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sun, 28 Apr 2024 01:34:20 +0200 Subject: [PATCH 13/13] Refactor strecher handling into child entity class It works! At least locally. --- .../ACE_Carrying_StrecherHelperCompartment.et | 2 +- .../Entities/ACE_Carrying_HelperCompartment.c | 58 ++++--------------- .../ACE_Carrying_StrecherHelperCompartment.c | 49 ++++++++++++++++ .../ACE_Carrying/Tools/ACE_Carrying_Tools.c | 17 ++++-- 4 files changed, 71 insertions(+), 55 deletions(-) create mode 100644 addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_StrecherHelperCompartment.c diff --git a/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et index 2a355230..0986d08d 100644 --- a/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et +++ b/addons/carrying/Prefabs/Helpers/ACE_Carrying_StrecherHelperCompartment.et @@ -1,4 +1,4 @@ -ACE_Carrying_HelperCompartment : "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et" { +ACE_Carrying_StrecherHelperCompartment : "{FF78613C1DAFF28F}Prefabs/Helpers/ACE_Carrying_HelperCompartment.et" { ID "4B42E71698F5739C" components { VehicleAnimationComponent "{50B812962B17E60B}" { diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c index 728985f5..759c7367 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_HelperCompartment.c @@ -60,52 +60,6 @@ class ACE_Carrying_HelperCompartment : GenericEntity compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); - - } - - //------------------------------------------------------------------------------------------------ - //! Place on the specified - //! This helper compartment is attached to the and the moves inside - void InitEntity(notnull IEntity entity, notnull IEntity carried, notnull PointInfo placementInfo) - { - m_pCarrier = entity; - m_pCarried = carried; - - PrintFormat("placement node id %1", placementInfo.GetNodeId()); // TODO remove - - // TODO carried disappears for some reason - entity.AddChild(this, placementInfo.GetNodeId()); - vector transform[4]; - placementInfo.GetLocalTransform(transform); - SetLocalTransform(transform); - - RplComponent rplParent = RplComponent.Cast(entity.FindComponent(RplComponent)); - if (!rplParent) - return; - - RplComponent rpl = RplComponent.Cast(FindComponent(RplComponent)); - if (!rpl) - return; - - // TODO this errors, I guess we need Identity not Id? - // rpl.Give(rplParent.Id()); // do we even need this for static objects? - PrintFormat("Helper role is %1", rpl.Role()); - - SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(carried.FindComponent(SCR_CharacterControllerComponent)); - if (!carriedController) - return; - - carriedController.m_OnLifeStateChanged.Insert(OnCarriedLifeStateChanged); - - SCR_CompartmentAccessComponent compartmentAccess = SCR_CompartmentAccessComponent.Cast(carried.FindComponent(SCR_CompartmentAccessComponent)); - if (!compartmentAccess) - return; - - // Clean-up when carried has left the comparment - compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); - - compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); - } //------------------------------------------------------------------------------------------------ @@ -204,6 +158,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity if (carriedRpl) carriedRpl.ForceNodeMovement(GetOrigin()); } + //------------------------------------------------------------------------------------------------ //! Clean-up when the carried player has left the compartment @@ -250,7 +205,7 @@ class ACE_Carrying_HelperCompartment : GenericEntity //! Callback for the release keybind protected void ActionTerminateCallback() { - Rpc(Terminate, null); + Rpc(Terminate); } //------------------------------------------------------------------------------------------------ @@ -266,4 +221,11 @@ class ACE_Carrying_HelperCompartment : GenericEntity { return m_pCarried; } -} + + //------------------------------------------------------------------------------------------------ + //! Returns the carried unit + bool IsCarrierPlayer() + { + return m_pCarrier.Type() == ChimeraCharacter; + } +} \ No newline at end of file diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_StrecherHelperCompartment.c b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_StrecherHelperCompartment.c new file mode 100644 index 00000000..ebb90ebf --- /dev/null +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Entities/ACE_Carrying_StrecherHelperCompartment.c @@ -0,0 +1,49 @@ +//------------------------------------------------------------------------------------------------ +class ACE_Carrying_StrecherHelperCompartmentClass : ACE_Carrying_HelperCompartmentClass +{ +} + +//------------------------------------------------------------------------------------------------ +class ACE_Carrying_StrecherHelperCompartment : ACE_Carrying_HelperCompartment +{ + //------------------------------------------------------------------------------------------------ + override void Init(IEntity carrier, IEntity carried) + { + m_pCarrier = carrier; + m_pCarried = carried; + + carrier.AddChild(this, -1); + + RplComponent rpl = RplComponent.Cast(FindComponent(RplComponent)); + if (!rpl) + return; + + SCR_CharacterControllerComponent carriedController = SCR_CharacterControllerComponent.Cast(carried.FindComponent(SCR_CharacterControllerComponent)); + if (!carriedController) + return; + + carriedController.m_OnLifeStateChanged.Insert(OnCarriedLifeStateChanged); + + SCR_CompartmentAccessComponent compartmentAccess = SCR_CompartmentAccessComponent.Cast(carried.FindComponent(SCR_CompartmentAccessComponent)); + if (!compartmentAccess) + return; + + // Clean-up when carried has left the comparment + compartmentAccess.GetOnCompartmentLeft().Insert(OnCompartmentLeft); + + compartmentAccess.MoveInVehicle(this, ECompartmentType.Cargo); + + } + + override void RpcDo_Owner_CleanUp(RplId carriedId) + { + // nothing to cleanup + } + + void SetTransformPoint(notnull PointInfo transformPoint) + { + vector transform[4]; + transformPoint.GetLocalTransform(transform); + SetLocalTransform(transform); + } +} diff --git a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c index 728ba4bd..749126c8 100644 --- a/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c +++ b/addons/carrying/Scripts/Game/ACE_Carrying/Tools/ACE_Carrying_Tools.c @@ -16,14 +16,14 @@ class ACE_Carrying_Tools //------------------------------------------------------------------------------------------------ //! Release the carried player by passing the carrier //! Calls Release method on helper compartment entity - static void ReleaseFromCarrier(notnull IEntity carrier, array placementPos = null) + static void ReleaseFromCarrier(notnull IEntity carrier) { ACE_Carrying_HelperCompartment helper = GetHelperCompartmentFromCarrier(carrier); if (!helper) return; - helper.Terminate(placementPos); + helper.Terminate(); } //------------------------------------------------------------------------------------------------ @@ -36,15 +36,16 @@ class ACE_Carrying_Tools if (!helper) return; - helper.Terminate(null); + helper.Terminate(); } //------------------------------------------------------------------------------------------------ //! Place the carried player on entity static void PlaceOnEntity(notnull IEntity entity, notnull IEntity carried, notnull PointInfo placementInfo) { - ACE_Carrying_HelperCompartment helper = ACE_Carrying_HelperCompartment.Cast(GetGame().SpawnEntityPrefab(Resource.Load(HELPER_STRECHER_PREFAB_NAME), null, EntitySpawnParams())); - GetGame().GetCallqueue().Call(helper.InitEntity, entity, carried, placementInfo); + ACE_Carrying_StrecherHelperCompartment helper = ACE_Carrying_StrecherHelperCompartment.Cast(GetGame().SpawnEntityPrefab(Resource.Load(HELPER_STRECHER_PREFAB_NAME), null, EntitySpawnParams())); + helper.Init(entity, carried); + helper.SetTransformPoint(placementInfo); } //------------------------------------------------------------------------------------------------ @@ -64,7 +65,11 @@ class ACE_Carrying_Tools if (!carried) return false; - return GetHelperCompartmentFromCarried(carried); + ACE_Carrying_HelperCompartment compartment = GetHelperCompartmentFromCarried(carried); + if (!compartment) + return false; + + return compartment.IsCarrierPlayer(); } //------------------------------------------------------------------------------------------------