Attribute functions

FFX V1.3 includes some useful alternatives to Object_SetAttr and Object_GetAttr.
These two commands have caused me a lot of trouble, because if an Object attribute doesn't exist for whatever reason, then a Windows messgae box pops up (often behind FF) and the game appears to freeze.

FFX_ObjectGetAttr(char,attribute) and FFX_ObjectSetAttr(char,attribute,value)

FFX_ObjectGetAttr and FFX_ObjectSetAttr work in the same way - only they're safe. If you call FFX_ObjectGetAttr before youve done the appropriate FFX_ObjectSetAttr it just returns 0.

FFX_TemplateGetAttr(char,attribute) and FFX_TemplateSetAttr(char,attribute,value)

These two work similarly, except they apply the attribute to all objects of a given template. They come in handy with Custom Command tracking, since commands can be applied to a template instead of an object by name.

Custom command helpers

These commands are useful for assigning a specific command for a character, either to all other characters or to all objects in the level. Great for dynamically spawning and removing special attack powers - the Strangers now use them for all their combo moves and other enhancements.



Adds the named command to the named character, with the specified callback function and range.
Say you want to add a command called CUSTOM_MEGABLAST for 'hero_1' to use on all dynamic objects at a given point in time, and have it call the function OnMegaBlast with a range of 30 units:
will do the trick. (And, hey, maybe OnMegaBlast calls Trigger_power with a big blast, who knows?). To remove this command in response to another event:



Maybe the special command/simulated power only really works against other characters (a mental attack?) Use the versions with Chars in the title and it will only add commands to characters.

Adding customs to base cutscenes

As custom characters become so much cooler with FFX, they should appear in your mods base scenes if you're supporting them. I've included a handy function that does just this:


If you've got a base cutscene with the whole team standing aorund, add a few markers called 'custom_1', 'custom_2' etc, and then call this in your initialisation code for the base level. max is the maximum marker number, so if you've placed three markers, then call
To place three recruited custom heroes in this scene. Note that TEMPORARY FORM characters will be spawned but then destroyed pretty quickly, to avoid the embarassment of seeing the Hulk standing next to Bruce Banner or other such mistakes.
You can also place markers called 'hero_1','hero_2' etc to spawn the team who went on your last mission. Mixing these two methods can cause embarassing duplicates: you can exclude characters of a given template by setting the optional dupe parameter. e.g.
will place up to 4 custom heroes in the scene, but avoid placing a duplicate of 'hero_1', who's in a special position having just come back from a mission.