The Great Plateau barrier: Difference between revisions
imported>Leoetlino |
imported>Leoetlino |
||
Line 16: | Line 16: | ||
In that large AI function, the following piece of code can be seen: | In that large AI function, the following piece of code can be seen: | ||
<source lang="c++"> | <source lang="c++"> | ||
if ( ! | if ( !sForceEnableGlidingAndSurfingAndGiveRupees && !sIsDungeon ) | ||
{ | { | ||
if ( !getFlag_IsGet_PlayerStole2(false) && | if ( !getFlag_IsGet_PlayerStole2(false) && | ||
Line 25: | Line 25: | ||
} | } | ||
</source> | </source> | ||
A few notes: | |||
* 奈落開始待ち means (roughly) 'wait for abyss start'. It is the name of the [[AIDef:Action/PlayerHellStartWait]] action for the Player_Link aiprog. | |||
* sIsDungeon is set when [[GameScene]] [https://gist.github.com/leoetlino/c3e625367affc6a2dadffb9c92d73f6f generates a stage]. It is true if and only if: | |||
**the map type isn't any of the following type: MarioClubTestDungeon, CDungeon, MainFieldDungeon | |||
**'''and''' (the map type isn't GameTestDungeon) or the map name is ActorViewer or in debug mode{{check}}. | |||
* Essentially, what this piece of code does is force Link to void out if (a) debug flags aren't set, (b) he doesn't have the paraglider, (c) Link's coordinates are not inside this rectangle: | |||
[[File:The_Great_Plateau_barrier.png|center]] | [[File:The_Great_Plateau_barrier.png|center]] |
Revision as of 20:52, 22 October 2018
The Great Plateau barrier prevents Link from leaving the Great Plateau before he has acquired the paraglider.
Implementation
The barrier is implemented by two layers: one is a collision-based check (the voidout fog), another is hardcoded into Link's actor code.
The thing to know about the Great Plateau kill fog and box is that they both disappear after you get the paraglider. The corresponding GameData flag is called IsGet_PlayerStole2
.
Fog
This one is simple: Link will void out as soon as he touches it. The fog is a regular map unit actor that spawns whenever IsGet_PlayerStole2 is not set.
Actor code
Even if the fog is removed or if the player manages to avoid the fog (by stasis launching for example), Link will still void out when he gets too far away from the Plateau.
It turns out that IsGet_PlayerStole2 is also checked by the executable. More precisely, its value is queried by 5 functions in the entire program. One of them is the AIDef:AI/PlayerNormal code which is responsible for handling events for the GameROMPlayer (Link) actor.
In that large AI function, the following piece of code can be seen:
if ( !sForceEnableGlidingAndSurfingAndGiveRupees && !sIsDungeon )
{
if ( !getFlag_IsGet_PlayerStole2(false) &&
(x < -1600.0 || x > -350.0 || z < 1400.0 || z > 2400.0) )
{
...
return AI_AIBase::changeState(this, "奈落開始待ち", 0);
}
A few notes:
- 奈落開始待ち means (roughly) 'wait for abyss start'. It is the name of the AIDef:Action/PlayerHellStartWait action for the Player_Link aiprog.
- sIsDungeon is set when GameScene generates a stage. It is true if and only if:
- the map type isn't any of the following type: MarioClubTestDungeon, CDungeon, MainFieldDungeon
- and (the map type isn't GameTestDungeon) or the map name is ActorViewer or in debug mode[check].
- Essentially, what this piece of code does is force Link to void out if (a) debug flags aren't set, (b) he doesn't have the paraglider, (c) Link's coordinates are not inside this rectangle:
It is a simple, hardcoded, coordinate-based check, and it is embedded in the core Player actor code, so glitching past it is impossible barring major bugs that would likely leave the game broken and unplayable.