1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Some random npcs missing info (name null, actions empty)

Discussion in 'Developer Support' started by CuppaJava, May 6, 2020.

  1. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,113
    Likes Received:
    1,371
    To clarify, I know sometimes this happens randomly with NPCs info not loading completely, but it's happening consistently with the Tai Bwo Wannai villagers and Trader Crewmembers.

    I'm working on a shopping bot, and I'm finding a number of seemingly random NPCs missing names/interactions. This happens in the Development Toolkit, but it also happens if you query the info directly from code. For example, I'm near Tiadeche in Tai Bwo Wannai and if you click NPC in Dev Toolkit his name is null and interactions list is empty despite being tradeable/talk-to. The same thing happens to the nearby Tamayu, Tinsay (who should have the Talk-to interaction). But Gabooty (also nearby)'s name and interacts show up correctly using the same code/in dev toolkit.

    For example, standing near Tiadeche and executing
    Code (Text):
    1. Npcs.newQuery().names("Tiadeche").results();
    returns an empty result, but if I search directly by ID
    Code (Text):
    1. Npcs.newQuery().ids(6236).results();
    it works and I get Tiadeche as a result. Although if I look at the result NPC object and check it's definition actions/name, they're empty and null respectively.
    And if i search by ID and the expected interaction
    Code (Text):
    1. Npcs.newQuery().ids(6236).interactions("Trade").results();
    it returns empty set.

    (I promise I'm not just spelling the names wrong, I triple checked).

    Also I checked Rionasta, north of Tai Bwo Wannai and his name works correctly but his .getDefinition().getActions() returns empty list, the same as trader crewmembers below.

    Another example is the Trader Crewmembers at Port Khazard and Catherby (I didn't check other locations). If you look at them with Dev Toolkit they do have the names as expected but their NpcDefinition has an empty actions list (so crewmember.getDefinition().getActions() returns empty). Although if you directly just hardcode crewmember.interact("Trade"), that works.

    I think I've also seen this happen before with gameobjects, arbitrarily named null or with empty getActions() lists, but I don't have any examples of that right now.

    I ran around other random areas and every other NPC I tested seems to work fine, it's just a couple obscure NPCs consistently not working correctly.


    This post got really long. Tl;dr:
    • consistently name showing as null & interactions showing as empty for Tiadeche, Tamayu and Tinsay in Tai Bwo Wannai
    • consistently name working correctly but interactions showing as empty for Rionasta (north of tai bwo wannai) & Trader Crewmembers in port khazard, catherby (and probably the rest of them too)
    • this might happen with other obscure npcs but i couldn't find any others at a cursory glance (every other npc I tested around varrock/catherby/etc) seems to work fine


     
    dahnae and IamN5 like this.
  2. Best Answer:
    Post #3 by Cloud, Jul 17, 2021
  3. generalsensei

    Joined:
    Apr 21, 2019
    Messages:
    43
    Likes Received:
    9
    Seems like this behavior can be observed with other obscure npcs and objects, ive personally seen examples in the motherlode mine. Considering searching by id works, and seems to be consistent, is there any negative downsides besides being more obscure from using the npcs id vs their name? I personally can't think of any others.

    Edit: Trying to grab interactions via npc id is returning empty as well?
     
  4. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Are you sure you didn't need to look in a local state definition for the name?
     
  5. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,113
    Likes Received:
    1,371
    I forgot I made this thread :p You're totally correct, checking in the local state definition has the info :)
     
    generalsensei likes this.
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    But wait, on the other hand @CuppaJava queries are supposed to search the entities local state as well. Are you saying that when you used a name on an NpcQuery it didn't find it in the local state?
     
  7. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,113
    Likes Received:
    1,371
    Now that you mention it, I've double checked the NPCs in my original post (as I hadn't looked at these NPCs in quite a while):
    1. The trader crewmembers DO search the local state correctly as well. The actions for Trader Crewmembers seem to be in the local state, but just searching for them in the Npc.newQuery().actions("Trade") work as you outlined.
    2. There's is something different wrong with the NPCs unlocked from the completion of "Tai Bwo Wannai Trio". They're from an old quest so it might be an issue with just them specifically.
    For the Tai Bwo Wannai Trio NPCs, standing near Tiadeche, some example code I tested:
    Code (Text):
    1.         LocatableEntityQueryResults<Npc> npcs = Npcs.newQuery().names("Tiadeche").results();
    2.         System.out.println("npcs:" + npcs);
    3.  
    4.         LocatableEntityQueryResults<Npc> npcs2 = Npcs.newQuery().actions("Trade").results();
    5.         System.out.println("npcs2:" + npcs2);
    6.  
    7.         LocatableEntityQueryResults<Npc> npcs3 = Npcs.newQuery().ids(6236).results();
    8.         if (npcs3 != null && !npcs3.isEmpty()) {
    9.             System.out.println("npcs3 name:" + npcs3.nearest().getName());
    10.             System.out.println("npcs3 definition name:" + npcs3.nearest().getDefinition().getName());
    11.             System.out.println("npcs3 definition actions:" + npcs3.nearest().getDefinition().getActions());
    12.             System.out.println("npcs3 local state:" + npcs3.nearest().getDefinition().getLocalState());
    13.         }
    This outputs:
    So tl;dr it seems to be an isolated issue with those quest NPCs specifically (which I only noticed because Tiadeche sells karambwans).
     
  8. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Alright for that edge case npc it's likely similar to the mage of zamorak where they change the data at runtime. I'm not going to address that right now because it would require intercepting a packet.
     
    dahnae and CuppaJava like this.

Share This Page

Loading...