• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Does anyone know how to code to open a door? (Creating public FP profiles)

    Discussion in 'Buddy Wing Forum' started by Orlok, Jul 18, 2016.

    1. Orlok

      Orlok Member

      Joined:
      Mar 3, 2013
      Messages:
      184
      Likes Received:
      4
      Trophy Points:
      18
      Deleted

      Deleted
       
      Last edited: Jul 28, 2016
    2. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      There is code for clicking an elevator and a transportation object (speeder), but I'm not sure if there's one for a door. Check out some of the profiles posted here and see if you can find anything. Sorry I'm not much help, I don't write profiles :(
       
    3. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      My best bet, is to use UseObject or Interact.
      Do note Interact doesnt give the bot feedback IF it has pressed it, so its best to use this in a While statement to check if the condition is being fullfilled.

      So piece of code:
      Code:
      				
      <If Condition="((HasQuest(0xE000D421C466388C)) and (not IsBranchTaskComplete(0xE000D421C466388C, 1, 5, 0)))">
      	<UseObject QuestId="0xE000D421C466388C" Name="Dead Drop Blue Four" BranchId="1" StepId="5" TaskId="0" Radius="20" UseRange="5" IgnoreLOS="True" WaitTime="5" X="-357.16" Y="23.501" Z="-314.0908" />
      </If>
      
      Lets Begin with the start of the condition. You now see an If statement. You should read is as this:
      IF my quest has this QuestId and is This BranchTaskComplete not complete THEN do this. The downside on this is, If the IF statement is true, then it does what ever is inside.
      BUT if the bot fails to do what it has to do, it WILL NOT do this again. It thinks its done and goes to the next step. Now it you know it CAN fail then use a WHILE statement.
      Its the same as IF, but keeps doing it till if succeeds that step. Downside on that is, if the game is bugged, or it cant complete, it will keep looping through that statement.

      So my QuestId is 0xE000D421C466388C and this quest has a Branch, a Step and a Task part. You can see this at this part: 0xE000D421C466388C, 1, 5, 0.
      If you are on a quest and you press my questlist, you'll see quests with their info. Now there are some variations to this:
      0xE000D421C466388C, 1 - Represents QuestId and StepId (might be wrong at this, but it has Always worked like i thought it would do, may need to came back on this)
      0xE000D421C466388C, 1, 5 - Represents QuestId, BranchId and StepId
      0xE000D421C466388C, 1, 5, 0 - Represents QuestId, BranchId, StepId and TaskId.
      If you code more, you'll see the difference and when to use this.
      Do note, BranchId's mostly change, when you are on Classquests and are male or female or you made a choice that has a different options in story.

      Now for the UseObject, this is only the part i mostly use, there are way more options, but this would suffice for your situation.
      QuestId - fill in the same QuestId as in the statements (If or While).
      Name is the objects name (do note, mouseover name or UI name can change from what its actually called.) If you see this that the name is correct and doesnt interact with it, use a dumper and check for an object that has a
      misnaming or something. You'll find it eventually (YES it can happen)
      BranchId, TaskId and StepId, can be found in the quest info.
      Radius - search for this object on the coordinates specified at the end, with an radius and go to interact.
      UseRange - How far the bot has to be at the object to interact with it (If you have objects in the air like clickable pipes, this will be a very high number)
      IgnoreLOS - mostly keep this true, as it will force the bot to Always interact even if it cant see it. (Many objects are clipped inside other objects so the bot thinks it cant interact)
      WaitTime - fill in the number that the bot has to wait for/after completion. i normally fill in the value that the interactiontimer gives me with maybe some extra.
      Coordinates - nobrainer here.

      Now for doors, i would think the best would be to set up a IF im inside a certain position.
      You can do this with:
      Code:
      <If Condition="(Me.Position.X &gt; -116) and (Me.Position.X &lt; -110) and (Me.Position.Y &gt; 48) and (Me.Position.Y &lt; 49) and (Me.Position.Z &gt; -105) and (Me.Position.Z &lt; -100)">
      
      get some points where you know the door will be between (coordinates) and use that to walk to and use the object.
      If you are transported it will become falls and continues.

      Hope this helps.
       
    4. Orlok

      Orlok Member

      Joined:
      Mar 3, 2013
      Messages:
      184
      Likes Received:
      4
      Trophy Points:
      18
      Thank you for the reply you two! Unfortunately after spending many hours trying to code this the results are the same... the toon runs into the door and not open it. Sigh. I wish it was simpler to code like HonorBuddy/RebornBuddy. I've looked at other profiles to no avail the last few days. I can release this profile but people will have to manually open the doors by pressing F9 to pause the bot.
       
      Last edited by a moderator: Jul 19, 2016
    5. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      So after trying tonight, i quickly gave up due to limitations of the bot.

      This is [SOLO] The Esseles (REPUBLIC) example:
      Code:
      <Profile xmlns="http://tempuri.org/ProfileSchema.xsd">
        <Name>[FP] The Esseles - [SOLO FLASHPOINT]</Name>
        <!-- Version 1.0 - Initial Release -->
      	
      	<ForceAlignment Type="Light" AutoSkip="True" />
      	
      	<Vendors>
      		<Hotspot Name="" X="-11.0968" Y="-4.999" Z="3.852" />  The Esseles Beginning -->
      	</Vendors> 
      	
      	<GrindAreas>
      		<GrindArea Name="NAME">
      			<MinLevel>1</MinLevel>
      			<MaxLevel>100</MaxLevel>
      			<Mobs>
      				<Mob><MOBNAME></Mob>
      			</Mobs>
      			<Hotspots>
      				<HOTSPOTS>		
      			</Hotspots>
      		</GrindArea>
      		
      	</GrindAreas>		
      	
      <!--
      19:44:07,611 [INFO] [SOLO] Flashpoint: The Esseles
      	Id: 0xE000A42C7D5182AE
      	Current Step: 2
      	Current Branch: 1
      	Repeatable: True
      	Profile Functions: 
      		HasQuest(0xE000A42C7D5182AE)
      		IsQuestComplete(0xE000A42C7D5182AE)
      		IsStepComplete(0xE000A42C7D5182AE, 2)
      -->		
        
      	<Questing>
      		<!-- Make sure we have the quest -->
       		<If Condition="((not HasQuest(0xE000A42C7D5182AE)) and (not IsQuestComplete(0xE000A42C7D5182AE)))">
      		 	<UserDialog Title="Pickup the Quest: [SOLO] Flashpoint: The Esseles!" Message="We dont have the quest: [SOLO] Flashpoint: The Esseles! Please go to Priority Transport Officer and pickup the Solo quest" />
       		</If>	
      
      		<If Condition="((HasQuest(0xE000A42C7D5182AE)) and (not IsQuestComplete(0xE000A42C7D5182AE)))">
      			<If Condition="((HasQuest(0xE000A42C7D5182AE)) and (not IsQuestComplete(0xE000A42C7D5182AE)))">
      				<While Condition="(TorMap.CurrentAreaName == &quot;Republic Fleet&quot;)">
      					<MoveTo QuestId="0xE000A42C7D5182AE" StepId="2" X="-481.535" Y="0.532619" Z="-263.5"  />
      				</While>
      				<While Condition="(TorMap.CurrentAreaName == &quot;The Esseles&quot;)">
      					<If Condition="((HasQuest(0xE000A42C7D5182AE)) and (not IsStepComplete(0xE000A42C7D5182AE, 2)))">
      						<MoveTo QuestId="0xE000A42C7D5182AE" StepId="2" Name="Esseles Passenger" X="-8.4622" Y="-4.999" Z="12.0517" />
      						<TalkTo QuestId="0xE000A42C7D5182AE" StepId="2" Name="Esseles Passenger" X="-8.4622" Y="-4.999" Z="12.0517" />
      						<UseItem QuestId="0xE000A42C7D5182AE" StepId="2" Item="Activate Combat Support Droid" WaitTime="10" X="-8.4622" Y="-4.999" Z="12.0517" />
      						<MoveTo QuestId="0xE000A42C7D5182AE" StepId="2" Name="Transport" X="-0.03247964" Y="-4.959" Z="8.307503" />
      						<UseTransport TransporterName="Elevator" Type="Wonkavator" Option="Command Deck"
      												X="-0.03247964" Y="-4.959" Z="8.307503" 
      												ToX="0.7" ToY="0.03999991" ToZ="8" />
      						<MoveTo QuestId="0xE000A42C7D5182AE" StepId="2" Name="First Officer Haken" X="0.2989" Y="-0.1989995" Z="-7.4964"  />
      						<TalkTo QuestId="0xE000A42C7D5182AE" StepId="2" Name="First Officer Haken" X="0.2989" Y="-0.1989995" Z="-7.4964"  />												
      					</If>
      				</While>				
      			</If>
      		</If>		
        		
      	</Questing>	
       </Profile>
      
      Issues i had were the following
      • Cant dump Flashpoint quests (cant get info of the quest)
      • Bot locks up and shuts down on an overloop error when switching zones
      • UseTransport doesnt work
      • Usevendor bug, why o why this is happening is beyond me, but it wanted to repair but there was nothing to repair and stays in an infinite loop.
        As you can see the workaround is to remove the name of vendor
      • Couldnt find code for reading buffs from a profile to check if we need to call a helping droid.

      As you can see there should be some work that needs to be done, before you can build a usefull profile.

      ow and as you can see i used the quest ID of the SOLO quest and not the actual Flashpoint quest (as it cant be read).
       

      Attached Files:

      Last edited: Jul 19, 2016
    6. Orlok

      Orlok Member

      Joined:
      Mar 3, 2013
      Messages:
      184
      Likes Received:
      4
      Trophy Points:
      18
      Ah wow. Is there a way to some how refurbish the bot so it has more leniencies to make profiles? I wish it was as easy as RB >_<
      As far as the profile you linked above for Esseles, does it actually work from beginning to end? I wasn't sure if you were referring to Boarding Party as the one giving issues or Esseles. Thanks again for all the help brother!
       
    7. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      no it stops at the Transport, as it cant use for god knows what reason...
      So i stopped there.
      i had a talk with aevitas and we cant expect any mayor fixes as that would need a complete rewrite of some vital code inside BW.
      So my work stops at this for this issue , till someday BW gets better :)
       
    8. Praline

      Praline Member

      Joined:
      Aug 17, 2015
      Messages:
      150
      Likes Received:
      2
      Trophy Points:
      18
      Cryo, what if you have a look at old profiles Metrienne did for the Illum Flashpoint for instance to make FP specific profiles? I am too dumb to figure it all out, but maybe a different approach would help? He used "Areaname" and "Roomname" instead of the usual "Hasquest blah blah" tags. Like this:

      <If Condition="(BuddyTor.Client.AreaName == &quot;ilum_flashpoint_1_surface&quot;)">
      <If Condition="(BuddyTor.Client.RoomName == &quot;Default&quot;) or (BuddyTor.Client.RoomName == &quot;lobby_hall&quot;)">
      <Interact IgnoreQuestRelation="True" UseRange="2" WaitTime="5" Name="Shuttle Terminal" X="56.80637" Y="6.797591" Z="152.6764" />
      <WaitTimer QuestId="1" WaitTime="3" />
      </If>
      </If>

      <snip>

      Sorry, I do not know how to link to the original post. But you might have to try the "interact" tag?
      Orlok, in Metrienne's comments he said and I quote:
      " The issue with botting within flashpoints is that Buddy Wing does not consider the flashpoint mission itself (not the one picked up outside) as a trackable quest. As such, this profile is relying on XYZ coordinates or other conditions to determine where you're at and ultimately what to do next. Normally profile writers would use QuestID (and their steps) as a means to keep track of what to tell Buddy Wing to do.

      In addition, not having a trackable quest makes some mission steps difficult to accomplish. For example, at one point in Battle of Ilum we have to destroy three Force Field Generators using three Control Panels to reach the next step. A step like this normally calls for "UseObject," which will tell Buddy Wing to try until the step or task is complete. But because we have no trackable quest, we have to resort to "Interact" which is a one-time best effort attempt. If it doesn't work, Buddy Wing assumes it's been done and moves on anyway (which is not good in this case). Destroying the supply boxes to get to the bonus boss is hard to do for this same reason.
       
      Last edited: Jul 19, 2016
    9. Orlok

      Orlok Member

      Joined:
      Mar 3, 2013
      Messages:
      184
      Likes Received:
      4
      Trophy Points:
      18
      Ah understood! I really appreciate you taking the time you've put into this. I will attempt to make more flashpoints that do not require much interaction.

      If there is anyone out there who know of Imperial or Republic profiles that do NOT require much interaction, let me know and I will make some. It may require manual work but it will be 90% automative.
       
    10. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Thats a piece of dirty code which only Works everything goes according to plan.
      But from my experience that will not be the case.
      If the bot craps out or you enter zones twice, or an entire zone is 1 instance... Good luck.
      Well aevitas wasn't negative on fp quests adding, but I think he got to much on his plate right now with other bots.
       
    11. Aevitas

      Aevitas Well-Known Member Staff Member Buddy Core Dev

      Joined:
      Mar 2, 2010
      Messages:
      2,307
      Likes Received:
      36
      Trophy Points:
      48
      Just to elaborate a bit - some of the problems cryo mentioned in his previous post (especially the vendor bug) would require a huge amount of work to actually fix. BuddyWing uses our (now outdated) behaviour tree implementation, and for some inexplicable reason, sometimes the vendor behaviour's last behaviour in the tree - the one marking it as "done" - does not run. When debugging this, it'd sometimes not work on a certain vendor in a certain profile, and other times it would. Whenever it didn't, the code to mark it complete would simply not run, even though all conditions for running it were met.

      To fix that, we have a couple of options. The first - and in my opinion most beneficial to the users - would be to implement at least parts of the behaviour tree using our newer coroutines. This would mean that I'd have to rewrite various parts of the bot's core logic, possibly breaking existing plugins and/or profiles in the process. Coroutines run significantly faster, provide superior diagnostic information when something does go wrong, and are in general, easier for us to debug, therefore more reliable. Second, we could break down the vendor logic into smaller chunks, add more logging, and add a couple of hacks that reset the POI after a while and blacklist the vendor if it's a vendor POI. It doesn't solve the root problem here, but it'd at least solve this symptom. I'm not against adding a hack like this to make it "work", given that the alternative would prove very time consuming. If you guys have any ideas how this should work (e.g. reset after 10 mins of vendor POI, prevent vendor POI from being set for an hour), let me know.

      As for the transport/elevator crash - I honestly don't have a clue why the engine doesn't like what we're feeding it. We're passing it the exact same arguments as the game does itself when you click it, yet, it crashes when the call comes from BW.

      Reading buffs from a profile would require some sort of C# integration in the profiles. This can actually be done - we do it in HB as well for example. I'll dig into this a bit.

      I'm not sure what this one means :(

      Hope that clears things up a bit!
       
    12. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      I would recommend you start out much simpler. The Flashpoints have been attempted before, and they're basically a lost cause. The community NEEDS questing profiles badly, so if you're eager to write some stuff we'd love to see profiles like silentfu's Shadow of Revan profile. It'd also be a good way for you to figure out the intricacies of questing profiles so you can put that experience to work making FP profiles later on.

      Just a suggestion, I'm excited to see whatever you turn out.
       
    13. Praline

      Praline Member

      Joined:
      Aug 17, 2015
      Messages:
      150
      Likes Received:
      2
      Trophy Points:
      18
      That would be totally awesome an so much needed as alltrueist said. Even the leveling 1-65 quest lines needs a lot of love and re-writing. I tried leveling a new DvL character recently and was trying to edit existing profiles with not much luck haha.
      Silentfu's Shadow of Revan is an all-time epic classic, and he should be paid by Bossland to make more profiles for Buddywing - I wish...:)
      (Not negating the hard work and effort done by every and all contributors to this forum. My hat off to all of you!)
       
    14. Praline

      Praline Member

      Joined:
      Aug 17, 2015
      Messages:
      150
      Likes Received:
      2
      Trophy Points:
      18
      But I like dirty...oh...:p
      Thank you once again for explaining and the time you took to explain it all to Orlok as well. Heck even I started to understand some of it - or at least I THOUGHT I did until I tried writing/editing a profile hahaha oh well, we can't all be wizards I guess. :)
       
    15. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Well I can enlighten more, but only if there is a need for it.
      Like I said, I stopped my work at rewriting, as the new expansions require new quest windows support.
      For old there is bugs like transport, vendor. It really needs to be updated if anyone tries this.
       
    16. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Forget the new expansions, I'd just love a 1-50 class quest profile. With the XP gear from DvL, I can level just by class quests. OR even just a profile that does all the heroics on a given planet would be awesome. My bot doesn't usually crash unless I switch planets.
       
    17. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Its nice and all, but the biggest downer now is that conversation doesnt work with light / dark gain.
      If that was fixed along with transport, all old profiles would run. They only had to be rewritten to class profiles.
       
    18. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Aevitas check my log @ https://www.thebuddyforum.com/buddy-wing-forum/249810-code-door-creating-public-fp-profiles.html
       
    19. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      What do you mean about the conversation? Silentfu's SoR profile worked fine, minus a few hiccups.

      The transport issue is still big though, no doubt about that. Might have to code a stop-profile dialogue box like he did with the Flashpoints every time we use a transport.
       
    20. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      This one: https://github.com/BosslandGmbH/BuddyWing/issues/11
      Which sadly affects every class quest with allignment gain.

      Dialogue boxes are nice, but that isnt the solution people want. People want autonomous profiles.
      If you still need to be present, you're better off playing by hand.
       

    Share This Page