#(Doxa) Custom looting system [ Loot array ]

1 messages · Page 1 of 1 (latest)

austere musk
#

I want to create a loot array that can be pulled in different instances.
How would I go about creating an multiple loot arrays that contains the follow data e.g:
Elo 100 Loot pool:
Diamond_Sword: | Drop chance: 5 | Amount: 1-5 |
Stone: | Drop chance: 95 | Amount: 20-40 |

And how could I pull this data to execute actions e.g:

  • repeat 3:
    • drop [Elo 100 Loot pool] <context.location>
tardy spindleBOT
#

(Doxa) Custom looting system [ Loot array ]

tardy spindleBOT
#

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>

grim bough
#

task/proc scripts

#

!lang task script

naive deltaBOT
# grim bough !lang task script

Task script containers are generic script containers for commands that can be run at
any time by command.

Generally tasks will be ran by !command run or !command inject.

The only required key on a task script container is the 'script:' key.


Task_Script_Name:

    type: task

    # When intending to run a task script via the run command with the "def:" argument to pass data through,
    # use this "definitions" key to specify the names of the definitions (in the same order as the "def:" argument will use).
    definitions: name1|name2|...

    script:

    - your commands here


Group

Script Container System

grim bough
#

!lang procedure script

naive deltaBOT
# grim bough !lang procedure script

Procedure script containers are used to define a script that can be ran through a tag.

Generally called via !tag proc or !tag proc.context.

The only required key is 'script:'.

Note that procedure scripts must NEVER change external state.
That is, a procedure script cannot change anything at all, ONLY determine a value.
Setting a flag, loading a YAML document, placing a block, etc. are all examples of external changes that are NOT allowed.

This restriction comes from two main reasons:

  • Tags run in arbitrary conditions. They may be read asynchronously or in other weird circumstances that can result
    in applied changes crashing your server or other unexpected side effects.
  • Tags can run for a variety of reasons.
    If you were to make a proc script 'spawn_entity' that actually...
Group

Script Container System

grim bough
#

!lang data

naive deltaBOT
# grim bough !lang data
Cannot Specify Searched Language

Multiple possible languages: Data Actions, Raid Event Data, Data Script Containers.

grim bough
#

!lang data script

naive deltaBOT
# grim bough !lang data script

Data script containers are generic script containers for information that will be referenced by other scripts.

No part of a 'data' script container is ever run as commands.

There are no required keys.

Generally, data is read using the !tag ScriptTag.data_key tag.


data_script_name:

    type: data

    # Your data here
    some_key: some value
    some_list_key:
    - some list value
    some_map_key:
        some_subkey: some value


Group

Script Container System

grim bough
#

build your scripts, call them as desired

#

final product might look something like - drop <proc[elo_100_loot_pool]> <context.location> where that proc uses whatever logic to generate a result from a data script

#

fundamentally your question is something like "how do I write the logic for my drop tables," and the answer is something like "by writing the logic for your drop tables"

#

you are asking too high level of a question, the answer is you need to assemble your data and parse it as desired

#

!t scripttag.data_key

naive deltaBOT
# grim bough !t scripttag.data_key

Returns the value from a data key on the script as an ElementTag, ListTag, or MapTag.
For example, "script.data_key[type]" on a task script will return "task".
Custom keys should usually go in a 'data' script container, or under a key labeled 'data' for other script containers.

Returns

ObjectTag

grim bough
#

so like <script[elo_100_loot_pool_table].data_key[drops].random[1]> would return a random result from the drops key of that script

#

the data script could also be a map of key/value pairs, where the key is the drop name and the value is the drop weight

#

although that might not be what you want, idk. the point is you gotta think up the design and then implement it

austere musk
#

using the data script how would i assign 1 variable multiple types of data
e.g
NameOfItem | Drop Chance | Item amount
Diamond sword:5:<util.random.int[1].to[5]>

#

just asking for more of the format / syntax i should follow

#

lock_loot_pool:
type: data
Rare_Loot:
stone:
- 95
- <util.random.int[1].to[5]>
diamond:
- 5
- <util.random.int[1].to[2]>

#

is that valid? ^^^

low robin
#

!guide mechanisms

naive deltaBOT
fringe mica
#

personally i do

#
- material: diamond_sword[quantity=5]
  weight: 5
austere musk
#

how would I access the quantity information

#

so if I wanted to /drop <proc[elo_100_loot_pool]> <context.location>

fringe mica
austere musk
#

ah mk

fiery vaultBOT
#

Tag parse results for <element[ diamond_swword[quantity=5] ].as[item]>: https://paste.denizenscript.com/View/102993

element[ diamond_swword[quantity=5] ].as[item]
Had error: Cannot convert object ' diamond_swword[quantity=5] ' to type 'ItemTag'.
Had error: Tag <element[ diamond_swword[quantity=5] ].as[item]> is invalid!
Had error: Unfilled or unrecognized sub-tag(s) 'as[item]' for tag <element[ diamond_swword[quantity=5] ].as[item]>!
Had error: The returned value from initial tag fragment 'element[ diamond_swword[quantity=5] ]' was: ' diamond_swword[quantity=5] '.
Had error: Almost matched but failed (possibly bad input?): as
fringe mica
#

oops

fiery vaultBOT
fringe mica
#

there

austere musk
#

o alright

#

lets hope I can find a way to implement all this together

fringe mica
#

good luck!

radiant thistleBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please type </resolved:1028673926114594866> 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.)

#

@austere musk