Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

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

cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
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:
Npcs.newQuery().names("Tiadeche").results();
returns an empty result, but if I search directly by ID
Code:
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:
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
 
Joined
Apr 21, 2019
Messages
40
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?
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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?
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
7,095
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?
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:
        LocatableEntityQueryResults<Npc> npcs = Npcs.newQuery().names("Tiadeche").results();
        System.out.println("npcs:" + npcs);

        LocatableEntityQueryResults<Npc> npcs2 = Npcs.newQuery().actions("Trade").results();
        System.out.println("npcs2:" + npcs2);

        LocatableEntityQueryResults<Npc> npcs3 = Npcs.newQuery().ids(6236).results();
        if (npcs3 != null && !npcs3.isEmpty()) {
            System.out.println("npcs3 name:" + npcs3.nearest().getName());
            System.out.println("npcs3 definition name:" + npcs3.nearest().getDefinition().getName());
            System.out.println("npcs3 definition actions:" + npcs3.nearest().getDefinition().getActions());
            System.out.println("npcs3 local state:" + npcs3.nearest().getDefinition().getLocalState());
        }

This outputs:
npcs:LocatableEntityQueryResults[]
npcs2:LocatableEntityQueryResults[]
npcs3 name:null
npcs3 definition name:null
npcs3 definition actions:[]
npcs3 local state:null

So tl;dr it seems to be an isolated issue with those quest NPCs specifically (which I only noticed because Tiadeche sells karambwans).
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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:
        LocatableEntityQueryResults<Npc> npcs = Npcs.newQuery().names("Tiadeche").results();
        System.out.println("npcs:" + npcs);

        LocatableEntityQueryResults<Npc> npcs2 = Npcs.newQuery().actions("Trade").results();
        System.out.println("npcs2:" + npcs2);

        LocatableEntityQueryResults<Npc> npcs3 = Npcs.newQuery().ids(6236).results();
        if (npcs3 != null && !npcs3.isEmpty()) {
            System.out.println("npcs3 name:" + npcs3.nearest().getName());
            System.out.println("npcs3 definition name:" + npcs3.nearest().getDefinition().getName());
            System.out.println("npcs3 definition actions:" + npcs3.nearest().getDefinition().getActions());
            System.out.println("npcs3 local state:" + npcs3.nearest().getDefinition().getLocalState());
        }

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).
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.
 
Top