• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Navigation Problem

    Discussion in 'Community Developer Forum' started by nishalp, Apr 8, 2015.

    1. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      I am working on the Animus Book plugin and having problems with Navigation. One problem I have is I get it to wait for fates but when the fate is too far, it misses the fate. So I simple wanted to have to move to a co-ordinate before starting the fate bot. But the navigation just runs into walls. I searched everywhere and looked at how others have done it including ***** and others. They all seems to do it differently and I am not very familiar with CreateBehavior.

      Any help would be appreciated on how to get the below to work. The code is below is in my onPulse call.

      TreeRoot.Stop();

      sFate = GetNextSet(CurrentFateIndex);

      if (Core.Player.IsMounted)
      {
      Actionmanager.Dismount();
      Thread.Sleep(1000);
      }

      WorldManager.TeleportById(Fate[sFate]);
      Thread.Sleep(15000);

      Actionmanager.Mount();


      Clio.Utilities.Vector3 Goto = new Clio.Utilities.Vector3("-510.7703, 238.454, 375.3579");

      ff14bot.Enums.MoveResult Reached;
      Reached = ff14bot.Enums.MoveResult.Failed;
      ff14bot.Navigation.GaiaNavigator Nav = new ff14bot.Navigation.GaiaNavigator();

      while (Reached != ff14bot.Enums.MoveResult.ReachedDestination)
      {
      Reached = Nav.MoveTo(Goto);
      }

      FatebotSettings fb = new FatebotSettings();
      fb.ThisFateOnly = sFate;
      iFateWaiting = CurrentFateIndex;

      TreeRoot.Start();
       
    2. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      649
      Likes Received:
      18
      Trophy Points:
      18
      If this is a plugin, you'd probably not want to create a new Gaia Navigator, but rather use the navigator the bot base has already created. I believe every time you create a navigator it initiates a session with the mesh server, so having many sessions open is probably a bad thing.

      I also don't know if it's a good idea to have a navigation loop that blocks the thread like that, never really tried it. But yeah you just keep calling Navigator.MoveTo(location). This also makes me wonder, this is being called from a Pulse() right? I believe that pulse is called before the tree is ticked on each cycle, but if both are done on the same thread, isn't it unnecessary to stop and start the tree? Since you'll block the thread anyways and the tree won't be ticked until after your code exits? Also, does game objects get updated on another thread then? Or will you run on outdated info if you block the thread like this? If RB doesn't update data from the game on another thread, then it might be that the reason why you're getting stuck on walls is because you're trying to navigate without letting the navigator know your real location?

      So many questions! :p
       
      Last edited: Apr 9, 2015
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83

      I swear to god, im going to make treeroot start & stop internal so people can't use it to rig some piece of shit together.

      You can't just put a nav.moveto in a while loop, of course its going to run into walls. Also if this isnt a botbase then don't create another instance of the gaianav.
      You also can't just string all those functions together and expect to it work, for that to happen youd need to be setup a corouitine hook

      The easiest and smartest solution would be to directly set the fatebot settings to what you want as fatebot already has those features.

      Edit:
      Also, plugins cannot take control of the bot like you want in on pulse, its just not how it was designed. If you want to be able to control the running bot then youll need to use a hook, take at something like that retainer plugin someone wrote, it should have all the bits you need.
       
    4. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      I got it working. Thanks. I removed all the TreeRoot Stops and starts. Wasn't sure what that was used for but saw others using. Either way, I changed it to co-routines now and all working well. Thanks for the help. Just for my and other information, what does Treeroot.Stop and Start actually do?

      Also thanks to Neverdyne for his Movement functions. Just had to understand how not to use OnPulse and change the plugin to CoBehaviors.

       
      Last edited: Apr 9, 2015
    5. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      Ok so for the life of me I cant figure out how to something in the plugin. Also I am not sure if it is even possible in a plugin or not. Can you change from a Orderbot to a Fatebot from within a plugin? If the answer is no, well then dam... If you can, how do you swap it and how do you set the fate up? Do I define a new fate bot or do I just use BotManager.SetCurrent and then set the fate instance parameters?
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83

      If your going todo any serious development setup visual studio.

      Most anything interesting that you want to work with is grouped under the ff14bot.managers namespace, and one in particular BotManager

      I'll leave the rest to you, for if you cannot handle this, then you cannot hope to achive what you desire.
       
    7. nishalp

      nishalp Member

      Joined:
      Sep 13, 2014
      Messages:
      177
      Likes Received:
      4
      Trophy Points:
      18
      Thanks. I am actually using the VS IDE. Not sure how anyone would be doing this without it. I do see the Botmanager namespace but I want to ensure it can be used within the context I was working on. Now I can move forward. Thanks.
       

    Share This Page