Skript Skript Tutorial Videos.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Farid

Active Member
Feb 5, 2017
179
11
18
23
So I am starting a new youtube channel with skript tutorials on it, I will be active and mostly uploading everyday, its summer for me, and I have nothing to do at the moment.

First video:


Q: Why are you making tutorials, there's bunch of videos out there.
A: Because the people who make the tutorials are not always active and stop. My summer just started and I'm basically a basement dweller, so why not help other people out.

Q: Will your channel be just for tutorials only?
A: No, I will be uploading scripting time-lapse, and such.

I'm not a huge fan of intros, and outro so I didn't include them.

Everyone be sure to give me suggestions on what I should improve on next video.

@BaeFell - Would like to hear your criticism of what I should improve, and what not.
 
Watched through it all and here are the things that need improvement (because I'm a pessimist):
1) Skript supports 1 space (I think), 2 spaces, 4 spaces and tabs for indentation.
2) You don't need to specify "to sender" or "to player" after the send effect. The effect assumes who to send it to.

What I like:
1) The comments saying what each line is seems really good.
2) Your use of showing it in-game and loading the script.
3) Good overview of commands
4) Fairly decent explanation of Skript usage
 
I didn't watch it yet but as long as you don't spare bad practices it's good for me. These bad practices are:
  • The use of single variables (the ones separated with a dot) instead of list variables (the ones separated with double colons).
  • Having variables without a prefix per script and not use non-descriptive variable names.
  • Repeat code where you could use loops.
  • The use of bad/known to be buggy features such as skQuery's format slot or Umbaska's freeze state.
  • The use of old/unsupported addons or Skript itself (let's move from the 2.1.2).
  • Code that isn't self-explanatory. For example this is a function by Pikachu:
code_language.skript:
function rpSound(s: string, p:, c: string, players, v: number = 1, pi: number = 63):
  set {_p} to new play_server_named_sound_effect packet
  set string pinfo 0 of {_p} to {_s}
  set "SoundCategory" penum 0 of {_p} to {_c}
  set float pnum 0 of {_p} to {_v}
  set int pnum 3 of {_p} to {_pi}
  loop {_p::*}:
    set int pnum 0 of {_p} to loop-value's x-loc * 8
    set int pnum 1 of {_p} to loop-value's y-loc * 8
    set int pnum 2 of {_p} to loop-value's z-loc * 8
    send loop-value packet {_p}
You wouldn't understand at all what it does or how it works at the first time you see it right? Here is my version of that function.
code_language.skript:
#Sends the specified sound to the specified players in the function via packets
#Parameters:
#{_sound} is the sound that'll be sent (need to be the minecraft sound names, can be a custom one from a resource pack). Here is a list of available sounds https://www.reddit.com/r/Onnowhere/comments/66kj9l/list_of_new_112_sounds/
#{_listeners::*} are the players that will listen the sound.
#{_category} is the category the sound will be heard from.
#{_volume} is the volume of the sound.
#{_pitch} is the pitch of the sound.
#More info about sounds at:
#http://minecraft.gamepedia.com/Commands#playsound
#Examples:
#resourcePackSound("mob.pig.say", player)
#resourcePackSound("mob.pig.say", player, "VOICE", 1, 0.1)
function resourcePackSound(sound: text, listeners: players, category: text = "MASTER", volume: number = 1, pitch: number = 63):
   
    set {_packet} to new play_server_named_sound_effect packet
    set string pinfo 0 of {_packet} to {_sound}
    set "SoundCategory" penum 0 of {_packet} to {_category}
    set float pnum 0 of {_packet} to {_volume}
    set int pnum 3 of {_packet} to {_pitch}
   
    loop {_listeners::*}:
       
        #These are the location where the sound will be heard from, they are multiplied by 8 for a reason that I don't really know but it's needed.
        set int pnum 0 of {_packet} to loop-value's x-coordinate * 8
        set int pnum 1 of {_packet} to loop-value's y-coordinate * 8
        set int pnum 2 of {_packet} to loop-value's z-coordinate * 8
       
        send packet {_packet} to loop-player

Well, my version of it is way explained but you get the point. Proper spacing and names for whatever you use let's you have an organized and understandable code.
 
I didn't watch it yet but as long as you don't spare bad practices it's good for me. These bad practices are:
  • The use of single variables (the ones separated with a dot) instead of list variables (the ones separated with double colons).
  • Having variables without a prefix per script and not use non-descriptive variable names.
  • Repeat code where you could use loops.
  • The use of bad/known to be buggy features such as skQuery's format slot or Umbaska's freeze state.
  • The use of old/unsupported addons or Skript itself (let's move from the 2.1.2).
  • Code that isn't self-explanatory. For example this is a function by Pikachu:
code_language.skript:
function rpSound(s: string, p:, c: string, players, v: number = 1, pi: number = 63):
  set {_p} to new play_server_named_sound_effect packet
  set string pinfo 0 of {_p} to {_s}
  set "SoundCategory" penum 0 of {_p} to {_c}
  set float pnum 0 of {_p} to {_v}
  set int pnum 3 of {_p} to {_pi}
  loop {_p::*}:
    set int pnum 0 of {_p} to loop-value's x-loc * 8
    set int pnum 1 of {_p} to loop-value's y-loc * 8
    set int pnum 2 of {_p} to loop-value's z-loc * 8
    send loop-value packet {_p}
You wouldn't understand at all what it does or how it works at the first time you see it right? Here is my version of that function.
code_language.skript:
#Sends the specified sound to the specified players in the function via packets
#Parameters:
#{_sound} is the sound that'll be sent (need to be the minecraft sound names, can be a custom one from a resource pack). Here is a list of available sounds https://www.reddit.com/r/Onnowhere/comments/66kj9l/list_of_new_112_sounds/
#{_listeners::*} are the players that will listen the sound.
#{_category} is the category the sound will be heard from.
#{_volume} is the volume of the sound.
#{_pitch} is the pitch of the sound.
#More info about sounds at:
#http://minecraft.gamepedia.com/Commands#playsound
#Examples:
#resourcePackSound("mob.pig.say", player)
#resourcePackSound("mob.pig.say", player, "VOICE", 1, 0.1)
function resourcePackSound(sound: text, listeners: players, category: text = "MASTER", volume: number = 1, pitch: number = 63):
  
    set {_packet} to new play_server_named_sound_effect packet
    set string pinfo 0 of {_packet} to {_sound}
    set "SoundCategory" penum 0 of {_packet} to {_category}
    set float pnum 0 of {_packet} to {_volume}
    set int pnum 3 of {_packet} to {_pitch}
  
    loop {_listeners::*}:
      
        #These are the location where the sound will be heard from, they are multiplied by 8 for a reason that I don't really know but it's needed.
        set int pnum 0 of {_packet} to loop-value's x-coordinate * 8
        set int pnum 1 of {_packet} to loop-value's y-coordinate * 8
        set int pnum 2 of {_packet} to loop-value's z-coordinate * 8
      
        send packet {_packet} to loop-player

Well, my version of it is way explained but you get the point. Proper spacing and names for whatever you use let's you have an organized and understandable code.

I try my best to let my viewer understand the code line, and yeah that's for giving me a few tips.
 
Watched through it all and here are the things that need improvement (because I'm a pessimist):
1) Skript supports 1 space (I think), 2 spaces, 4 spaces and tabs for indentation.
2) You don't need to specify "to sender" or "to player" after the send effect. The effect assumes who to send it to.

What I like:
1) The comments saying what each line is seems really good.
2) Your use of showing it in-game and loading the script.
3) Good overview of commands
4) Fairly decent explanation of Skript usage
Skript actually isn't picky about indents, you can use pretty much any amount of tabs or spaces as long as you don't mix the two and they are consistent within the current trigger