Help:Patching the motorcycle area checks: Difference between revisions
Help:Patching the motorcycle area checks (view source)
Revision as of 06:53, 31 July 2019
, 4 years agoremove a pretty much unused category
imported>Leoetlino |
imported>Leoetlino (remove a pretty much unused category) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Because of arbitrary, hardcoded limitations, the Master Cycle Zero cannot be used in some areas. This article lists and documents checks that must be patched to remove usage restrictions. | |||
Most of them are located in | Most of them are located in the MotorcycleMgr. | ||
== Check == | |||
The game uses the current climate for the area check<ref>[https://github.com/leoetlino/botw-re-notes/blob/2c0b98c1d5e4cb35a11d4a3ea764323432a596ea/tools/check_master_cycle_ok_areas Extracted check from Switch 1.5.0]</ref>: | The game uses the current climate for the area check<ref>[https://github.com/leoetlino/botw-re-notes/blob/2c0b98c1d5e4cb35a11d4a3ea764323432a596ea/tools/check_master_cycle_ok_areas Extracted check from Switch 1.5.0]</ref>: | ||
Line 25: | Line 26: | ||
* ✅ KorogForest | * ✅ KorogForest | ||
* 🚫 GerudoDesertClimateLv2 | * 🚫 GerudoDesertClimateLv2 | ||
== Patching == | == Patching == | ||
Line 33: | Line 32: | ||
== Technical details == | == Technical details == | ||
''Note: the addresses below are only valid for Switch 1.5.0. Other versions (on Switch or Wii U) can be patched in a similar way, though.'' | |||
=== Disappearing when entering a blacklisted climate === | === Disappearing when entering a blacklisted climate === | ||
Called from the Motorcycle AI root code. | Called from the Motorcycle AI root code. | ||
<source lang="cpp">if ( v6 && ! | <source lang="cpp">if ( v6 && !MotorcycleMgr::motorcycleCanBeUsed(v6, (float *)&v68, 0LL) ) // 0x71004ADF18 | ||
goto triggerDisappear;</source> | goto triggerDisappear;</source> | ||
Either change the condition to be always false, or change <code> | Either change the condition to be always false, or change <code>MotorcycleMgr::motorcycleCanBeUsed</code> (preferred to avoid side effects): | ||
<source lang="cpp">bool | <source lang="cpp">bool MotorcycleMgr::motorcycleCanBeUsed(MotorcycleMgr* this, Vec3 *positions, __int64 a3) // 0x7100679D10 | ||
{ | { | ||
if ( (a3 || (a3 = ActorSystem::sInstance->field_C0) != 0) | if ( (a3 || (a3 = ActorSystem::sInstance->field_C0) != 0) | ||
Line 64: | Line 65: | ||
=== Rune UI/sound effect === | === Rune UI/sound effect === | ||
Same climate based check as above, but done in a different | Same climate based check as above, but done in a different MotorcycleMgr function. Just change: | ||
< | <source lang="armasm">.text:0000007100679650 TBNZ W8, #0, loc_710067965C</source> | ||
to: | to: | ||
< | <source lang="armasm">.text:0000007100679650 B loc_710067965C</source> | ||
=== Refusing to spawn when in a blacklisted climate === | === Refusing to spawn when in a blacklisted climate === | ||
==== Check 1 ==== | ==== Check 1 ==== | ||
Deep in some | Deep in some MotorcycleMgr function, called from the PlayerNormal AI: | ||
<source lang="cpp">else if ( !WorldMgr::sInstance | <source lang="cpp">else if ( !WorldMgr::sInstance | ||
Line 85: | Line 86: | ||
Patch: | Patch: | ||
< | <source lang="armasm">.text:0000007100679BA8 CBZ X0, loc_7100679BD8</source> | ||
to: | to: | ||
< | <source lang="armasm">.text:0000007100679BA8 B loc_7100679BD8</source> | ||
so that the game always executes the code inside of the if block. | so that the game always executes the code inside of the if block. | ||
==== Check 2 ==== | ==== Check 2 ==== | ||
Found in another | Found in another MotorcycleMgr member function and also called from the PlayerNormal AI code. | ||
<source lang="cpp">bool | <source lang="cpp">bool MotorcycleMgr::checkUsable2(MotorcycleMgr *this, __int64 a2) | ||
{ | { | ||
if ( this->someFlag == 1 ) | if ( this->someFlag == 1 ) | ||
return 0; | return 0; | ||
float* v4 = this->gap12C; | float* v4 = this->gap12C; | ||
MotorcycleMgr::x_7(this, (float *)this->gap12C, (__int64)&this->field_134 + 4); | |||
if ( a2 || (a2 = ActorSystem::sInstance->field_C0) != 0 ) | if ( a2 || (a2 = ActorSystem::sInstance->field_C0) != 0 ) | ||
{ | { | ||
Line 113: | Line 114: | ||
Change: | Change: | ||
< | <source lang="armasm">.text:000000710067B5FC CBZ X0, loc_710067B62C</source> | ||
to: | to: | ||
< | <source lang="armasm">.text:000000710067B5FC B loc_710067B62C</source> | ||
to make the game always return “true”. | to make the game always return “true”. | ||
Line 139: | Line 140: | ||
==== 6 or 7 other checks ==== | ==== 6 or 7 other checks ==== | ||
The | The MotorcycleMgr function at 0x7100678E80 (which can be identified with a xref to "GameROMMotorcycle") calls 6 member functions that must all return true; otherwise, the motorcycle cannot be used. | ||
The first 4 functions appear to be using the Havok AI NavMesh system. Something called “motorcycle shape cast” is used in the 3 other functions. | The first 4 functions appear to be using the Havok AI NavMesh system. Something called “motorcycle shape cast” is used in the 3 other functions. | ||
[[Category:Guides]] | [[Category:Guides]] | ||