Opened door not recognised by getNearestNode

Report potential bugs here, and if they seem valid we can create gitlab issues for them.

Moderator: Bug Janitor

Forum rules
- Check if a topic exists before creating a new one.
- Duplicate topics will be immediately deleted.
- Issues lacking detail or sources (where applicable) will be deleted immediately.
- Unimplemented content is not bugged content. Do not report unimplemented content.
- IF YOUR BUG IS EXPLOITABLE DO NOT REPORT IT HERE. DM the report to a Bug Janitor instead.
- Repeated violation of these rules may result in a user being denied access to this section.
Post Reply
User avatar
Legendary Rare
Noob
Posts: 6
Joined: Fri May 03, 2024 1:32 pm
Has thanked: 9 times
Been thanked: 7 times

Opened door not recognised by getNearestNode

Post by Legendary Rare »

I'm writing some bot scripts and I noticed that an opened door is not being returned as a node, instead a null object is returned.
The door in question is a double door and both sides aren't recognised once opened.

Here is the info for the doors once opened:

Code: Select all

ID: 26911
Loc: 3100, 3509
ID: 26914
Loc: 3100, 3510
Code I'm using to check for the door:

Code: Select all

val openDoor = scriptAPI.getNearestNode(26911, true)
This code works for the closed door ID: 26910
Last edited by Legendary Rare on Wed May 08, 2024 6:52 pm, edited 1 time in total.
User avatar
Ceikry
Site Admin
Posts: 591
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 84 times
Been thanked: 109 times

Re: Opened door not recognised as node

Post by Ceikry »

the door moves when opened, most likely. It is no longer on that tile. Open doors are separate gameobjects with different IDs in most cases, as well. Welcome to runescape.
Nerds
User avatar
Legendary Rare
Noob
Posts: 6
Joined: Fri May 03, 2024 1:32 pm
Has thanked: 9 times
Been thanked: 7 times

Re: Opened door not recognised as node

Post by Legendary Rare »

Ceikry wrote: Wed May 08, 2024 3:13 pm the door moves when opened, most likely. It is no longer on that tile. Open doors are separate gameobjects with different IDs in most cases, as well. Welcome to runescape.
I wrote a function which returned the correct Node for Object ID: 26911 at Loc: 3100, 3509

Code: Select all

    /**
     * Gets the object node with matching id and coordinates.
     * @param id the id of the object
     * @param x the x location of the object
     * @param y the y location of the object
     * @param z the z location of the object
     * @return the object node with matching id and coordinates or null.
     * @author Legendary Rare
     */
    private fun getObjectNode(id: Int, x: Int, y: Int, z: Int): Node? {
        var scenery = RegionManager.getObject(z, x, y, id)
        if (scenery != null) {
            var realScenery: Scenery = scenery!!
            var sceneryList: List<Scenery> = listOf(realScenery)
            return scriptAPI.processEvaluationList(sceneryList, acceptedId = id)
        }
        return null
    }
The Node was returned using

Code: Select all

getObjectNode(26911, 3100, 3509, 0)
A null object was returned when using

Code: Select all

scriptAPI.getNearestNode(26911,true)
Post Reply