BSL:Manual: Difference between revisions

m
Line 374: Line 374:


===Built-in vs. script-defined===
===Built-in vs. script-defined===
There are two classes of functions: user-defined and built-in.
There are two classes of functions: script-defined and built-in.


====Built-in====
====Built-in====
Built-in functions are hardcoded into Oni, that is, they were written in C along with the rest of the engine rather than being written in BSL, so you cannot inspect their code. Built-in functions are available to be called from BSL at all times, and are listed [[BSL:Reference|here]]. Guidance on how to use them is found in the [[:Category:Scripting tasks|Scripting tasks]] category. You manually call from the developer console any built-in function.
Built-in functions such as "ai2_allpassive" are hardcoded into Oni, that is, they were defined in C along with the rest of the engine code and then registered as accessible to BSL scripts, so you will not find their code in any game script -- only calls made to them. Built-in functions are listed on [[BSL:Reference]]. Guidance on how to use them is found in the [[:Category:Scripting tasks|Scripting tasks]] category. You can manually call from the developer console any built-in function.


====Script-defined====
====Script-defined====