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

[Actors] Is an Actor visible?

xsol

Member
Joined
Nov 7, 2011
Messages
503
Reaction score
12
This is again a request for info or help with http://www.thebuddyforum.com/demonbuddy-forum/plugins/57588-plugin-mybuddy-local-k-follow-me.html

The four banners that are around the waypoint(s) in each act are always there; they are only made visible or invisible and there is no way to tell which banner is which or visible (that I can find)

Please not that when using LINQ there are errors so I handle iteration myself.

This code "works", but it needs tweaks and it attempts to click hidden banners and your own banner.

Code:
                        if(ZetaDia.Me.IsInTown)
                        {
                            Logging.Write("Searching for banner.");
                            ie = ZetaDia.Actors.ACDList.GetEnumerator();
                            while (ie.MoveNext())
                            {
                                if (null != ie.Current)
                                {
                                    ACD acd = (ACD)ie.Current;

                                    if (acd.Name.Contains("Banner") && acd.ActorType == Zeta.Internals.SNO.ActorType.Gizmo)
                                    {
                                        int ri = r.Next(5, 8);

                                        Logging.Write("Found a banner.");

                                        //move
                                        ZetaDia.Me.UsePower(SNOPower.Walk, acd.Position - new Vector3(2, 2, 0), ZetaDia.Me.WorldDynamicId, -1);

                                        //wait
                                        BotMain.PauseFor(System.TimeSpan.FromSeconds(ri)); 
                                        System.Threading.Thread.Sleep(r.Next(ri*1000));

                                        //interact
                                        ZetaDia.Me.UsePower(SNOPower.Axe_Operate_Gizmo, acd.Position, ZetaDia.Me.WorldDynamicId, acd.ACDGuid);

                                        //wait
                                        ri = r.Next(2, 3);
                                        BotMain.PauseFor(System.TimeSpan.FromSeconds(ri));
                                        System.Threading.Thread.Sleep(r.Next(ri * 1000));

                                        //try again?
                                        if (!ZetaDia.Me.IsInTown) break; //basically we want to loop all banners until we skip ours and find a good one
                                        //need a way to test if the damn banner is visible
                                    }
                                }
                            }
                            ie = null;

I don't really like asking for aid, but at this point, short of Apoc taking the time to help me out, I don't have many other options beyond asking for a second set of eyes/ideas

Anyone who helps solve this will be credited (of course)
 
I have traced nearly every property/field for an ACD/Actor and none have been helpful so far.
 
There's no API for this, and we haven't looked into finding a way to tell this type of info yet either. I'll add it to my todo list.
 
Hi -- I have taken your code and made a simplified version called "FollowBuddy" -- so I can powerlevel my own alternate characters. It removes the need for multisession DB running, and simply makes the bot thread find "someone" to follow. I found this thread searching for exactly the same thing you are ... a way for the follower to automatically "catch up" to the/a leader. I've merged in your sample snippet and it appears to be working well enough (i'm physically monitoring the DB gameplay and manually closing the banner dialog/etc, so it isn't too painful).

I have some thoughts I figured i'd share with you:

In the 'break' where you wish there was an API to determine active banner -- you could cache that per game. As in: once you've found your leader you will know which banner to click, provided no one else joins/leaves the party.

You could get the actorID of the popped up banner when clicking your own banner and flag it as yours to avoid re-clicking it ever again.

Would be happy to collaborate with you or show you my variation. It originated as a pure c/p of your AutoFollower code. Just drop me a line if you are interested.
 
Another random thought, my apologies if this discussion is in the wrong forum, but it would be possible to avoid a townportal + banner scan if the leader goes "missing" within 10-15yards of a clickable door (cave/next level/etc). So instead of losing the leading and immediately TP + banner attempt to scan the actor list and look for interactive objects, try that, then attempt to find the leader again.

Another thought: onPlayerDied you could determine the distance from the respawn point to the last known leader position, and if within a threshold go ahead and path yourself back to that position. Might be easier to just TP + banner ... I'm currently investigating how to pause/wait for a revive before the bot's behavior of autoclicking revive UI button ...
 
I've stopped work on this project, as another dev has taken a more active interest. http://www.thebuddyforum.com/demonb...-dude-pro-breaker-breaker-roger-smack-em.html

You can find some useful stuff there.

You are correct however on both counts you could use cacheing to help refine the banner code and you could check for portals. Both of those should be very easy additions to my code.

I have not actually entirely stopped, but some factors made me chose to keep my work for my self as I am not super active on it, but I would be willing share info etc

One thing I had considered also was caching a list of movements and using those to catch up to the leader after death. In general I wanted to avoid a trip to town a make the banner usage a last resort.
 
Back
Top