Overhaul List: Variables #1355
Wolf2323
started this conversation in
Overhaul Lists
Replies: 1 comment
-
I'd love to have variable placeholders that display different unicode characters depending on BQ conditions. Imagine being able to have different custom texture font stuff in sidebars, tab list etc depending on all the BQ conditions, that's the dream. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Variable Overhaul
Part of the full Events, Conditions, Objectives, Variables Overhaul
What this is: This is the full and updated list of Variables how they will be implemented after the overhaul.
Explanation: Arguments in
<>
are mandatory,[]
is optional,CAPS
are keywords.Contributing changes and new variables: Join the discussion by commenting.
A new concept:
Variables should be moved to their own file
variables.yml
. You can define variables in the known key value format.This is how this could work:
Old syntax:
%objective.kill_zombies.left%
New syntax:
%ZOMBIES_LEFT%
and in the variables.yml:
This allows much more control over your variables as they now can contain spaces, optional arguments or even other variables.
Additionally, optional formating arguments could be introduced to change the way a variable is presented.
Placeholders should be also parsed directly, with BetonQuest variables having priority.
An alternative would be using
$VAR$
or a similar syntax for BetonQuest variables and%PH%
for placeholders (this has the pro that if a new plugin with placeholders would be added they couldn't be overridden by BetonQuest).There has to go some more thoughts into how this should specifically implemented.
Variables might require a default value if they cannot be resolved.
Nested Variables
Refering #1210 : If global Variables are nested right now and they accesed from an other package, they will be resolved from the calling package. This braks the resolving, because the variables are from an other package. This should not be the case any more.
Variable Addressing
Refering #1097: Some old variables could not resolve paths. This rework should solve this problem.
Some usecases require getting the top / second / third etc. value of a given per-player variable. For example ranking scoreboards and GUIs. It is also required to obtain the profile of the top player to execute actions on that profile. This will enhance the cross-player scripting compatiblities. This needs to be considered and refined together with the scripting rework.
Unmodified Variables
none
Modified Variables
condition
player
npc
objective
point
globalpoint
item
version
location
math
should allow modulo operators (modulu operations with math variable #863) or even functions like sin(), cos(), sqrt(). Additionally it needs to round it's results (Math.calc: round #892).citizen
money
Removed Variables
ph
Placeholders should be supported natively, so there is no more need for that variable.New Variables
uuid
returns the uuid of the player.const
is a constant text or number that will never be changed (like known from global variables)value
can store a text or number persistent for a player. The value is stored in the database and can be changed using a new created event. There should be a way to increase numbers and concat text stored in these values.facing
(from Add more variables #1029) get the location of the block the player is facing in the location format. The following options should be added:type
to get the Blocktypex
,y
orz
to get the single location values as described in my other request (link at the end)inventory
(from Add more variables #1029) get more information about the players inventory. (different from %item% to avoid item-name collisions). The following options should be added:empty
amount of empty slots1-35
to get the item in that slot. (or maybe just for armor/offhand)time
(from Add more variables #1029) to get the current time ingame time in a realtime format for conditions. Option:milliseconds
for the time in millisecondshour
to get the current hourdayofweek
(from Add more variables #1029) to get the current day of the week, working with the condition dayofweekifelse
(from Add more variables #1029) return different value based on a conditionrandom
(from Random variable #439) returns a random numberBeta Was this translation helpful? Give feedback.
All reactions