#(colossal) Using Map Keys as data in a script
1 messages · Page 1 of 1 (latest)
(colossal) Using Map Keys as data in a script
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.
i dont get it, do you mean you have:
mining:
material: value
description: value
level: value
?
yea
what would be the "name"
Mining
could i use the key as the name, or should I add a name value to that
basically
i mean why not keys
huh, big language barrier rn bc i have no clue what you mean
<[my_map].key> AND <[my_map].get[name]> would both return "Mining" in this case, but one of them is using the key for information
oooohhh
gotcha
i do also have bunch of things with names as keys
for example my server warps
my_warp:
loc: idk
perm: idk.1
so it would display my_warp as the name?
in my case I lose that key name information since im defining the map to a definition to use later on in my script
Do you have a script sample on what you would like to do
it's kinda big but yeah
saaaample
ok ok lol igotcha
so at the start im getting 3 maps that have data to display to the player
Content of Denizen Script Paste #114661: scrolling... pasted 2023/08/31 11:03:24 UTC-07:00, Paste length: 1102 characters across 21 lines, Content: rw_trait_scrolling_task: type: task
i feel like 20 21 and 22 could be done better lol
hmm
post the cfg_traits data script
ye
aaand a debug recording helpful
Content of Denizen Script Paste #114662: data... pasted 2023/08/31 11:06:19 UTC-07:00, Paste length: 2374 characters across 47 lines, Content: cfg_traits: type: data
i added the display_name to them all but technically the key could be used as the name
Content of Server Log Paste #114663: Denizen Debug Logs From A Minecraft Server... pasted 2023/08/31 11:08:53 UTC-07:00, Paste length: 95724 characters across 552 lines, Content: Java Version: 17.0.6Up-time: 49m
it's in an order
im not really sure how i could go about it another way
that basically controls the items it selects when scrolling
there's not really a way to get a key in a list like fashion i guess
I mean you could define the 3 traits already in the foreach loop no
but less .get tags
doesn't seem to be a bad way with working with a data script that may change it's size whenever you add another trait into it
or removing one
yay
+> YAY!!!
i guess that strayed a bit from the main question i made this thread for tho lol
oh wasn't that the original question lol
i was asking if using map keys as data in a script is a bad thing or not
for example
<[my_map].key> AND <[my_map].get[name]> would both return a NAME called MINING
go for the name as a separate key
that's what i figured
so you can add colors and formatting and wotnot
to me it seemed like bad practice to use the key
can do <[my_map.name]> by the way
if the definition is a map
gotcha
i guess like
should <[my_map].key> EVER be used at all for displaying a name?
my thought is that it's an !itworks scenario
makes sense
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.)
@vocal raven