UI_item_say and delayedBark

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
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

UI_item_say and delayedBark

Post by Knight Captain »

It looks like if both UI_item_say and delayedBark are used in the same clause of Usecode, the last one will be said and the earlier one skipped.

This this would say Shamino's line but not the Avatar's:

Code: Select all

        UI_item_say(AVATAR, "@We should kill the Goblin King!@");
        delayedBark(SHAMINO, "@This didn't work!@", 0);
And this would say the Avatar's line but not Shamino's:

Code: Select all

        delayedBark(SHAMINO, "@This didn't work!@", 0);
        UI_item_say(AVATAR, "@We should kill the Goblin King!@");
Adding a time delay to the delayedBark does not treat them differently:

Code: Select all

        UI_item_say(AVATAR, "@We should kill the Goblin King!@");
        delayedBark(SHAMINO, "@This didn't work!@", 1);
Or if I switch them both to delayedBark, same:

Code: Select all

        delayedBark(AVATAR, "@We should kill the Goblin King!@", 5);
        delayedBark(SHAMINO, "@This didn't work!@", 1);
If I have them in [red]else if[/red] and [blue]else[/blue] they work. Is this a bug?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by Dominus »

Looks like bug.
Could you enter it in the tracker, please?
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by Knight Captain »

I wasn't sure how to categorize it.

Bug 1957 has been opened.
agentorangeguy
Posts: 565
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by agentorangeguy »

What exactly were you trying to do? Was this part of a usecode conversation to where:

Avatar says something in conversation, conversation ends, Shamino barks his line ?

Or

usecode egg or event triggered, Avatar barks his line, then Shamino barks his?



I've had success using this format (with Black gate, not sure about SI):


AVATAR.say("@We should kill the Goblin King!@");
script SHAMINO after 3 ticks say "@This should work as a bark.@";
break; //ends the conversation script, then shamino should bark his line.
-------------------------------------------------------------------------------------
Ultima 6 Mod for Exult site: http://www.ultima6.realmofultima.com/
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by Knight Captain »

This was for an egg that is placed under the Helm of Monitor and is triggered when the Helm is moved off of it.

I set POMDIRGUN in the NPC list too.

Code: Select all

//This file will allow you to set an egg under the Helm of Monitor that will
// set the appropriate flag for Pomdirgun's prior death.

void FoundHelmofMonitor object#(0xBFE) () //object will autonumber if left blank

{
    if (event == EGG) //If our egg is triggered, set in ES
        {
        if (UI_get_item_flag(POMDIRGUN, DEAD)) //If the Goblin King is dead
            {
            delayedBark(AVATAR, "@We are the Champions!@", 0); //The Avatar barks
            gflags[POMDIRGUN_IS_DEAD] = true; //Added to si_gflags.uc as 0xCC
            }
        else if (!UI_get_item_flag(POMDIRGUN, DEAD)) //If the Goblin King is not dead
            {
            if (UI_get_item_flag(POMDIRGUN, MET)) //Check if we know his name
                delayedBark(DUPRE, "@We should slay Pomdirgun!@", 0); //Dupre barks
            else //if (!UI_get_item_flag(POMDIRGUN, MET)) //If we don't know him
                delayedBark(SHAMINO, "@We should slay their king!@", 1); //Shamino barks
            }
        }
} 

// After you save this code, add an entry for it in usecode.uc
//  and then run Make.bat as an Administrator.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by Knight Captain »

The two delayedBarks at the end of baiyanda.uc work okay, but not my new additions in other files. Still not sure why, as I'm borrowing from existing working code.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: UI_item_say and delayedBark

Post by Knight Captain »

I see something similar with partyUtters. Having the item_say first will be skipped by having partyUtters after it.

Code: Select all

 AVATAR->item_say("@Wake up, little one!@"); // Only works if partyUtters is commented out.
partyUtters(1, "@She cannot wake, Avatar. She is very sick.@", "@Poor little one! She is very sick.@", false);
Yet if switch the order so the partyUtters is first, then the item_say will work, but that doesn't make sense for this in-game scenario.

Code: Select all

 partyUtters(1, "@She cannot wake, Avatar. She is very sick.@", "@Poor little one! She is very sick.@", false);
AVATAR->item_say("@Wake up, little one!@"); // Works if partyUtters is before this line.
At least for this post, this might be the original game's behavior. It seems to behave the same way as the first code block above, as the UI(0xFE9C by the Avatar is skipped. The bark does not appear.

Code: Select all

 UI_(0xFE9C, "@Wake up, little one!@");
var0001 = Func0992(0x0001, "@She cannot wake, Avatar. She is very sick.@", "@Poor little one! She is very sick.@", false);
I've updated the bug with the sample new UC file I made.
Locked