20,099
edits
m (correct link for "fork") |
m (removed __NOTOC__ directive) |
||
| Line 1: | Line 1: | ||
'''global''' is a sort of secret subfolder of [[IGMD|IGMD]]; a regular installation of Oni doesn't have it at all. But if you create it manually, you'll find it can serve a very special purpose: functions in the '''global''' folder can be called from every one of Oni's levels. This can be used to set up "macros" which you can call from the [[Developer Mode]] console. Some extended applications are considered below. | '''global''' is a sort of secret subfolder of [[IGMD|IGMD]]; a regular installation of Oni doesn't have it at all. But if you create it manually, you'll find it can serve a very special purpose: functions in the '''global''' folder can be called from every one of Oni's levels. This can be used to set up "macros" which you can call from the [[Developer Mode]] console. Some extended applications are considered below. | ||
==Code reuse== | ==Code reuse== | ||
One obvious use for this feature is that when writing a script that affects multiple levels, you can place common BSL functions in '''global''' instead of duplicating that code in each level's BSL files. However, you are still going to have to modify each level's BSL to ''call'' this global function if you want it to run automatically. | One obvious use for this feature is that when writing a script that affects multiple levels, you can place common BSL functions in '''global''' instead of duplicating that code in each level's BSL files. However, you are still going to have to modify each level's BSL to ''call'' this global function if you want it to run automatically. | ||