Skip to content

Commit

Permalink
ChaosMod: Attach effect sound to ped for a bunch of effects
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Jan 20, 2025
1 parent f97fdf8 commit db872cb
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsJamesBond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 1 addition & 2 deletions ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db872cb

Please sign in to comment.