• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • FlyTo Tag using postmessage and keybindings

    Discussion in 'Community Developer Forum' started by iyake, Jul 27, 2015.

    1. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      SimpleFlyTo Tag

      Here's a straightforward flight implementation. This tag will:
      1. Mount if not already mounted using MountId. You're in charge of dismounting/using company chocobo if companion is summoned, etc.
      2. Orient you towards your target
      3. Take flight and ascend to Altitude. This is the 'Y' value of Vector3 objects (i.e. Core.Me.Location). Make sure this is high enough to clear all obstacles, otherwise you'll get pushed from the straight trajectory and the bot will never arrive and stop.
      4. Fly in a straight line to within Radius of XYZ
      5. Descend until it can't descend anymore.

      Usage:

      Code:
      <SimpleFlyTo XYZ="460.0172, -51.1414, 54.38672" Altitude="-31.96687" MountId="45" Radius="1.0" LandAfter="False" />
      <SimpleFlyTo XYZ="-225.302, 165.2225, 552.2371" />
      
      Required:
      • XYZ - Where you want to end up. The Y parameter is ignored

      Optional:
      • Altitude - The altitude to fly at - if omitted, no vertical movement will occur.
      • Radius - (Default: 3.0)
      • LandAfter - Will Land After arriving above the location. Default: True
      • MountId - The mount to use if not already mounted. 1: Company Chocobo. 45: Black Chocobo (Default: 1 - Company Chocobo)

      View attachment SimpleFlyToTag-0.2.cs

      Version 0.2
      Code:
      - Tag has been renamed to SimpleFlyTo to differentiate it from the eventual official release of a FlyTo. You'll have to find/replace all your old profiles.
      - With RB v310 release, bot can now turn in midair for course corrections. API support also removes need for keybindings.
      - Bot can now descend to specified Altitude if Altitude is below current location.
      - Altitude now optional, omitting it will result in no vertical movement after taking off.
      - LandAfter attribute added, defaults true to support initial release
      - Tag will fail if not already mounted and in combat so we don't block CRs
      
      Version 0.1
      Code:
      - Original release based on keybindings
      
       
      Last edited: Aug 18, 2015
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      382
      Trophy Points:
      83
      Actionmanager.Dismount() should cause you to land
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      382
      Trophy Points:
      83
      Code:
              public async Task<bool> SetFacing() 
              {
                  float z = Location.Z - Core.Player.Location.Z;
                  float x = Location.X - Core.Player.Location.X;
                  // The Z axis goes from top to bottom for whatever reason, so for simplicity
                  // take its inverse
                  float angle = Convert.ToSingle(Math.Atan2(x, -z));
      
                  MovementManager.SetFacing(PI - angle);
      
                  await Coroutine.Sleep(500);
      
                  return true;
              }
      
      should be replaced with

      Code:
      
      Core.Player.Face(Location);
      await Coroutine.Yield();
      return true;
      
       
    4. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Oh, I was looking in movementmanager for a setfacing(vector3). sadly, that one doesn't work to change movement direction either while in flight.

      Updated, thanks.
       
    5. Cloud30000

      Cloud30000 New Member

      Joined:
      May 9, 2015
      Messages:
      298
      Likes Received:
      7
      Trophy Points:
      0
      Have you tried changing your movement logic to:
      Code:
                  while (Distance2D(Core.Player.Location, Location) > Radius) {
                      if (!moving) {
                          MovementManager.MoveForwardStart();
                          moving = true;
                          }
      				while (Core.Player.IsFacing(Location))
      				{
      					await Coroutine.Yield();
      				}
      				if (!Core.Player.IsFacing(Location))
      				{
      					MovementManager.MoveForwardStop();
                                              moving = false;
      					await SetFacing();
      				}
                  }
      I think that should be able to compensate for any veering off course
       
    6. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Neither of the calls to change facing works in midair. they only change the camera angle for a second, but you keep moving forward on the original heading. That's why the tag orients you before taking flight.

      I imagine the facing calls weren't originally written with flying in mind.
       
    7. becto

      becto Member

      Joined:
      Mar 14, 2014
      Messages:
      104
      Likes Received:
      5
      Trophy Points:
      18
      Thanks iyake, This works really well.

      I created a profile that shows this in action so others can play around with it and see how it works.

      Code:
      Profile: [O] [BTN] Dark Chestnut Log - The Dravanian Forelands
      Author: becto (this profile) and iyake (for flight)
      Version: 1.0.0
      Required Level: 54
      Required Teleport Location:
      	Falcon's Nest
      Required User Interaction:
      	None. AFKable.
      	Do Not type in Chat while bot is running as it may interrupt flight.
      	Do Not change Camera Angle or move as it may interrupt flight.
      Required Setup:
      	Acquire Falcon's Nest Aetheryte
      	DO NOT START IN The Dravanian Forelands
      	Copy FlyToTag.cs into the following folder: RebornBuddy\Plugins\OrderBotTags\ 
      Item Collected:
      	Dark Chestnut Log
      WARNING:
      	This looks like a bot, do not use without supervision. The intent is to show off the flight provided by iyake. Use at your own risk.
      
      View attachment [O] [BTN] DarkChestnut Lumber (flight).xml
       
    8. Tinytox

      Tinytox Member

      Joined:
      Nov 5, 2014
      Messages:
      370
      Likes Received:
      7
      Trophy Points:
      18
      Thanks for the OrderBotTag, and the profile! It works really well and the only other one I've tried needs to fix the stealthing, making this a much more viable option!
      It's really cool to see progress being made towards flight automation!
      So, thanks guys!
       
    9. nephro

      nephro New Member

      Joined:
      Jul 12, 2013
      Messages:
      56
      Likes Received:
      1
      Trophy Points:
      0
      GREAT work! Im not the best coder but.... If your facing, then flying to a direct path, why not have parts of reconfiguration of flying? Say you didnt get high enough and hit/got stuck on obstacle. Have bot resync facing location after you move from object? I know you could add a If function in there. Im currently going back into coding so i figure i can try and help as much as possible. MAybe a BOOLeon would work for this case? If path unhindered then use path, if path hindered then resync.

      Is it possible for the CODE it write itself? Have code write more code if a such function pulls up? basicly self injects code that it might seem to work for the bot lol?
       
    10. Tinytox

      Tinytox Member

      Joined:
      Nov 5, 2014
      Messages:
      370
      Likes Received:
      7
      Trophy Points:
      18
      While technically you can write code that writes code, and then injects, I can only assume it's a less than practical or viable option. :X

      Now, I noticed that this performs much better when I change my camera orientation to directly behind my character. I imagine First person would also work. When I have my camera orientation top-down over my character, there's problems.
       
    11. nephro

      nephro New Member

      Joined:
      Jul 12, 2013
      Messages:
      56
      Likes Received:
      1
      Trophy Points:
      0
      Nice! still i cant wait to get my money to get a new license! gotta start coding again!
       
    12. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      Where does this get installed?
       
    13. tishat

      tishat Member

      Joined:
      May 29, 2015
      Messages:
      735
      Likes Received:
      7
      Trophy Points:
      18
      OrderBotTags
       
    14. mistahmikey

      mistahmikey New Member

      Joined:
      Jun 29, 2015
      Messages:
      161
      Likes Received:
      3
      Trophy Points:
      0
      No idea where OrderBotTags is located. But I stumbled into the truth by installing it under Plugins/FlyToTag/FlyToTag.cs. That seemed to work fine.
       
    15. gadiel

      gadiel New Member

      Joined:
      Jun 4, 2015
      Messages:
      6
      Likes Received:
      1
      Trophy Points:
      0
      Doesn't matter which mountID I use it always uses the mount roulette? Why is that?

      Edit: Making the default the black chocobo made it work, so I'm not sure what's going on there.

      Edit2: This is a really good start. Thank you for your efforts!

      I can see being able to collect collectibles with this. Is there any way to do collectibles right now?
       
    16. goldenlion

      goldenlion New Member

      Joined:
      Oct 20, 2013
      Messages:
      106
      Likes Received:
      0
      Trophy Points:
      0
      AFAIK, fish.cs does it. It's a YesOrNo, i think.
       
    17. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Tag has been renamed and updated to use the new 310 movementmanager methods.

      Please replace <FlyTo with <SimpleFlyTo in all your profiles
       
    18. teh4x

      teh4x New Member

      Joined:
      Feb 9, 2015
      Messages:
      15
      Likes Received:
      1
      Trophy Points:
      3
      See attached. I posted this over here, but the original format for such a file was lifted from FlyTo.cs.

      Maybe you'll find the code useful. Maybe not. It seems to me it just needs to check the proposed path for obstacles (method implemented as "PathIsClear" but not utilized) and then some random sampling to find a way around the obstacle, rebuilding the _waypoints list as necessary.

      View attachment FlightPathTo.cs
       
    19. Blade

      Blade New Member

      Joined:
      Jul 21, 2015
      Messages:
      41
      Likes Received:
      0
      Trophy Points:
      0
      Good work on getting us up in the air! :)

      I need some help though. I have tested two different version to be able to fly:

      FlightPathTo.cs
      SimpleFlyToTag-0.2.cs

      The problem i face is that the "simpleflytotag" doesn't get me in the air (it jump normal but do not get in the air). I have tested two settings in FF14, one is automatic jump setting, and the second is manual with double jump and neither is working to get me in the air.

      However, "FlightPathTo" is able to get me in the air and to my destination, but it fail to climb with a 90 degrees ange. The plugin has a "smooth" functionality built in that prohibit me to land safe at my destination in narrow valley mountains with many cliffs around.

      How to make SimpleFlyToTag get me in the air? Or how to make FlightPathTo be able to climb vertically?

      Appreciate any help on this.
       
    20. Cloud30000

      Cloud30000 New Member

      Joined:
      May 9, 2015
      Messages:
      298
      Likes Received:
      7
      Trophy Points:
      0
      Have you tried splitting the fly tags for either profile up into two or three parts, with the first one using the current location but your desired elevation, then the second keeping the elevation high at the target location, then the third one using the target location but an elevation on the ground?

      Example:
      Code:
      Current Location = "460.0172, -51.1414, 54.38672"
      Destination = "420.3584, -62.6214, 33.9645"
      Code:
      <SimpleFlyTo XYZ="460.0172, --31.96687, 54.38672" Altitude="-31.96687" MountId="45" Radius="1.0" LandAfter="False" />
      <SimpleFlyTo XYZ="420.3584, --31.96687, 33.9645" Altitude="-31.96687" MountId="45" Radius="1.0" LandAfter="False" />
      <SimpleFlyTo XYZ="420.3584, -62.6214, 33.9645" Altitude="-62.6214" MountId="45" Radius="1.0" LandAfter="True" />
       

    Share This Page