• Hey! Register here to create your account, engage with the community, and talk about what is new!

Reference Book

Status
Not open for further replies.

RDM

Member
Overlord
Joined
Sep 6, 2020
Messages
36
Reaction score
22
Hi y'all. I have included the DiamondFire code reference book to use as a reference in my other tutorials. The reference book is the book you obtain when you enter dev mode (/dev, /mode dev). It is a book on the top right hand side of your inventory.

1602967332215.png

Part 1: Color Codes

&r » Reset Colors
&0 » Black
&8 » Dark Gray
&7 » Light Gray
&f » White

&1 » Dark Blue
&9 » Blue
&3 » Cyan
&b » Aqua

&2 » Dark Green
&a » Green

&4 » Dark Red
&c » Red
&6 » Orange
&e » Yellow

&5 » Purple
&d » Magenta

&l » Bold
&o » Italicized
&n Underlined
&m » Strikethrough
&k » Obfuscated (Scrambled-up text)

Part 2: Targets

Targets are text that when evaluated, will be replaced with the name of the target. Targets can be used almost anywhere, such as call function, start process, and variable names.

» %default
Represents the player or entity that triggered the event.

» %damager
Represents the damager in damage related events.

» %killer
Represents who killed the %victim in death related events.

» %shooter
Represents who shot the %projectile in projectile related events.

» %victim
Represents who took the damage in damage related events.

» %projectile
Represents the projectile in projectile related events.

» %uuid
The current selected object's UUID.

» %selected
Represents targets selected through Select Object. If nothing is selected, %default is used instead.

Part 3: Text Codes

Text codes are text that when evaluated are changed to a certain value. They can be used in the same way as targets. They can also be nested inside of each other.

» %random(min, max)
Generates a random integer in between min and max.

» %round(number)
Rounds a number to an integer. This will always round to the floor.

» %index(list, index)
Gives you the value from the index of the list specified.

» %var(variable name)
Replaced with the value of the given variable.

» %math(expr.)
Evaluates the given expression. Works with numbers and text values. Example: %math(1 + 5 × 3) = 18

Part 4: Music Notes

» 1st Octave

- Gb0 G0 G#0
- Ab1 A1 A#1
- Bb1 B1
- ... C1 C#1
- Db1 D1 D#1
- Eb1 E1
- ... F1 F#1

» 2nd Octave

- Gb1 G1 G#1
- Ab2 A2 A#2
- Bb2 B2
- ... C2 C#2
- Db2 D2 D#2
- Eb2 E2
- ... F2 F#2

Part 5: Variable Modes

» To change the variable mode, shift right-click while holding a variable.

» Game variables will exist until everyone in the plot has left. This is the default option.

1602971082141.png

» Saved variables are kept and won't reset when everyone leaves the plot.

1602971118579.png

» Local variables are deleted after the event they are created in is completed.

1602971153030.png

Part 6: Variable Types

» Text
These represent any string of text, such as "Hello!" or "%default"

» Numbers represent a number such as 0 or %math(1+1). Numbers can be integers or decimals (up to the thousandths).

» Location variables store the X, Y, Z, pitch, and yaw values. You can left-click a block to set the location to that block. Or, you can right-click the item to set the location to your current position.

» Sound effect variables represent a sound that can be played. Sound effects can have their pitch/note and volume modified. To modify both pitch and volume, type in chat "pitch volume".

» Particle effects represent a certain type of particle that can be shown to the player.

» Potion effects represent a portion effect that can be applied to a player or mob. Potions can have its duration and amplifier modified.

» Variables represent any variable type. The value of a variable can be modified by using Set Variable. To set the variable name, type into chat while holding the variable.

» Game values contain statistics relating to the server, the plot, an event, or a single target. Game values cannot be written to, only read from.

» Item variables represent an item that can be given to a player or entity.

» List variables contain a list of values. Unlike other variable types, lists can only be accessed by using Set Variable. List indices start at 1, not 0.

Part 7: Support & Authors

If you are having trouble with your code, type /support request. Quick questions should be asked using /support question. For further information and rules regarding the support queue, please see our Community Guidelines.

Authors of this reference book:
» RedDaedalus
» Owen1212055

Please report any grammatical errors or incorrect information in a private message.

Part 8: Other References

Guides Collection
 
Last edited by a moderator:

stinkey

Forum adept
Joined
Sep 8, 2020
Messages
225
Reaction score
74
» %math(expr.)
Evaluates the given expression. Works with numbers and text values. Example: %math(1 + 5 × 3) = 18
It should be noted that, as of now, %math() joins strings rather than doing actual math in text values.

» Location variables store the X, Y, Z, pitch, and yaw values. You can left-click a block to set the location to that block. Or, you can right-click the item to set the location to your current position.
You can also use /loc.

also funny texture pack haha nice
 
  • Like
Reactions: RDM

General_Mudkip

Retired Moderator
Overlord
Joined
Sep 6, 2020
Messages
362
Reaction score
95
Also the fact that %math() doesn't follow BIDMAS.
this man seriously just make a tutorial on a tutorial?
 
  • Like
Reactions: RDM

Wobber

Forum adept
Overlord
Joined
Sep 6, 2020
Messages
1,515
Reaction score
103
PEMDAS
P
arenthesis
Exponents
Multiplication
Division
Addition
Subtraction

USA schools taught us this instead
 

General_Mudkip

Retired Moderator
Overlord
Joined
Sep 6, 2020
Messages
362
Reaction score
95
Yeah, they're all just acronyms for the Order of Operations. OoO
 

RDM

Member
Overlord
Joined
Sep 6, 2020
Messages
36
Reaction score
22
@Noah @HENLO_OMTEGU

From K_Sasha:
"Just a disclaimer: this is not the correct usage of this term. In computer science, hard coding and soft coding generally refer to bringing configurable values or constants out of your code and into more easily editable mediums such as configuration files or database tables..."

Removing duplicate code is important to minimize bugs and should definitely be supported with tutorials. However, it should also be noted that after a certain extent you are just overcoding your plot.
 
Status
Not open for further replies.
Top Bottom