Hello guys. I want to get the dinos belonging to the tribe by tribe ID

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

lxy

Member
Joined
Jan 29, 2022
Messages
6
Thank you for your attention!

I have some problems in completing this function .I think this hook can do this, but it doesn't return anything!

void Hook_UShooterCheatManager_TribeDinoAudit(UShooterCheatManager* _this, int TribeTeamID)
{
UShooterCheatManager_TribeDinoAudit_original(_this, TribeTeamID);
}


ArkApi::GetHooks().SetHook("UShooterCheatManager.TribeDinoAudit", &Hook_UShooterCheatManager_TribeDinoAudit, &UShooterCheatManager_TribeDinoAudit_original);
 
Depending on if you need map wide, or just nearby
C++:
TArray<TWeakObjectPtr<APrimalDinoCharacter>> NearDinos;
player->GetTamedDinosNearBy(&NearDinos, 1000);

//---or---

auto myTribeId = ArkApi::GetApiUtils().GetTribeID(player);
TArray<AActor*> all_dinos;
UGameplayStatics::GetAllActorsOfClass(reinterpret_cast<UObject*>(ArkApi::GetApiUtils().GetWorld()), APrimalDinoCharacter::GetPrivateStaticClass(), &all_dinos);
for (AActor* actor : all_dinos)
{
    APrimalDinoCharacter* dino = static_cast<APrimalDinoCharacter*>(actor);
    if (dino->TargetingTeamField() != myTribeId) continue;
}

For more plugin development help try: https://discord.gg/km7Jgvb
 
I'm very thanks that you help me,I will try it.Thanks Kalendell!
 
Back
Top