• Visit Rebornbuddy
  • Checking if Char is inside or outside

    Discussion in 'Community Developer Forum' started by Cryogenesis, May 17, 2014.

    1. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Hey guys,

      Is there a way to check if a char is inside or outside?

      Thanks in advance!
       
    2. Rostol

      Rostol Member

      Joined:
      Jul 19, 2014
      Messages:
      95
      Likes Received:
      1
      Trophy Points:
      8
      Hey Cryo,

      I was thinking about this too, if there isn't a built-in one best i could come up with was identify and store the inside "volumes" (corners of buildings, not rooms) and check.

      Really i was thinking of using something like that for pathing .... like if source.area != dest.area then ask for navpath to taxi. take taxi to correct area. ask navpath taxi terminal to dest.
       
    3. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      It should be programmable, but what you are describing, goes beyond something you can do in profiles.
       
    4. Rostol

      Rostol Member

      Joined:
      Jul 19, 2014
      Messages:
      95
      Likes Received:
      1
      Trophy Points:
      8
      Yeah i know I am looking at making small plugin, but this wouldn't be something to be done on every (or every x) client-ticks so i dont think a plugin is the correct solution. And i'm nowhere near close to being able to write a whole profile.

      There is a RoomName r/o property
      Code:
      public string RoomName { get; }
          Member of Buddy.Swtor.BaseClient
      
      And also a similar AreaName r/o prop

      But i dont know if you can use them from the XML, I haven' t reached the profiles and how they work. So yeah, not very helpful yet, but give me some time :)
       
    5. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      there is coding for areaname, but i didnt got it really functioning.
      See Kicks guide for profiles.
       
    6. Rostol

      Rostol Member

      Joined:
      Jul 19, 2014
      Messages:
      95
      Likes Received:
      1
      Trophy Points:
      8
      Which profile has the code for areaname? i might be able to give you a hand.

      INTUITIVELY (as i dont know enough yet for an informed opinion, and will have more time to review code over the weekend):
      Neither areaname nor roomname can apparently work.
      It would need a compatible code in the conditions parser something like
      Code:
         public static bool HasQuest(ulong questId)
      
      so two new ones would be needed (in pseudo)
      Code:
       public static bool IsInArea (ulong areaId) //not a clue how areas are id'd if by id or display name
      {
                Char.areaId == areaId ? retrun true : return false 
      }
       public static bool IsInRoom (ulong RoomId) //ditto
      {
                Char.roomId== RoomId ? retrun true : return false
      }
      
      Then using those two you'd have to make the profile work
      Code:
      <if Condition="isinarea(xxx)">
               <if Condition="isinroom(xxx)">
              .... 
              </if>
              <if Condition="isinroom(xxx)">
              .... 
              </if>      
      </if>
      

      edit: I just realized we've gone slightly offtopic, the original question was not what room or area but in a room or outside. this should be simpler

      Edit 2: i didnt know this was a valid condition <If Condition="(Me.Class == CharacterClass.Smuggler)"> so there might be a different easier way to do this.
       
      Last edited: Jul 31, 2014

    Share This Page