#(brokoliesoep) Warp system

59 messages · Page 1 of 1 (latest)

lilac rapids
#

I was working on a warp system where you would be able to teleport between different locations with beacons, like in the attached image. I have a few questions about this, so I'll ask them in one post.

First of all, I will probably be adding a bunch of these warp stations to my server, so I don't really wanna hardcode all the locations and their corresponding names. I have looked for a HashMap of some kind on the documentation site, but I couldn't seem to find one. Is there a way to make these key-value type lists?

Second, when the player steps on a beacon of a station, it should check if the player has already discovered the station, and if not it should give a message like "You have unlocked <location name> Warp Station" and add the location to the player's list of warp locations. However, I couldn't find how to add an item to a list, so I would like to know how this is done.

Third and last, when the player steps on a beacon, the player should get a chat message asking where to warp to, with clickable options. I have done clickable chat messages before, but I wouldn't knownhow to do this in a flexible way.

Thanks in advance for any help.

crude pulsarBOT
#

(brokoliesoep) Warp system

crude pulsarBOT
#

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>

halcyon valley
#

If you're looking for tables you should be looking into Map tags, I am ... unsure of where to point specifically for information on that, but for KEY/VALUE you want to consider maptags.

#

!c define

azure dewBOT
# halcyon valley !c define
Group

queue

Syntax

define [<id>](:<action>)[:<value>]

Short Description

Creates a temporary variable inside a script queue.

Description

Definitions are queue-level 'variables' that can be used throughout a script, once defined, by using the <[<id>]> tag.
Definitions are only valid on the current queue and are not transferred to any new queues constructed within the script,
such as by a 'run' command, without explicitly specifying to do so.

Definitions are lighter and faster than creating a temporary flag.
Definitions are also automatically removed when the queue is completed, so there is no worry for leaving unused data hanging...

halcyon valley
#

!c definemap

azure dewBOT
halcyon valley
#

Define has some examples of submapping, and definemap could help for building a map on the spot with multiple information.

#

What do you mean by adding an item to a list? Do you mean a minecraft item, or the concept of an item like an object? Because the guide should have gone over how to add objects to a current listtag.

#

As for checking if a player has done something before, consider the flag system.

#

!l flag system

azure dewBOT
# halcyon valley !l flag system

The flag system is a core feature of Denizen, that allows for persistent data storage linked to objects.

"Persistent" means the data is still around even after a server restart or anything else, and is only removed when you choose for it to be removed.
"Linked to objects" means rather than purely global values, flags are associated with a player, or an NPC, or a block, or whatever else.

See also the guide page at https://guide.denizenscript.com/guides/basics/flags.html.

For non-persistent temporary memory, see instead !command define.
For more generic memory options, see !command yaml or !command sql.

Flags can be sub-mapped with the '.' character, meaning a flag named 'x.y.z' is actually a flag 'x' as a MapTag with key 'y' as a MapTag with key 'z' as t...

Group

Denizen Scripting Language

halcyon valley
#

The guide goes over this.

lilac rapids
halcyon valley
#

Well either way you're going to need a method of checking where these stations are, I have my own warp system ( Without visiting places, just a list ) that uses a single command /warp and has multiple arguments to add/remove/list/goto warps.

All of the locations I have as warps are KEY/VALUE flagged to the server such as NAME/LOCATION, and I can pull them when I need to. If you're wanting to specify specific locations then you may want to consider noting them.

#

!c note

azure dewBOT
# halcyon valley !c note
Group

core

Syntax

note [<object>/remove] [as:<name>]

Short Description

Adds or removes a named note of an object to the server.

Description

Add or remove a 'note' to the server, persistently naming an object that can be referenced in events or scripts.
Only works for object types that are 'notable'.
Noted objects are "permanent" versions of other ObjectTags. (See: !language ObjectTags)
Noted objects keep their properties when added.

Notable object types: CuboidTag, EllipsoidTag, PolygonTag, LocationTag, InventoryTag

lilac rapids
#

Oh, that would probably be very helpful

#

Thank you for pointing that out

halcyon valley
#

!e player walks over notable

azure dewBOT
# halcyon valley !e player walks over notable
Group

Player

Event Lines

player walks over notable player walks over <location>

Triggers

when a player walks over a noted location. In most cases, it is preferable to use !event player enters area with a small cuboid.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.notable> returns an ElementTag of the notable location's name.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

halcyon valley
#

Can easily do a matcher depending on how you name your warps.

#

It looks like the guide isn't fully updated for mapping yet, unless I'm misreading.

lilac rapids
#

It isn't

halcyon valley
#

Making clickables isn't terrible hard, it depends on what you want the clickable to do. Run a task, have the player talk, run/suggest a command, really depends.

#

!t elementtag.on_click

azure dewBOT
# halcyon valley !t elementtag.on_click

Adds a click command to the element, which makes the element execute the input command when clicked.
To execute a command "/" should be used at the start. Prior to 1.19, leaving off the "/" would display the text as chat. This feature was removed as part of the 1.19 secure chat system.
For activating interact script chat triggers (!language Chat Triggers), you can use the command "/denizenclickable chat SOME MESSAGE HERE" (requires players have permission "denizen.clickable")
For that, in...

Group

text manipulation

Returns

ElementTag

Examples
- narrate "You can <element[click here].on_click[/help]> for help!"
- narrate "You can <element[click here].on_click[/denizenclickable chat hello]> to say hello to an NPC's interact script!"
lilac rapids
#

It just needs to teleport the player, but the problem is making the message flexible, so it only displays accessible location that have already been discovered by the player

halcyon valley
#

Then it sounds like you need to flag the player when they discover these locations for the first time, so you can display all of them at once. ( Or alternatively maybe they can use a command when standing on those beacons and you can populate an inventory gui? Or display the text then with teleport prompts? )

#

There is a few ways to tackle that.

#

You may want to consider how lengthy that message will get if you have an abundance of entries.

lilac rapids
#

You're right

halcyon valley
#

Because every single entry could be a clickable with a forloop, and using listtag.comma_separated can make things one line, or you could break them into a new line with every entry. Or if it's an inventory gui then it's all just piled into a 54 chest inventory. Many ways to go about it.

lilac rapids
#

I still can't get the note thing to work, I have this script now:

warp:
    type: world
    events:
        on script reload:
        - note <location[<world[minecraft:overworld]>, -6, 66, -6]> as:starterVillage
        on player walks over notable:
        - narrate <context.notable.name>

I have tried world, overworld and minecraft:overworld, and the script doesn't do anything for any of those. I have also tried y=65, the height of the beacon itself, but that didn't work either

halcyon valley
#

I also have moved away from text based interaction menus unless absolutely necessary ( Page turning, yes/no questions ) because chat might move at a rapid pace, and if you know what you're doing with resource packs you can make nice stuff.

#1115735516575440976 message This being a good example.

silent summitBOT
halcyon valley
#

It's X,Y,Z,WORLD_NAME

lilac rapids
#

Oh

halcyon valley
#

Hopefully someone else will take over soon and address anything I may have missed, as it's late in the morning on my timezone.

lilac rapids
#

Okay, now it works

halcyon valley
#

I assume you have figured out the majority of your issues.

lilac rapids
#

I have, thank you. I'm still working on making it easier to add new locations, but at least it works now. Thank you for your support.

small shard
azure dewBOT
# small shard !object LocationTag

A LocationTag represents a point in the world.

Note that 'l' prefix is a lowercase 'L', the first letter in 'location'.

This object type is flaggable.
Flags on this object type will be stored in the chunk file inside the world folder.

Prefix

l

Base Type

ElementTag

Implements

FlaggableObject, VectorObject

Format

The identity format for locations is <x>,<y>,<z>,<pitch>,<yaw>,<world>
Note that you can leave off the world, and/or pitch and yaw, and/or the z value.
You cannot leave off both the z and the pitch+yaw at the same time.
For example, 'l@1,2.15,3,45,90,space' or '[email protected],99,3.2'

small shard
#

The raw object format is subject to change at any point, that's why object hacking (E.g. - define world <[location].after_last[,]>) is bad

small shard
#

Note it once (probably just in-game with /ex) and it'll stay forever

#

Or until it's removed, ofc

quaint haloBOT
#
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.)

#

@lilac rapids