Armor of beauty possible Bug?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Jhonny

Armor of beauty possible Bug?

Post by Jhonny »

Hi guys
im playing the game with both of Exult and Si fixes' latest versions

Can't give the armor of beauty back to kylysta cause the dialogue option is missing(checked various let's play on you tube and the dialogue option it's there)
P.s i have her name on my item's list
How can i fix this?
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Armor of beauty possible Bug?

Post by Knight Captain »

Good catch, this seems to happen with both SIfixes and plain SI. It looks like if Global Flag 660 is set to indicate you know who owns the breastplate, either by talking to Harnna then Standarr, or Jendon, Kylista's conversation entry won't appear.

As a workaround, Unset Global Flag 660 and you'll be able to return it to her. That will then set the flag correctly.
Jhonny

Re: Armor of beauty possible Bug?

Post by Jhonny »

It worked.
Thank you man
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Armor of beauty possible Bug?

Post by Knight Captain »

Jhonny, thanks for pointing this out. I went down the rabbit hole on trying to create a fix for it. The below code has been submitted so hopefully it will make it into SIfixes.

There was a lot of non-standard or not-best-practice stuff to decode.
* Kylista can be asked about the breastplate without any investigation. You only need to be post-storm. There's no clue flag.
* Kylista will set the flag for knowing she owns the breastplate if you ask about it, even if you don't have it or won't return it to her. As a result you can never ask about it again.
* Kylista can be arrested depending on the outcome of the trial, and if she is you cannot ask her about the breastplate.
* There are three possible trial outcomes. You can skip changing the verdict (guilty), or set either innocent or corrupt. Only by setting the innocent option will Kylista not be arrested and jailed. (There's even more outcomes if you count Voldin being alive/dead but they don't affect the breastplate).
* There are not single Fawn_Trial_Started and Fawn_Trial_Finished flags to work with. The one that sets during Iolo's audience will be unset during the recess between trial sessions, while another is set at the same time. Then after the trial the first one is set, and the recess one is left set. While this saved a flag when they wrote the game, this added complexity.
* The closest things to checking if the audience/trial started and ended are the three flags for which companion is accused.

A more complete fix, such as hiding the option to ask her about the breastplate until you know she's the owner, would require significantly more code. I don't know if there is a way to set things post-conversation but I'll check.

Code: Select all

/*  Copyright (C) 2016  The Exult Team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  The flags for the white breast plate are not well-handled. If you
 *  learn that the ceremonial armor was created by Standarr for Kylista,
 *  or if you ask Jendon about the item, they will set flag 660 (0x294).
 *  If set, you cannot ask Kylista about the breastplate and so cannot
 *  return it to her. She also will set the flag if you ask her about it
 *  without having it carried by the party, or if you refuse to return it.
 *
 *  Depending on the outcome of the Fawn Trial, Kylista may be arrested.
 *  If she is, you cannot ask about the breastplate anyway as the
 *  post-arrest conversation does not check for the breastplate flags.
 *
 *  2016-07-13 Written by Knight Captain
 */
 
void Kylista object#(0x436) () // NPC 54
{
	if (event == STARTED_TALKING) // DoubleClick would also work here.
	{
		if (!KYLISTA->get_cont_items(SHAPE_BREAST_PLATE, QUALITY_ANY, FRAME_ANY)) // If Kylista does not have the breastplate.
            {
            if (!(gflags[0x0173] || gflags[0x0174] || gflags[0x0175])) // And no one is currently on trial.
                { // The next if line is taken from the original usecode to check if Kylista was arrested after the trial.
                  // Flag 368 (0x170) is reused in the original code, which is first set during the offending audience with Iolo,
                  // but unset during the recess between sessions, and then set again after the trial completes.
                  // Flag 370 (0x172) is the recess flag, which is never unset.
                  // Flag 366 (0x16E) is the Innocence flag, which never reveals the charade behind the Oracle.
                if ((gflags[0x0170] && gflags[0x0172]) && (gflags[0x016E])) // And Kylista has not been arrested.
                    {
                    if (gflags[KNOWS_BREAST_PLATE_OWNER]) // And we know she's the rightful owner, flag 660.
                        {
                        gflags[KNOWS_BREAST_PLATE_OWNER] = false; // We clear the flag so we can ask her about it.
                        }
                    }
                }
            }
    }
    Kylista.original();
}
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Armor of beauty possible Bug?

Post by Knight Captain »

The prior code did not work. This should be closer to what I intended.

Code: Select all

/*  Copyright (C) 2016  The Exult Team
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  The flags for the white breast plate are not well-handled. If you
 *  learn that the ceremonial armor was created by Standarr for Kylista,
 *  or if you ask Jendon about the item, they will set flag 660 (0x294).
 *  If set, you cannot ask Kylista about the breastplate and so cannot
 *  return it to her. She also will set the flag if you ask her about it
 *  without having it carried by the party, or if you refuse to return it.
 *
 *  Depending on the outcome of the Fawn Trial, Kylista may be arrested.
 *  If she is, you cannot ask about the breastplate anyway as the
 *  post-arrest conversation does not check for the breastplate flags.
 *
 *  2016-07-14 Written by Knight Captain
 */
 
void Kylista object#(0x436) () // NPC 54
{
	if (event == STARTED_TALKING) // DoubleClick would also work here.
	{
		if (!KYLISTA->get_cont_items(SHAPE_BREAST_PLATE, QUALITY_ANY, FRAME_ANY)) // If Kylista does not have the breastplate.
            {   // And no one is currently on trial OR Kylista has not been arrested after the trial.
            if ((!(gflags[0x0173] || gflags[0x0174] || gflags[0x0175])) || ((gflags[0x0170] && gflags[0x0172]) && (gflags[0x016E]))) 
                {
                if (gflags[KNOWS_BREAST_PLATE_OWNER]) // If we know she's the rightful owner, flag 660.
                    {
                    gflags[KNOWS_BREAST_PLATE_OWNER] = false; // We clear the flag so we can ask her about it.
                    }
                }
            }
    }
    Kylista.original();
}
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Armor of beauty possible Bug?

Post by Knight Captain »

Make that:

Code: Select all

            if ((!(gflags[0x0173] || gflags[0x0174] || gflags[0x0175])) || ((gflags[0x0170] && gflags[0x0172] && gflags[0x016E]))) 
Locked