Documentation for functionwrapper.py

Warning: This documentation was generated from the comments in the source code (using progrutils.documentPyFile()), with a few tweaks, under the principle that poor documentation is better than no documentation. In case of ambiguity, please refer to the code itself.

 

Built-In Function Wrapper

By Épiméthée

The wrappers allow you to add behaviours to existing functions and change variables without having to change other existing scripts (the various mods and danger rooms, for example) as you would have were you to use a normal function (i.e., with a unique name) as wrapper. This is mostly useful for FFvsTTR's built-in functions, since the source code can't be changed directly.

Feel free to change or add to the code here. Just make sure you maintain compatibility, so external modules which could be using these functions keep working. :)

IMPORTANT
- Be careful, since adding a wrapper function will change every single use of the built-in function!
- Less is more... wrapping lots of Python code around a frequently used built-in function will probably slow down the game a lot! There is a reason why the current version of the module only has a single function wrapper in it (Object_CalcPrestige()).
- Warning: If a module importing js is loaded after the mission starts, calls to the wrapped functions done within up to 10 seconds after might use the build-in version instead.


Functions

Object_CalcPrestige(object)

A wrapper for the built-in (.js module) function. This function is a good candidate for a wrapper: For one, FFX adds different elements to characters which the default Object_calcPrestige() canot take into account. More importantly, that function is rarely used and is never time-critical.

Note that the current version is provided mostly as an example and doesn't yet take into account FFX 3.2 dynamic attribute disabling/enabling, etc..