Custom Character Dialog

Previous versions of FFX allowed mod-makers to sprinkle the players recruited customs into base cutscenes to help make them feel part of the team.
Ive extended this system (and applied it to the Strangers) to allow the customs to get in a few lines of (hopefully) appropriate dialogue as well!
Ive placed most of this code in the cshelper module, since ffx functions can't be called from cutscenes so easily.
Custom dialog appears as for builtins, with their correct name displayed in the speech box but without a talking head. Ive tried to get these to work, but ultimately can't. Since the talking head doesn't appear, its kind of nice to get the appropriate character to animate just to show who's talking, and the functions support this.

placeCustoms(max,dupe='') - ffx module

To review: the placeCustoms() command allows you to place positional markers on a base map called 'custom_1', 'custom_2' and so on. Calling
placeCustoms(max,dupe='')
will then automatically find team members from your save game and position them on these points.
The max argument should be the number of markers placed (eg 3 if you've placed markers custom_1,custom_2 and custom_3), and dupe should be a template to not reproduce (eg if a hero selected for last mission is present via the 'hero_*' markers or soem other similar device.
Temporary forms and involuntary forms will not be manifested by this system, to avoid the embarassment of seeing, say, Bruce Banner and the Hulk in the same room.
Call this from OnPostInit to make customs appear in the first cutscene of a base, or in OnBriefing to get them to appear in a mission briefing. (If the customs appear in a briefing, put it here, that way any new recruits will immediately show up if enough markers are provided.)

speakByVoiceID(voice,tag,anim='') - cshelper module

Searches for a custom character by voice ID, and if it finds one, plays the given line of dialog. If none are found, return immediately.
If an animation is provided, then the character will play this too.
This option is preferable for mods with voice acting, since the voice can be matched up to sound like the sound bite played.
speakByVoiceID always calls OnStepCB()


A couple of examples of this have been slotted inot the main FF campaign.
In the cutscene for Mission ...

speakByTrait(voice,tag,anim='') - cshelper module

Searches for a custom character by trait, and if it finds one, plays the given line of dialog. If none are found, return immediately.
If an animation is provided, then the character will play this too.
The traits are paired up with voice ID's in ffxtraits.py (or ffxtraitsS.py for mods if you wnat to override or add your own.) The contents look like this:
ffxTraits=[
('grizzled','MO','IO',),
('flippant','AN','DV','LL',),
('flirt','AL','RB','SB','GB',),
('ladiesman','ED','PN',),
('wise','ME','EV','LW','TM',),
('harshwoman','IQ','BB','SH',),
('toughguy','SC','OR','PS',),
('robot','MW','FM','MC'),
('leader','MM',),
('cooldude','BL','ED','PN',),
('cheeky','SU','TA','LL',),
('creepy','AW','PR','BD','PD',),
]
Each line is a description followed by a set of voice ID's that match that description.
For example - in a base cutscene our heroes come face to face with a new villain.
The dialog goes:
Team Leader (builtin): I knew we'd find you here, you despicable scum!
Villain (builtin): Haha ha! Try and stop me fools! You're no match for the power of my new psycho-helmet!
We can let any customs present get a word in here. A harsh female character may speak after the leader by saying: "Enough talk, Minute Man! Let's skin this pig alive, now!"
. If any custom is present with the Ice Queen, Blackbird, or Shadow voice ID they'll say this (only one - the dialog DOES NOT repeat twice if two are present), and it'll fit in reasonably well with their in-game utterances.
A cheeky youngster may say: "Hey mister! Why've you got a saucepan on your head?" after the villain displays his awesome (?) new weapon.

The scene would now look like this:
(
    "speak('minute_man','MISSPCH_MM_01_01')",
),
(
    #note - if we find a harsh lady, make her do her melee movement as well
    "speakByTrait('harshwoman','MISSPCH_HW_01_01','melee')",
),
(
    "speak('psychoman','MISSPCH_PM_01_01')",
),
(
    "speakByTrait('cheeky','MISSPCH_CH_01_01')",
),
If no appropriate customs are found to deliver these priceless gems, no problem, the scene will automatically skip these and continue. Ive found it works best to provide as much of this optional dialog as possible for silent mods to get the effect. Typically, most of it won't be seen, but it gives the player an extra feeling of inclusion for their own creations alongside the game designers.

speakByVoiceID always calls OnStepCB()

turnAllTo(target) - cshelper module

Turns all customs present to look at the target object or marker. Useful to make them look like they're not just standing around like lemons.

moveAllTo(target) - cshelper module

Moves all customs present to the target object or marker. Useful to make them look like they're, say, leaving an area with the builtin characters.