nunuhara / ai5-sdl2

Cross-platform implementation of elf's AI5WIN engine
GNU General Public License v2.0
13 stars 1 forks source link

Yu-No flags not triggering correctly #1

Closed axlpar closed 4 months ago

axlpar commented 4 months ago

Using ai5.exe to play the English-patched version of Yu-No and all is working fine except for certain events that are supposed to happen upon a second trip through the timeline not triggering. For example, grabbing the rope from the storehouse and reaching the first bad end on the Ayumi route are supposed to be reachable after going through a portal, and then using a jewel save to replay the events that led to the portal. However neither event triggers correctly unless I play though the entire route from the very beginning, instead of loading the jewel save. (See the chart for what I mean--at the very bottom on "Day 2 Daytime" the game should recognize that I am going through that path for a second time and send me to the Bad End, however it won't do so if I load a jewel save, only if I play though the entire route from the beginning after being warped back there.) I'm wondering if this is just the exe looking at the wrong ini file or something but I can't figure out what to change. Walkthrough

nunuhara commented 4 months ago

Looking at the game's code, it looks like flag 293 controls whether or not you can pick up the rope. Flag 293 is set when you look down the well, after seeing the dialogue:

【Takuya】 It's impossible... but if I can find a way to get down there, then I could probably grab it.
【Takuya】 I wonder how I'd go about doing that though. I can't exactly climb down the wall.
【Takuya】 Hmm... if only I had some sort of rope...
【Takuya】 ........

However, this flag is cleared in some cases when entering the random warp. Interestingly, it appears to be random whether or not this flag is cleared, and a whole bunch of other flags are cleared at the same time. The code looks like this:

    flag[200] = rand(6);
    [...]
    if (flag[200] == 0) {
        [...]
    } else if (flag[200] == 1) {
        [...]
        "【Ayumi】Did you come to rob me of my chastity?";
        "【Takuya】I-I wouldn't do that!";
        "【Takuya】(A-Anyway, getting myself out of this situation takes top priority right now!)";
        [...]
        flag[297] = 0;
        flag[293] = 0;
        flag[295] = 0;
        [...]
    } else if (flag[200] == 2 && flag[113] == 1) {
        [...]
    } else if (flag[200] == 3 && flag[111] == 1) {
        [...]
    } else if (flag[200] == 4 && flag[112] == 1) {
        [...]
    } else {
        [...]
        "【Takuya】So I'm at school, and it's only just past noon...";
        "【Takuya】What day is it, anyway?";
        [...]
        flag[297] = 0;
        flag[293] = 0;
        flag[295] = 0;
        [...]
    }

So if rand(6) returns 1 or 5, the flag will be cleared and you will not be able to pick up the rope until you look down the well again.

I vaguely remember having the same problem when I originally played the game many years ago, so I think this is just how the game works and this behavior isn't captured in the walkthrough.

Did you enter the random warp and arrive at either (1) the scene where Ayumi is coming out of the shower, or (2) the main hall at school?

EDIT:

For reference, the other flags used in this code are:

So if you haven't seen any of these events, there's only a 1/6 chance that you will make it through the warp with your flags intact...

nunuhara commented 4 months ago

Actually, scratch that. I am able to confirm the bug with the bad end on Ayumi's route. Some flags must be getting loaded wrong when loading a jewel save. I'll need to investigate a bit more.

nunuhara commented 4 months ago

This should be fixed now. I'm planning to do a proper release soon, but in the meantime you can use this build: ai5-sdl2.zip

axlpar commented 4 months ago

Nice, thanks! Testing it out now-- fyi Windows Security flagged the file as "Trojan:Script/Wacatac.H!ml" for some reason

nunuhara commented 4 months ago

Seems like a false positive, possibly because the .exe includes ffmpeg now.