#(funnyxaddi) i m new to this wand to learn

97 messages · Page 1 of 1 (latest)

drifting kindle
#

im new to this coding in genneral im trying to make som basic scripts and heve had som mix sucsses
any boddy willing to help meout im heveing som errors and can find how to get rid of them
thx already

main etherBOT
#

(funnyxaddi) i m new to this wand to learn

main etherBOT
#

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.

frigid fossil
#

!haste debug

#

!info haste debug

lost frigateBOT
#
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!

drifting kindle
frigid fossil
#

uhh alright, so

#

ln. 6,8 => You misspelled assignment
ln. 27-31 => ^ prefix is ancient, it does nothing
ln. 29 => <server.flag.online_players.exclude[<player>]> this is invalid

#

!t server.online_players

lost frigateBOT
frigid fossil
#

ln 30 => You pass the linked npc as a definition, then overwrite it with the newly created npc? (ln. 43)

#

You can rewrite the whole npc_path script to just loop through the anchors

#loop though the npc's anchors
- foreach <npc.anchors>:
  #walk to the current anchor in the loop
  - ~walk <npc.anchor[<[value]>]> auto_range
  - narrate "Here is a spot I want to show you!"
  #you can have this here instead of the npc_trypause script
  - while <npc.location.distance[<player.location>]> > 5:
    - narrate "Try to keep up"
    - wait 2s
  - wait 10t```
#

also ln. 22 => it's just chat trigger: (no underscore)

#

If you're new to denizen I'd suggest going through the guide

#

!guide

lost frigateBOT
frigid fossil
#

You can also search any tags/mechanisms/language explanations on the meta

#

!lang assignment script container

lost frigateBOT
# frigid fossil !lang assignment script container

Assignment script-containers provide functionality to NPCs by 'assignment' of the container. Assignment
scripts are meant to be used when customizing the normal behavior of NPCs. This can be used on a 'per-NPC' basis,
but the encouraged approach is to design assignment scripts in a way that they can be used for multiple NPCs,
perhaps with the use of constants or flags to determine specific information required by the scripts.

Features unique to assignment script-containers include 'actions' and 'interact script' assignment.
Like any script, the ability to run local utility scripts can be accomplished as well. This allows fully
interactive NPCs to be built purely with Assignment Scripts, and for advanced situations, world scripts and
interact scripts can provide more functionality.
See als...

Group

Script Container System

drifting kindle
#

i went througt the guide but jumpt a head a bit (im to inpationt) thx for the help im dong the schanges you sergested gonne se if it works

drifting kindle
oak tide
drifting kindle
#

nopp and dislactik so besecly f from the start

oak tide
#

Ay, dyslexic. I was wondering why your words seemed different.

drifting kindle
#

yea fom nl live in swe never had eng in school so only leard from movies and games

frigid fossil
# drifting kindle how do you mean ?

Here's an example, I took the original script you posted and simplified(?) it
The way it works is, if the player accepts the tour thing, you loop through the original npc's anchors, so in order for the script to work the original npc has to have anchors set
https://paste.denizenscript.com/View/115752
I added comments so you can understand what does what (it's pretty similar to the original script), but feel free to ask any questions if something isn't clear!

frigid fossil
drifting kindle
#

I Will try it out thx you already

drifting kindle
#

is it your video ?

frigid fossil
#

Yeah why?

drifting kindle
#

fery helpful 🙂 i tryd it and try to give him more ancor point but now he walk to pos1 then pos2 and then pos1 and then pos2 and tyhen it is fincht why dus it do that?

frigid fossil
#

Sorry I don't get what you're trying to say

#

It'll walk to each anchor it has set

drifting kindle
#

yes but twice

frigid fossil
#

How many anchors do you have set for the npc?

drifting kindle
#

2

frigid fossil
#

run /npc anchor and it'll give you a list

drifting kindle
#

i have 2 ancors set but i walks to them twice

#

after the 2 one it dus not end and it start again but the second time it comes to the 2 ancor then it ends

frigid fossil
#

Can you record a debug? It works perfectly fine for me

#

!debug

lost frigateBOT
# frigid fossil !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!

drifting kindle
#

how did you input more ancors i can heva don that wrong

frigid fossil
#

you have to have the npc selected

drifting kindle
#

yea i heve don that it walks to the points but it stil walks to them 2 times

frigid fossil
#

record a debug

#

/denizen debug -r, start the tour, let it finish, run /denizen submit and paste the link

drifting kindle
frigid fossil
#

Oh I see lol

#

You only need to loop though the anchors once, you're doing it twice

frigid fossil
#

foreach basically means for each item in this list, that's why we're looping though each anchor of the npc

#

<npc.list_anchors> will list every anchor the npc has, anything under the foreach will then run for each anchor it has set

#

Delete the second foreach and you're good to go

drifting kindle
#

aa okaay thx you sorry for wasting your time

frigid fossil
#

it's no problem you're here to learn :D

drifting kindle
#

but what do i do whith the first foreach ?

#

what sude it say ?

frigid fossil
#

You can leave it as it is

drifting kindle
#

but now it dus not reconice the in put pos2 richt ?

#

i got it to move from 1 to 2 but now it says the same ting on both places

frigid fossil
#

Do you want it to say different things for different places?

drifting kindle
#

yea like you had in the vidoe

frigid fossil
#

I just had the anchor names as the area names, it'll narrate the name of the anchor it walks to

#

so instead of pos1 the anchor name is books

#

(in my example)

drifting kindle
#

aa okay i see i will try that

#

but do i just enter a new - narrate than or ?

frigid fossil
#

no, there's already a narrate in the foreach that runs for each anchor

drifting kindle
#

im lost now sorry

frigid fossil
#
- foreach 1|2|3:
  - narrate <[value]>```
This will narrate three things `1`, `2` and `3`
In the example, you loop though each anchor, and there's
` - narrate "This is the <&c><[id]> <&a>area." format:fnpc_format`
The `<[id]>` is the value currently in the loop, that narrate will run for each anchor, narrating each anchor name
drifting kindle
#
  • foreach <npc.list_anchors> as:pos1:|pos2:
#

like that ?

frigid fossil
#

!c foreach

lost frigateBOT
# frigid fossil !c foreach
Group

queue

Syntax

foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]

Short Description

Loops through a ListTag, running a set of commands for each item.

Description

Loops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.

Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").

Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" t...

frigid fossil
#

Specify "as:<name>" to set the value definition name (if unset, will be "value").

#

That's just setting the definition name

#

You dont have to change anything in the script, you just need to name your anchors a different name

drifting kindle
#

i got it now tank you, im more of a visial learner so a lot of texst and im geing confused

drifting kindle
#

okay a new problem has come along, i added that you can click in the chat to give your yes or no anser. but no if i click it i skips to walk to pos1 an and just talks on the spot for pos1 and then walks to pos2 as normal. now the intresting part if i type yes in chat to anser it dus efry ting like it is ment to work? any ides

frigid fossil
#

paste the updated script

drifting kindle
frigid fossil
#

I'm unsure why that happens, just add a - wait 1t at the start of the yes click trigger

#

seems to fix it

#

^ here

drifting kindle
#

okay thx again

uncut magnet
#

!guide

lost frigateBOT
slate marshBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@drifting kindle