Please login or register.

Login with username, password and session length
 

News:

Happy 2021 !!!


Author Topic: Scripter Call: Mod Scripting Request  (Read 1521 times)

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16493
    • The Greylands
Scripter Call: Mod Scripting Request
« on: February 17, 2016, 03:50:19 AM »
Howdy gents, for years I've struggled with the limitations of EZScript when it comes to non-required characters and dialog.  I wonder if anyone would be willing to look at M25's code and try to find a way to create a better solution.

At the moment, modders CAN create custom dialog for possible characters, but they have to use Hero1, Hero2, Hero3, etc, and the dialog is tied to the Hero# rather than the character identity.  In other words, we have to do this:

Hero3 says, if Hero3 is flash, "Well, let's get to it then!"
if Hero3 is superman, "Let's see how these things hold up to some heat vision!"
"Let's go!"

What I'd like si the ability to just say:

Hero says, if Hero is flash, "Well, let's get to it then!"
if Hero is superman, "Let's see how these things hold up to some heat vision!"
"Let's go!"

I'd like for EZscript to find the character, whichever Hero# he is, and go to the default with a random hero if it can't locate him/her. 

I know this must be difficult because M25 himself didn't do it, but this would give modders an extremely versatile and powerful tool for creating better playing experiences.  I know we don't have many scripters still left around, but I also know there are a few.  If you see this, please give it a try!
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16493
    • The Greylands
Re: Scripter Call: Mod Scripting Request
« Reply #1 on: July 11, 2016, 02:36:14 AM »
Bump.  Anyone out there willing to tackle this?
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16493
    • The Greylands
Re: Scripter Call: Mod Scripting Request
« Reply #2 on: July 26, 2016, 06:03:44 PM »
Okay, I think I figured out how to do this!  I just need someone who knows some scripting, since I know none.  Digging through the mod docs, I discovered that there is a scripting function that looks for a character in the mission by their voice IDs and plays a given line of dialog if they are found.  This means there is, under the hood, a way to tie custom dialog specifically to a character, provided all characters have unique voice IDs.  That should be easy enough to do on my end, and it should allow a new EZScript function to be written to take advantage of it...at least as far as I understand it.  There's also a way to do this by trait, which could be really cool when combined with AI subtypes.  Is there anyone out there who could tackle this?

Here's the page from the manual:

Spoiler: ShowHide
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.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/

Offline BentonGrey

  • Titans
  • Hero Member
  • Posts: 16493
    • The Greylands
Re: Scripter Call: Mod Scripting Request
« Reply #3 on: May 09, 2018, 04:28:00 AM »
Bump.
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/