If you make changes to StdLib, please document them here. Please be patient while I document what each of these features and changes does.
Listing:
- Global Properties:
- Global Procs:
- Math
- Strings
- Types
- Directions
- Keyboard
- Math
- Datums:
- Overrides:
This is a global level definition that should be set in your project prior to the inclusion of StdLib. If you do not have this define set, StdLib will assume that your FPS is 25. To define this, simply include this line before the #include line for StdLib:
#define FPS 40
You will want to make certain that you use the FPS that your world is actually running at.
TICK_LAG
This is a global level definition that should be set in your project prior to the inclusion of StdLib. If you do not define this value, that is okay so long as FPS is defined. TICK_LAG defaults to 10/FPS. This is the amount of time in 1/10th seconds that each frame takes.
The reason that this is included is so that code from your project can be much more modular and the project's tick_lag value can be changed quickly and easily without interrupting development.
If your project depends on world.tick_lag changing dynamically during runtime, don't use this value.
TILE_WIDTH
This is a global level definition that should be set in your project prior to the inclusion of StdLib. If you do not define this value, StdLib will warn you that it is not set and set it to 32 by default.
The reason that this exists is so that your project's code can be more modular and changing the icon size on the map requires much less work from the developer.
TILE_HEIGHT
This is a global level definition that should be set in your project prior to the inclusion of StdLib. If you do not define this value, StdLib will warn you that it is not set and set it to 32 by default.
The reason that this exists is so that your project's code can be more modular and changing the icon size on the map requires much less work from the developer.
STDLIB
This will be set to 1 if StdLib has been included in your project. If you wish to make an addon to StdLib, you can check if StdLib has been included already by checking this value using preprocessors.
You can use this to warn users about load-order conflicts or dependency on StdLib.
STDLIB_NOWARN
STDLIB_NOWARN can be set to 1 prior to the inclusion of STDLIB to remove warnings from undefined global macros. This should probably be avoided.
STDLIB_KEYS
STDLIB_KEYS can be set to 1 prior to the inclusion of StdLib to enable the inclusion of the built-in Keyboard Module packaged with StdLib. This may be removed in the future in favor of the Key and Mouse module being packaged as separate addons to StdLib.
STDLIB_MOUSE
STDLIB_MOUSE can be set to 1 prior to the inclusion of StdLib to enable the inclusion of the built-in Mouse Module packaged with StdLib. This may be removed in the future in favor of the Key and Mouse module being packaged as separate addons to StdLib.
void
Void is a global variable that is simply a datum that is initialized at world startup. This variable is intended to imply "nothing" in situations where non-null and null values are both meaningful. For instance, let's say you have a loop that needs to wait for the return value of a function. If that function returns null, which may actually be a proper value, the loop will never know that the function has returned. There is no way around this problem if you use numbers or strings that don't incur extra processing and limits on what can be returned. Since void is a specific instance of a normal datum, it can be assumed that any use of void should always be interpreted as "nothing". Therefore, void is a safe value to use in place of null where null is also considered a value.