Page 1 of 1
UI_item_say and delayedBark
Posted: Tue Jun 21, 2016 2:04 am
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?
Re: UI_item_say and delayedBark
Posted: Tue Jun 21, 2016 4:22 am
by Dominus
Looks like bug.
Could you enter it in the tracker, please?
Re: UI_item_say and delayedBark
Posted: Tue Jun 21, 2016 5:17 am
by Knight Captain
I wasn't sure how to categorize it.
Bug 1957 has been opened.
Re: UI_item_say and delayedBark
Posted: Tue Jul 05, 2016 3:02 pm
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.
Re: UI_item_say and delayedBark
Posted: Tue Jul 05, 2016 5:28 pm
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.
Re: UI_item_say and delayedBark
Posted: Thu Jul 07, 2016 1:28 am
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.
Re: UI_item_say and delayedBark
Posted: Sun Jul 10, 2016 3:56 am
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.