From db872cb009c6e65ac18cbd5d5f7e437312db265b Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Mon, 20 Jan 2025 19:58:48 +0000 Subject: [PATCH] ChaosMod: Attach effect sound to ped for a bunch of effects --- ChaosMod/Effects/db/Peds/PedsJamesBond.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp | 4 +++- ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp | 2 ++ ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp | 2 ++ ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp | 3 +-- ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp | 1 + ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp | 1 + 15 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp b/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp index 313c7a837..5bdbcfeb8 100644 --- a/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp +++ b/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp @@ -33,6 +33,7 @@ static void OnStart() SET_ENTITY_VELOCITY(veh, vel.x, vel.y, vel.z); Ped bond = CreatePoolPedInsideVehicle(veh, 4, model, -1); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = bond }); SET_PED_RELATIONSHIP_GROUP_HASH(bond, relationshipGroup); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp index a8246176f..be5b3dd96 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp @@ -23,6 +23,7 @@ static void OnStart() SET_RELATIONSHIP_BETWEEN_GROUPS(5, relationshipGroup, femCivGroup); Ped ped = CreatePoolPed(4, alienHash, playerPos.x, playerPos.y, playerPos.z, 0.f); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); SET_PED_RELATIONSHIP_GROUP_HASH(ped, relationshipGroup); SET_PED_HEARING_RANGE(ped, 9999.f); SET_PED_CONFIG_FLAG(ped, 281, true); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp index 6b4ce7648..c26f444a8 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp @@ -10,7 +10,9 @@ static void OnStart() { static const Hash chimpHash = 2825402133; static const Hash weaponHash = "WEAPON_STONE_HATCHET"_hash; - CreateHostilePed(chimpHash, weaponHash); + auto ped = CreateHostilePed(chimpHash, weaponHash); + CurrentEffect::SetEffectSoundPlayOptions( + { .PlayType = EffectSoundPlayType::FollowEntity, .PlayFlags = EffectSoundPlayFlags_Looping, .Entity = ped }); } // clang-format off diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp index 2b3640c60..2086ed1a6 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp @@ -37,6 +37,8 @@ static void OnStart() SET_RELATIONSHIP_BETWEEN_GROUPS(5, relationshipGroup, femCivGroup); Ped ped = CreatePoolPedInsideVehicle(veh, 4, modelHash, -1); + CurrentEffect::SetEffectSoundPlayOptions( + { .PlayType = EffectSoundPlayType::FollowEntity, .PlayFlags = EffectSoundPlayFlags_Looping, .Entity = ped }); SET_PED_RELATIONSHIP_GROUP_HASH(ped, relationshipGroup); SET_PED_HEARING_RANGE(ped, 9999.f); SET_PED_CONFIG_FLAG(ped, 281, true); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp index 9f0ca27c3..52f319e41 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp @@ -22,6 +22,7 @@ static void OnStart() SET_RELATIONSHIP_BETWEEN_GROUPS(5, relationshipGroup, femCivGroup); Ped ped = CreatePoolPed(4, modelHash, playerPos.x, playerPos.y, playerPos.z, 0.f); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) SET_PED_INTO_VEHICLE(ped, GET_VEHICLE_PED_IS_IN(playerPed, false), -2); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp index 745203573..e8c6613b2 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp @@ -31,6 +31,7 @@ static void OnStart() SET_ENTITY_VELOCITY(veh, vel.x, vel.y, vel.z); Ped ped = CreateHostilePed(bikerHash, weaponHash); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); SET_PED_INTO_VEHICLE(ped, veh, -1); } diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp index 9b91eebb2..9d147f778 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp @@ -13,6 +13,8 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreatePoolPed(4, model, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); + CurrentEffect::SetEffectSoundPlayOptions( + { .PlayType = EffectSoundPlayType::FollowEntity, .PlayFlags = EffectSoundPlayFlags_Looping, .Entity = ped }); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) SET_PED_INTO_VEHICLE(ped, GET_VEHICLE_PED_IS_IN(playerPed, false), -2); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp index 19d292432..6267f718e 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp @@ -13,6 +13,7 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreatePoolPed(28, modelHash, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) SET_PED_INTO_VEHICLE(ped, GET_VEHICLE_PED_IS_IN(playerPed, false), -2); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp index b207c673b..b310b1162 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp @@ -13,6 +13,7 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreatePoolPed(28, modelHash, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); SET_PED_COMBAT_ATTRIBUTES(ped, 0, false); SET_PED_RELATIONSHIP_GROUP_HASH(ped, relationshipGroup); SET_PED_HEARING_RANGE(ped, 9999.f); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp index 7034df330..418f8fcbe 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp @@ -11,6 +11,7 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreateRandomPoolPed(playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) SET_PED_INTO_VEHICLE(ped, GET_VEHICLE_PED_IS_IN(playerPed, false), -2); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp index e99e96b0f..766087d48 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp @@ -16,6 +16,7 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreateRandomPoolPed(playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) SET_PED_INTO_VEHICLE(ped, GET_VEHICLE_PED_IS_IN(playerPed, false), -2); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp index 4625c32e9..cd3c21cea 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp @@ -18,8 +18,7 @@ static void OnStart() Vector3 playerPos = GET_ENTITY_COORDS(playerPed, false); Ped ped = CreatePoolPed(4, model, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed)); - CurrentEffect::SetEffectSoundPlayOptions( - { .PlayType = EffectSoundPlayType::FollowEntity, .PlayFlags = EffectSoundPlayFlags_Looping, .Entity = ped }); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); SET_ENTITY_HEALTH(ped, 1000, 0); SET_PED_ARMOUR(ped, 1000); diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp index b398246d6..de6f8e505 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp @@ -9,6 +9,7 @@ Effect by Last0xygen static void OnStart() { Ped ped = CreateHostilePed("u_m_y_juggernaut_01"_hash, "weapon_minigun"_hash); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); SET_PED_ARMOUR(ped, 250); SET_PED_ACCURACY(ped, 3); } diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp index 9b5983be3..383bafc7a 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp @@ -21,6 +21,7 @@ static void OnStart() LoadModel(lamarModel); lamarPed = CREATE_PED(4, lamarModel, playerPos.x, playerPos.y, playerPos.z, GET_ENTITY_HEADING(playerPed), true, false); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = lamarPed }); SET_MODEL_AS_NO_LONGER_NEEDED(lamarModel); if (IS_PED_IN_ANY_VEHICLE(playerPed, false)) diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp index f2620a585..25b0f7f69 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp @@ -9,6 +9,7 @@ Effect by Last0xygen static void OnStart() { Ped ped = CreateHostilePed("u_m_y_rsranger_01"_hash, "weapon_raycarbine"_hash); + CurrentEffect::SetEffectSoundPlayOptions({ .PlayType = EffectSoundPlayType::FollowEntity, .Entity = ped }); } // clang-format off