This section covers the basics to programming in the scripting language
This section covers the basics to programming including how to make your own hello world script, different data types, functions, parameters, and operators.
What is a datatype? DataTypes are
different kinds of values such as: NUMBER, STRING, BOOLEAN(true/false).
What are Variables? Variables are
Name placeholders for DataTypes.
What is a LOCAL Variable? These variables are LOCAL to the block. Check the example to learn more!
What is a GLOBAL Variable (use these if you are new to scripting)? These variables are GLOBAL to every block. Check example to learn more!
What is a Block? A block is
a chunk of scripting code grouped together. (Starts and Ends with {}).
Scripts are executed one Statement at a time. A Statement is either
a Value Assignment, Control Structure or Command. What is a value assignment? a Value Assignment is
when a Variable is given a value. A Control Structure is either
an If-Statement, While-Loop, Switch-Statement, ForEach-Loop, or For-Loop. Loops are Control Structures that repeat the code within their block until their conditional statement is false. A Command is
a word that represents some kind of functionality in game.
Coding on your own: Now I want to see you create a script on your own. This script is supposed to output the words 'Hello World' onto screen (in any fashion).
Coding on your own: Expand this script to heal the player and tell the user that they have been healed.
Code:
//Check https://community.bistudio.com/wiki/setDamage for setDamage info
player setDamage 1;
Coding on your own: Make the player fly into the sky and notify the users that they are now a rocket ship.