04:56 AM 27/02/2019
Yes, I made a scripting tutorial. Might not be a good one, but I hope it helps anyways,
The scripting language is Game Maker Language, if you didn't know.
In Brick-Hill, almost all scripts are defined as strings.
------------------
string = '
messageAll("this is a string, inside a string. be careful with these.");
';
execute_string(string);
------------------
First, you define the "variable" that will hold the contents of the script. Something like this would work: string = '
Then you can type out the contents of the script itself.
Finally, you close it off, with this: ';
Whenever you want to execute the script, use execute_string() and add the variable that has the script (string in this case) inside the parenthesis.
It should be noted that the string doesn't have to be in a single quote, however in my opinion its preferred.
Next, we will learn how to loop.
This can be usually achieved with the schedule(); function.
Just add this to the end of the script "string": schedule(5000,string)
Where 5000 is the amount of milliseconds until the script is executed again, and where string is the script executed. (string is an example, change it to whatever "variable" the function is in)
------------------
string = '
messageAll("this is a string, inside a string. be careful with these.");
schedule(5000,string)
';
execute_string(string);
------------------
Finally, events.
Events are a little more complicated.
There can be only one of each type in your game.
Example: you can have a onPlayerTouch event and a onGameConnection event
But you cant have more then one of these in your game, because the first event will be overwritten.
Defining them is the same, but you have to do this before the other steps:
------------------
s = define("onGameConnection")
s.script = '
------------------
Define the event itself, then the script that the event will execute.
This can also be used to create custom "functions".
Also: If you ever wanted to execute a script defined this way manually, you can do this: execute("yeetus")
Events also have arguments attached to them, but that will be covered soonTM.
Well I hope I didn't completely get all the facts wrong, see you when the sun explodes!
The scripting language is Game Maker Language, if you didn't know.
In Brick-Hill, almost all scripts are defined as strings.
------------------
string = '
messageAll("this is a string, inside a string. be careful with these.");
';
execute_string(string);
------------------
First, you define the "variable" that will hold the contents of the script. Something like this would work: string = '
Then you can type out the contents of the script itself.
Finally, you close it off, with this: ';
Whenever you want to execute the script, use execute_string() and add the variable that has the script (string in this case) inside the parenthesis.
It should be noted that the string doesn't have to be in a single quote, however in my opinion its preferred.
Next, we will learn how to loop.
This can be usually achieved with the schedule(); function.
Just add this to the end of the script "string": schedule(5000,string)
Where 5000 is the amount of milliseconds until the script is executed again, and where string is the script executed. (string is an example, change it to whatever "variable" the function is in)
------------------
string = '
messageAll("this is a string, inside a string. be careful with these.");
schedule(5000,string)
';
execute_string(string);
------------------
Finally, events.
Events are a little more complicated.
There can be only one of each type in your game.
Example: you can have a onPlayerTouch event and a onGameConnection event
But you cant have more then one of these in your game, because the first event will be overwritten.
Defining them is the same, but you have to do this before the other steps:
------------------
s = define("onGameConnection")
s.script = '
------------------
Define the event itself, then the script that the event will execute.
This can also be used to create custom "functions".
Also: If you ever wanted to execute a script defined this way manually, you can do this: execute("yeetus")
Events also have arguments attached to them, but that will be covered soonTM.
Well I hope I didn't completely get all the facts wrong, see you when the sun explodes!
05:03 AM 27/02/2019
Noice duuude.
05:08 AM 27/02/2019
nice
04:45 PM 27/02/2019
10/10 tho i got this class privately this is still pretty gucci
01:03 PM 21/03/2019
Thanks Tylor