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

Thorough Guide to Plot Commands

RDM

Member
Overlord
Joined
Sep 6, 2020
Messages
36
Reaction score
22
Hi y'all. Commands are a super useful feature in DiamondFire. Not only do they provide polish, they can also can serve as integral parts of your games. This is a thorough guide on the ins-and-outs of commands, including applications of commands and references. Feel free to reply to this thread with your feedback, comments, and criticism.

Note: Plot commands are an Emperor donor feature. If you're interested in purchasing a rank, visit our store.

1601242159357.png

Part 1: How to use Commands

A plot command is any chat message sent with the @ symbol at the beginning of the message.

Commands are acted upon through Player Command Event, located in the Plots and Server Events category of the Player Event code block. Whenever a player sends a command, this event will activate.

Plot commands are saved in Game Values. The Event Command game value is located in the Event Values category of the Game Value. Located below is the aforementioned game value. This game value returns the entire command sent in the form of text, so a command like "@tp RandomBlock123 Jeremaster" would save everything and look like "tp RandomBlock123 Jeremaster".

1601242639005.png

To find out when a player uses a certain command, we need to use If Variable. Since the game value returns text, we can a bunch of different If Variable condition statements, including but not limited to:

Variable =
Variable !=
Text Matches
Text Contains
Text Starts With
Text Ends With

Working with commands is similar to working with text in IfVariable.

Part 2: How to Apply Commands

It's fairly self explanatory to check if a player uses a command with only one word in it, but it's a little more complicated for open-ended commands. For this, we use another game value; Event Command Arguments. This game value is also located in the Event Values category of the Game Value. This game value returns the entire command just like the first game value, but each word is separated in a list.

1601243393166.png

Command "arguments" is really just a fancy term for the words in the cmd. Arguments are separated by spaces. These arguments are stored, first to last, in a list. For example, the command "@tp RandomBlock123 Jeremaster" will return a list with 3 indexes, "tp [1]", "RandomBlock123 [2]", and "Jeremaster [3]". For more information on lists, visit my guide on lists here.

You'll still be using If Variable to check what the inputted command is, but you'll be using different IfVar conditions, primarily If Variable: List Values Equals. From then on, all you're really doing is checking the values of each of the indexes.

Part 3: Extras

Here are a couple of important notes about commands.

• For complicated commands involving multiple players or entities, Select Object is often used in swapping between targets. For more information regarding Select Object, see here.

• The Control code block is commonly used for complicated commands in conjunction with different parts of the command in order to keep everything efficient and easily understood.

• In specific cases, Functions are used to better organize large command structures. For a detailed guide on functions, visit this link.

• As a bonus, you can also use Set Variable: Get List Length to determine how many arguments there were to make a syntax error message!

1601245541763.png

Part 4: Applications of Commands

There's a lot of things you can use commands for. Commands are used for stuff like getting to spawn, enable & disable pvp, saving & loading, teleportation, patch notes, queue systems, and even more.

1601245263953.png
 

HellishBro

Active member
Joined
Nov 11, 2022
Messages
42
Reaction score
3
also since normal messages arent readable / writable to plots, you can make it so the player have a default obfuscated chat color, then only allow them to chat via the @ command. this allows for custom chat, and the best part is outside players cant see the messages
 
Top Bottom