From 83b506516099ff5a2bfa12eeea2fa803b69a7cfd Mon Sep 17 00:00:00 2001 From: bomba1749 <58524643+bomba1749@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:22:00 -0400 Subject: [PATCH] AirOctaFlyUp::enter ok had to make a dummy variable in order to get a variable at 0x114 in AirOctaDataMgr, and also had to make function sub_71002FB17C so enter_ could still call it. loadParams_ still doesnt match with a difference of 0. Will look into sub_71002FB17C and the missing variables soon. --- src/Game/AI/AI/aiAirOctaFlyUp.cpp | 13 ++++++++++++- src/Game/AI/AI/aiAirOctaFlyUp.h | 14 ++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.cpp b/src/Game/AI/AI/aiAirOctaFlyUp.cpp index 1b950708..72d91cd9 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.cpp +++ b/src/Game/AI/AI/aiAirOctaFlyUp.cpp @@ -1,6 +1,9 @@ #include "Game/AI/AI/aiAirOctaFlyUp.h" #include "Game/DLC/aocHardModeManager.h" #include "KingSystem/Utils/Thread/Message.h" +#include "KingSystem/ActorSystem/actAiParam.h" +#include "KingSystem/ActorSystem/actAiInlineParam.h" +#include "KingSystem/ActorSystem/actActor.h" namespace uking::ai { @@ -32,12 +35,20 @@ bool AirOctaFlyUp::handleMessage_( const ksys::Message& message) { } void AirOctaFlyUp::enter_(ksys::act::ai::InlineParamPack* params) { - ksys::act::ai::Ai::enter_(params); + if (auto* data_mgr = sead::DynamicCast((AirOctaDataMgr*)*mAirOctaDataMgr_a)){ + data_mgr->unk_114 = 0; + data_mgr->sub_71002FB17C(); + } + auto &mtx = getActor()->getMtx(); + AirOctaY = mtx(1, 3); + ksys::act::ai::Ai::changeChild("開始"); + } void AirOctaFlyUp::leave_() { ksys::act::ai::Ai::leave_(); } +float sub_71002FB17C(); void AirOctaFlyUp::loadParams_() { getStaticParam(&mFlyUpDuration_s, "FlyUpDuration"); diff --git a/src/Game/AI/AI/aiAirOctaFlyUp.h b/src/Game/AI/AI/aiAirOctaFlyUp.h index de758ba9..2fcaec55 100644 --- a/src/Game/AI/AI/aiAirOctaFlyUp.h +++ b/src/Game/AI/AI/aiAirOctaFlyUp.h @@ -2,17 +2,18 @@ #include "KingSystem/ActorSystem/actAiAi.h" #include "KingSystem/ActorSystem/actBaseProcLink.h" +#include "KingSystem/ActorSystem/actActor.h" namespace uking::ai { class AirOctaDataMgr { SEAD_RTTI_BASE(AirOctaDataMgr) public: ksys::act::BaseProcLink& getProc() { return mBaseProcLink; } - -private: + void sub_71002FB17C(); /* 0x08 */ char unk_00[0x10]; /* 0x18 */ ksys::act::BaseProcLink mBaseProcLink; - + char placeFiller[0xEC]; + /*0x114 */ u32 unk_114; }; class AirOctaFlyUp : public ksys::act::ai::Ai { @@ -27,19 +28,20 @@ public: void enter_(ksys::act::ai::InlineParamPack* params) override; void leave_() override; void loadParams_() override; - + float sub_71002FB17C(); protected: // static_param at offset 0x38 const float* mFlyUpDuration_s{}; // dynamic_param at offset 0x40 float* mTargetDistance_d{}; // aitree_variable at offset 0x48 - // for whatever reason, removing getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); and replacing it with + // for whatever reason, removing void* mAirOctaDataMgr_a; and replacing it with // AirOctaDataMgr** mAirOctaDataMgr_a{}; will make loadParams_ be not matching with a difference of 0 and make // handleMessage_ go from a difference of 5 to matching. ¯\_(ツ)_/¯ going from nonmatching to matching and // making another function go from matching to not really unmatching is still net progress - // getAITreeVariable(&mAirOctaDataMgr_a, "AirOctaDataMgr"); + // void* mAirOctaDataMgr_a AirOctaDataMgr** mAirOctaDataMgr_a{}; + float AirOctaY{}; }; } // namespace uking::ai