#(webserver) Making a Quest Menu

35 messages · Page 1 of 1 (latest)

twilit hamlet
#

Hey,

I'm trying to script a quest menu/GUI/inventory.

For this Inventory I would like to use custom items with information for each quest, like this:
https://cdn.inweb.systems/captures/irwxLH6G.png

My problem is, some information like "Status" or "Tasks" have to be variable and individual for every player.

What would be the best solution to do this, if I'm tracking the quest progress with player flags?

Currently I've done it like that:

inventoryQuestsItemTreasureHunt001:
    type: item
    debug: false
    material: gold_ingot
    display name: <&6>Treasure hunt
    lore:
    - <&b><&m>--------------------------
    - <&8>Status: <player.has_flag[questTreasureHunt001].if_true[<player.flag[questTreasureHunt001].equals[9999].if_true[<&2>Finished].if_false[<player.flag[questTreasureHunt001].equals[0].if_true[<&c>Can be started].if_false[<&e>In progress]>]>].if_false[<&4>Locked]>
    - <&8>Location: <&2>Fort Zuka
    - <&r>
    - <&8>Task: <&7>Speak to <&b>Kiyoshi
    - <&b><&m>--------------------------
    - <&8><&gt> <&e>CLICK TO TELEPORT <&8><&lt>

But all these conditions in the item lore doesn't feel right and are giving me some errors on server startup.

[23:24:51 INFO]:  ERROR in script 'INVENTORYQUESTS' While reading 'slots' input in script 'INVENTORYQUESTSITEMTREASUREHUNT001'!
                 Error Message: Missing player for player tag. 
[23:24:51 INFO]: Additional Error Info: Tag-base 'player' returned null. 
[23:24:51 INFO]: Additional Error Info: Tag <player.has_flag[questTreasureHunt001].if_true[<player.flag[questTreasureHunt001].equals[9999].if_true[<&2>Finished].if_false[<player.flag[questTreasureHunt001].equals[0].if_true[<&c>Can be started].if_false[<&e>In progress]>]>].if_false[<&4>Locked]> is invalid! 
[23:24:51 INFO]: Additional Error Info: Unfilled or unrecognized sub-tag(s) 'player.has_flag[questTreasureHunt001].if_true[<player.flag[questTreasureHunt001].equals[9999].if_true[<&2>Finished].if_false[<player.flag[questTreasureHunt001].equals[0].if_true[<&c>Can be started].if_false[<&e>In 
                 progress]>]>].if_false[<&4>Locked]' for tag <player.has_flag[questTreasureHunt001].if_true[<player.flag[questTreasureHunt001].equals[9999].if_true[<&2>Finished].if_false[<player.flag[questTreasureHunt001].equals[0].if_true[<&c>Can be started].if_false[<&e>In progress]>]>].if_false[<&4>Locked]>! 
[23:24:51 INFO]: Additional Error Info: Almost matched but failed (missing [context] parameter?): player
uneven plankBOT
#

(webserver) Making a Quest Menu

uneven plankBOT
#

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.

north remnant
#

!paste

torn estuaryBOT
north remnant
#

!debug

torn estuaryBOT
# north remnant !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!

north remnant
#

Can you upload your full script to the link above and follow the debug instructions?

twilit hamlet
#

Sure, I can upload the script, but there's nothing to record with debug, because it's working fine in-game. There are only errors on server startup and I'm looking for a better solution to create the items.

north remnant
#

!m item.lore

torn estuaryBOT
north remnant
#

Dont put tag based lore inside the item script, adjust the lore using ^

twilit hamlet
#

But where do I have to use it exactly?

north remnant
#

Wherever you are creating this item

twilit hamlet
#

Inside my item script?

north remnant
#

No

twilit hamlet
north remnant
#

Where you create an instance of this item to put in an inventory

#

Ok.. these are just item and inventory scripts.. how is the inventory getting shown to the player?

#

You would adjust the lore there

twilit hamlet
#

Do I have to use -inventory adjust?

north remnant
#

yes

#

!t player.open_inv

torn estuaryBOT
north remnant
#

use that to reference the current inventory

#

or swap around the logic a bit and do something like

- inventory adjust #stuff here
- inventory open d:<[inv]>```
twilit hamlet
#

Alright, but how can I update a single line of the lore, could you give me an example?

real peak
#

- inventory adjust slot:<your slot> lore:<tagss&logic> destination:<ur inventory>

#

Btw lore is a listtag

remote spoke
torn estuaryBOT
# remote spoke !tag listtag.set.at

Returns a new ListTag with the items specified inserted to the specified location, replacing the object already at that location.
Note the index input options described at !objecttype listtag

Returns

ListTag

Examples
# Narrates a list of "one|potato|three"
- narrate <list[one|two|three].set[potato].at[2]>
# Narrates a list of "one|potato|taco|hotdog|three"
- narrate <list[one|two|three].set[potato|taco|hotdog].at[2]>
remote spoke
#

<[current_lore].set[new lore line].at[#]> would set a new line of lore on the current lore list at line #

twilit hamlet
#

Thanks, I've got it.