What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

StatusText showing the previous one?

jim87

New Member
Joined
Aug 26, 2011
Messages
445
Reaction score
7
Hello! I've realised a simple method in my Utils class:
PHP:
        public static void changeStatusText(string text)
        {
            Styx.Logic.BehaviorTree.TreeRoot.StatusText = text;
        }

This should change the status text at the bottom of HonorBuddy's main window, but there seems to be some "delay", that is HB will show the previous StatusText changed, at least in that way - maybe there's already a delegate method in Styx I've missed in order to change it correctly? The debug log shows it correctly, for example:

Code:
... snippet of cast things and others...
[hh:mm:ss:milli] Activity: blahblah1
[hh:mm:ss:milli] Activity: blahblah2
And at the bottom of the bot window it is written "blahblah1" and it won't change untill another call of the method.

here is the full log, if it may be of help: View attachment 28-10-2011_15.35 2212 Log.txt
 
it should update every pulse, so yea, there might be a tiny bit a delay, but you shouldn't be using that to real time update a value.
 
The key part of log:
Code:
[10:34:03 PM:831] You are a level 85 Subtlety Rogue
[10:34:04 PM:569] Activity: Loading Tile/s
[10:34:04 PM:570] Loading Azeroth_31_48
[10:34:07 PM:646] Activity: Apsalar -> Subtlety -> Combat -> PvE
[10:34:08 PM:386] Spell_C::CastSpell(51713, 0, 0xF13079AA000012FA, 0) [1]
[10:34:08 PM:389] Casted Shadow Dance.
[10:34:09 PM:265] Spell_C::CastSpell(36554, 0, 0xF13079AA000012FA, 0) [2]
[10:34:09 PM:271] Casted Shadowstep.
[10:34:09 PM:289] Spell_C::CastSpell(8676, 0, 0xF13079AA000012FA, 0) [3]
[10:34:09 PM:295] Casted Ambush.
[10:34:10 PM:310] Spell_C::CastSpell(408, 0, 0xF13079AA000012FA, 0) [4]
[10:34:10 PM:316] Casted Kidney Shot.
[10:34:11 PM:305] Stopping the bot!
[10:34:11 PM:306] Stop called!
[10:34:11 PM:313] Activity: Honorbuddy Stopped
[10:34:11 PM:392] System.Threading.ThreadAbortException: Thread was being aborted.
   at Styx.Logic.BehaviorTree.TreeRoot.Tick()
   at Styx.Logic.BehaviorTree.TreeRoot.Run()
[10:34:11 PM:392] System.Threading.ThreadAbortException: Thread was being aborted.
   at Styx.Logic.BehaviorTree.TreeRoot.Run()

status text was "Loading Tile/s" till:
Code:
[10:34:11 PM:313] Activity: Honorbuddy Stopped

Then when honorbuddy was already stopped status is "Apsalar -> Subtlety -> Combat -> PvE" and when i pressed start again it displayed "Honorbuddy Stopped" when it was running already.

Digging through references i'm pretty sure it displays:
Styx.Logic.BehaviorTree.StatusTextChangedEventArgs.OldStatus
instead of:
Styx.Logic.BehaviorTree.StatusTextChangedEventArgs.NewStatus

EDIT:
Making "blinking dot" at the end of message makes it work in real-time:
PHP:
public static void statusText(string text)
{
    text = "Apsalar -> " + text;
    if (Styx.Logic.BehaviorTree.TreeRoot.StatusText == text + ".")
        Styx.Logic.BehaviorTree.TreeRoot.StatusText = text;
    else
        Styx.Logic.BehaviorTree.TreeRoot.StatusText = text + ".";
}
 
Last edited:
it should update every pulse, so yea, there might be a tiny bit a delay, but you shouldn't be using that to real time update a value.

What should I use then? BTW strix's solution seems hacky (even if it may work)...
 
its not about updating every pulse, it's about displaying wrong message, not recent one, but previous.

EDIT:
seems to work fine and real-time too:
PHP:
if ( Styx.Logic.BehaviorTree.TreeRoot.StatusText != text )
{
    Styx.Logic.BehaviorTree.TreeRoot.StatusText = text;
    Styx.Logic.BehaviorTree.TreeRoot.StatusText = text;
}
 
Last edited:
I can confirm that, if the way we're changing the text is right, it is bugged: it will always display the action previous to the one set. The hackish solution is to change it twice, like strix's last message, but it needs to be fixed.
 
Last edited:
Hello! I've realised a simple method in my Utils class:
PHP:
        public static void changeStatusText(string text)
        {
            Styx.Logic.BehaviorTree.TreeRoot.StatusText = text;
        }

This should change the status text at the bottom of HonorBuddy's main window, but there seems to be some "delay", that is HB will show the previous StatusText changed, at least in that way - maybe there's already a delegate method in Styx I've missed in order to change it correctly? The debug log shows it correctly, for example:

Code:
... snippet of cast things and others...
[hh:mm:ss:milli] Activity: blahblah1
[hh:mm:ss:milli] Activity: blahblah2
And at the bottom of the bot window it is written "blahblah1" and it won't change untill another call of the method.

here is the full log, if it may be of help: View attachment 28673

I was debugging the WaitForPatrol behavior last night, and noticed the same thing.

The debug log accurately reflects the situation, but the Status Line itself is spotty as to what it will show. Sometimes, it never bothers to display the 'last' message.

Initially, I thought it was interference from 'higher level' behaviors in the tree writing something on top of my last message, then erasing it right quick. However, this was not always the case. I also observed my "next to last" update stay on the Status Line indefinitely (when it should have been displaying my 'last' update).

Obviously, our understanding of the HBcore is incomplete. :D


cheers,
chinajade
 
Last edited:
I was debugging the WaitForPatrol behavior last night, and noticed the same thing.

The debug log accurately reflects the situation, but the Status Line itself is spotty as to what it will show. Sometimes, it never bothers to display the 'last' message.

Initially, I thought it was interference from 'higher level' behaviors in the tree writing something on top of my last message, then erasing it right quick. However, this was not always the case. I also observed my "next to last" update stay on the Status Line indefinitely (when it should have been displaying my 'last' update).

Obviously, something is broke in the HBcore. :D


cheers,
chinajade

Its actually a mini-throttle having to do with WPF updates. (You don't want to update too fast, or the UI becomes unresponsive)

You shouldn't be using the status text to show a realtime variable, regardless of whether you think you can or not.

Things that happen when you set TreeRoot.StatusText:

  1. If the old status text is not the value being set, or the value isn't null/empty, a log message is printed to debug ("Activity: <status text>")
  2. An anti-spam measure is put into place to make sure #3 doesn't happen when the status isn't actually changed (just set to the same value)
  3. The cached value is set, and the event TreeRoot.OnStatusTextChanged is fired.
  4. The UI catches the above event, and notifies WPF that it's changed, and lets WPF deal with the redrawing/updating of the UI.
 
Apoc said:
You shouldn't be using the status text to show a realtime variable, regardless of whether you think you can or not.

Thanks for the reply!

There was no guidance in this in the Intellisense documentation, and the very first HB-shipped behaviors (such as TalkToAndListenToStory et al) were the only models we had to go from.

So the question is, how should we be updating the StatusText? We used to do a lot of stuff with the GoalText (which may have similar problems to those you describe). However, since GoalText was moved to a very unfriendly location (several tabs into the interface), a lot of stuff that could go there now goes to the StatusText or as "info" messages into the log window instead.

Alas, I feel it is appropriate for behaviors to update the StatusText (area) in any case. The goal is our purpose. The actions we take to achieve that goal within a Behavior's BT is it status.

Currently, whenever we display stuff in the StatusText line (of the newer behaviors), we make certain the updates are throttled to no more than 1 update per second. This technique has yet to be propagated to all the existing behaviors, but we're working on it.

Can you provide any guidance on this?

thanks again for the response!
chinajade
 
Last edited:
StatusText and GoalText will update in the same way. (Both will be limited by built-in WPF throttling)

I'll see about adding a workaround for a "realtime" status text. Don't expect anything until at least the next release.
 
Well actually from my experience the WPF will always show the previous status text, regardless of the time passed. If I set the text twice, it will show it correctly (evidently avoiding the checks, but it works good without any interruption of the GUI, so...)
 
As i wrote before from what i saw it works as intended except it shows previous, not current message without exceptions to this.
Looks like some kind of indexing mistake by 1.
 
Back
Top