#(TomasoElcapo) it is possible to move npcs without having them selected?

44 messages · Page 1 of 1 (latest)

oblique ore
#

Hello and sorry if this is not the place, thx for replying by the way!

I want to move a citizens npc and then move back where he was:

I used this script

    type: task
    debug: true
    script:
        - ~walk <server.flag[Walking1]> <npc.anchor[Anchor1]>
        - narrate "Point 1 adquired"
        - wait 3s
        - narrate "Wait done"
        - ~walk <server.flag[Walking1]> <npc.anchor[Anchor1]>
        - narrate "Point 2 adquired"```

the problem is that if I don't have that npc selected it won't move and just skip that line and goes at the next one like a goto
Any ideas? I do have a few versions back so I'm not sure if that counts up, I can understand you can't give support to each version, I'm on 1.19.2 waiting to update to 1.20 soon as my other devs do update the custom plugins, for the sake of the experiment I removed those 2 custom plugins (one of them is a custom menu with working homes and the other one is a stats menu btw if that helps)

Thanks for reading guys, I'm not english so I might have mistakes on my writings ,sorry for that
neat coyoteBOT
#

(TomasoElcapo) it is possible to move npcs without having them selected?

neat coyoteBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

compact iris
#

you just need a tag to reference them; an NPC in a tag!

#

one method is flagging them;
select them manually first, /npc select
save them in a flag, /ex flag server npcs.bob:<npc>
and then you can use a tag like <server.flag[npcs.bob]>

oblique ore
#

Did that, I've been reading the docs before coming just in case and I saved my NPC with the name of Walking1

#

But if you don't have the /npc select on that npc, the script will just ignore that fact and leave

compact iris
#

because you used <npc> and not <server.flag[Walking1]>

#

or is that the location?

oblique ore
#

<server.flag[Walking1]> is the npc, the location is called <npc.anchor[Anchor1]> true

compact iris
#

you need to flag both the location and the npc

oblique ore
#

Since it was moving that npc, I thought it will be looking at their anchors

#

That makes sense

compact iris
#

it'd look more like <server.flag[npcs.bob].anchor[Anchor1]>

#

(using my example at least)

oblique ore
#

Oohh so you can call anchors on that way too, I readed something about it on the beginner's docs

#

Lemme try it and tell you how it went :]

compact iris
#

yeah, all tag results can be flagged and referenced that way for convenience or for using them when they aren't attached to the queue

oblique ore
#

After adapting your script with the anchor, it tells me that something's wrong

#
    type: task
    debug: true
    script:
        - ~walk <server.flag[Walking1]> <server.flag[npcs.bob].anchor[Anchor1]>
        - narrate "Point 1 adquired"
        - wait 3s
        - narrate "Wait done"
        - ~walk <server.flag[Walking1]> <server.flag[npcs.bob].anchor[Anchor2]>
        - narrate "Point 2 adquired"```
#

Lemme debug it through console to see

#

The second part of the script <server.flag[npcs.bob].anchor[Anchor2]> it's not recognized for some reason

compact iris
#

your debug will explain why, if you share a debug i can reference where and why it says so

#

!debug

brave acornBOT
# compact iris !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

oblique ore
#

This?

#

OH FUCK

#

I'M AN IDIOT

#

Noticed an error

#

I'm calling your example not my npc

#

Now's working!

#

Final script for someone who wants to move an NPC through tags

#
    type: task
    debug: true
    script:
        - ~walk <server.flag[Walking1]> <server.flag[Walking1].anchor[Anchor1]>
        - narrate "Point 1 adquired"
        - wait 3s
        - narrate "Wait done"
        - ~walk <server.flag[Walking1]> <server.flag[Walking1].anchor[Anchor2]>
        - narrate "Point 2 adquired"```
#

Walking1 = NPC Server tag
Anchor1 = Destination Anchor server tag
Anchor2 = Origin Anchor server tag (for debugging purposes mostly)

#

Thx for your help Behrror (if that's how it's written)

#

How can I mark as solved?