BlockBuilder57 / xenomods

Some mod code for Xenoblade games on Switch.
MIT License
25 stars 7 forks source link

L+R+B, P2 does not work. #15

Closed Lycoris2013 closed 1 year ago

Lycoris2013 commented 1 year ago

Hi, L+R+B, P2 has been restored in controls.md. https://github.com/BlockBuilder57/xenomods/commit/08944680623bf6a5eb42bf8f6455078459d6e32e However, the following items remain removed in this commit.

src/xenomods/modules/CameraTools.cpp

            if (GetPlayer(2)->InputDownStrict(Keybind::FREECAM_TELEPORT)) {
                PlayerMovement::SetPartyPosition(Meta.pos);
            }

When operating the free camera, it is inconvenient to go into the menu to operate it, Could you please add it again?

And below are the extras.

With only chkMapCond, the scenario progression cannot be ignored. I found flags of the map related to the scenario. If you make these themselves NOP or destroy the branch, they will work. If these can be operated correctly, everything will be achieved. I spent two weeks finding these.

v2.0.0 [Unlock_ZonePointName_IgnoreScenarios] gf::GfMenuObjWorldMap::isOpenLandmark->gf::GfGameFlag::getLocal

[Unlock_MapZonePoint_IgnoreScenarios] gf::GfMenuObjWorldMap::initialize->gf::GfGameFlag::getLocal gf::GfMenuObjWorldMap::setupIconTable->gf::GfGameFlag::getLocal gf::GfMenuObjWorldMap::setupZoneList->gf::GfGameFlag::getLocal gmk::GmkLandmark::isFound->gf::GfGameFlag::getLocal gf::GfMenuObjWorldMap::chkMapCond, gf::GfMenuObjWorldMap::isEnterMap

[Unlock_TitanBattleship_at_IndolinePraetoriumPort_IgnoreScenarios] gf::GfMenuObjWorldMap::setupZoneListー>gf::GfGameCond::isGameCond

[Unlock_FastTravel_IgnoreScenarios&Weather] gf::GfMenuObjWorldMap::isEnableJump

BlockBuilder57 commented 1 year ago

Unfortunately I can't just no-op these calls - having to support multiple versions of these games means that I'd have to check every single version and make a unique patch if needed. The effort wouldn't be too bad, but I just don't have each version, even for DE. For 2 I think we'll just have to deal with it as is. Besides, the Jump to Landmark feature lets you warp anywhere anyway, all you have to do is look up the table.

I attempted a patch for hooking the flag/cond functions, and unfortunately even while doing nothing the game chugs hard. I wanted to make something similar to BDAT overriding for them, but I don't think we have the frametime budget. I added a few more hooks that may(?) allow them in more situations at the very least.

As for the camera thing, I was actually thinking of deprecating that, but considering I've removed all the other buttons I'll just go and readd that.

Lycoris2013 commented 1 year ago

Unfortunately I can't just no-op these calls - having to support multiple versions of these games means that I'd have to check every single version and make a unique patch if needed. The effort wouldn't be too bad, but I just don't have each version, even for DE. For 2 I think we'll just have to deal with it as is. Besides, the Jump to Landmark feature lets you warp anywhere anyway, all you have to do is look up the table.

Hmmm, when I created the cheat code, I discovered that this function works with nop. I had a case where replacing nop with the caller of these functions did not work correctly, At that time I changed tbz/tbnz under it to nop. If tbz/tbnz is set to nop, the branch is aborted and does not jump to the correct functions, regardless of the value of the flag/cond. Do you need some other perspective to change the values you get from the flag/cond and put them into these functions? At least in 1.00 2.00 2.02 2.1.0 I could port the code. I thought I could easily realize 1.00-2.00 with labels. Either way, it is true that there is the Jump to Landmark feature, so there seems to be no need to push it any further.

As for the camera thing, I was actually thinking of deprecating that, but considering I've removed all the other buttons I'll just go and readd that.

Thanks for bringing back the feature. I'm surprised it can work with P1.

BlockBuilder57 commented 1 year ago

It's not about not being able to no-op them, that's easy. It's about creating the different patches for each and every version, something that I cannot do reliably as I only have a select few. For example, Torna's release with 2.0.0 majorly changed almost every single function you mentioned due to having to support Torna's world map. I can't rely on the same relative offset being usable between each version.