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

Thorough Guide to Functions

RDM

Member
Overlord
Joined
Sep 6, 2020
Messages
36
Reaction score
22
Hi y'all. Functions are an important part of DiamondFire. They're one of the most important features, and an integral part of larger, more complicated code constructions. This is my thorough guide to using and applying them, including some useful applications of them.

Part 1: How to use and apply Functions

Functions work in two parts: Call Function, and the Function itself. The code logic behind is very simple. You are calling your function, basically a "warp" over to your function, then as soon as the function is read, it returns to the original line of code (the exact place it was called). Function usage is further explained through the images in part 2.

You can also name functions to stay organized by right clicking the Function with the name of your function first, then right clicking your Call Function last. You can also change the icon of your function by putting the item you want to use in the Function chest for extra organization.

1599926907218.png
1599926971456.png
1599928064422.png

Part 2: Applications of Functions

* Basic use of Functions: Continuing lines after you run out of space

1599928113731.png


* Funneling multiple lines into one function to save large (or short) amounts of time

1599928717784.png

* One long "main" line with "pocket warps" for different sections of the line

1599929563383.png

Note:
Functions are not async, so the main line will be read up until it hits a function, then read the function. It will not read both lines at the same time, no matter what. It will always read the function first before continuing, no matter what. For asynchronous code and Processes, see here.

1599930264088.png
 
Last edited:

RDM

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

non-dark theme friendly. Don't set back to black, just remove color (bottom right option in text color)
Also, use more dark-friendly colors (Brighter colors that still stand out in light mode)

Changed. Do the images show up with a white background or is it transparent (so it'd be dark for you)? I can change the images if it isn't readable.
 

Prox

Moderator
Moderator
Joined
Sep 9, 2020
Messages
384
Reaction score
30
@Prox
Changed. Do the images show up with a white background or is it transparent (so it'd be dark for you)? I can change the images if it isn't readable.
Backgrounds are white for images. They're readable.
 
  • Like
Reactions: RDM

grobulae

Moderator
Moderator
Joined
Sep 6, 2020
Messages
127
Reaction score
26
"kit selection"
jesus christ

wonderful tutorial
 

Wobber

Forum adept
Overlord
Joined
Sep 6, 2020
Messages
1,515
Reaction score
103
i think this might be the first tutorial that i actually learned something from, thx
 
  • Like
Reactions: RDM

Prox

Moderator
Moderator
Joined
Sep 9, 2020
Messages
384
Reaction score
30
i think this might be the first tutorial that i actually learned something from, thx
Even if you counted support sessions as tutorials, this would probably be true. I seriously can't tell if people really understand what I'm doing in these sessions or if they're saying yes to sound "smart"
 

Wobber

Forum adept
Overlord
Joined
Sep 6, 2020
Messages
1,515
Reaction score
103
actually i think i should of said i FELT like i learned something, many other tutorials have helped me, but this one feels like different in a good way.
 
  • Like
Reactions: RDM
Top Bottom