News:

Rings of Reznor!

Main Menu

EZScript question

Started by apfarmakis, December 15, 2011, 08:16:15 AM

Previous topic - Next topic

apfarmakis

I've got 3 encounters which generate a random squad (each encounter providing 4 possible heroes for a total of twelve possible heroes) to backup the hero on a mission. How can I generate dialogue between the hero and the reinforcements?

I tried naming each potential reinforcement and then tried the following but the dialogue ended up being spoken by the non-random character:

Banter Cutscene:
Villain says, "The Dark Circle will triumph!"
Hero says, if Hero is supergirl says, "They're not getting past me!"
if Hero is mon-el, "Hold the line!"
"We've got them on the run!"

Banter Cutscene:
Villain says, "You will die, UP lapdogs!"
Hero says, if Hero is cosmic boy says, "Keep it up, people!"
if Hero is element lad, "We're making a dent in their ranks!"
"Hold on, gang!"

Banter Cutscene:
Villain says, "You children cannot defeat the Dark Circle!"
Hero says, if Hero is dream girl says, "We will win this day!"
if Hero is phantom girl, "We will beat you!"
"Keep fighting!"

I also tried numbering the Heroes (e.g. Hero2 says...) but, for some reason, the same randomly-generated character would say all the lines.

Any help would be appreciated.
Like an eye that sees but cannot see itself,
Like a sword that cuts but cannot cut itself.

BentonGrey

Howdy Apfarmakis, unfortunately, the random dialog is pretty much the one problem M25 didn't manage to solve before he disappeared.  Basically, numbering the heroes just means that WHOEVER is in the slot you specify will say the line, but the thing is, there is no way to guarantee a certain character will be in a certain slot.  That organization is random.  Identifying the hero in the if then statements doesn't work either.  M was working on that for me just before he disappeared, and it remains imperfect.  What I've discovered is that a combination of naming and numbering produces decent results, but it isn't a perfect solution.  Basically, use the same formula you've got, but add numbered heroes as well:

Hero2 says, if Hero2 is supergirl, "They're not getting past me!"
if Hero2 is mon-el, "Hold the line!"
"We've got them on the run!"

(By the way, I'm surprised the hyphen in Mon-el's name isn't causing you problems.)
So, this way if Mon-el or Supergirl happen to be in the second slot, they'll say the line.  It means that you're likely to get generic responses more often, but at least there is a chance of the right character saying the right lines.

If there's one request I've got for the few veteran scripters we've got left, it's that they would figure out a better way for this to work.
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/

apfarmakis

Thanks for the quick response Bent. I figured as much from what was happening that this was the case but I wasn't completely sure. It's too bad that the random dialogue doesn't work.

Do you think that, instead of naming the heroes by using their code names (e.g. supergirl), it would work if I actually named them Hero2, Hero3, etc.?
Like an eye that sees but cannot see itself,
Like a sword that cuts but cannot cut itself.

BentonGrey

No problem Apfarmakis, but I'm not entirely sure what you mean.  The only thing that I've found to work is what I described, a combination of Heor# and heroname.
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/

apfarmakis

Don't worry about it Bent, it was just an errant synapse firing.

If I were to use Hero instead of Hero1, Hero2, etc., do you happen to know what the result would be? Would it possibly give one of the four characters in the squad the line to speak at random or would it default to the character you have taken into the Rumble Room?
Like an eye that sees but cannot see itself,
Like a sword that cuts but cannot cut itself.

BentonGrey

In my experience it doesn't work.  It will just have one character speak all of the lines.  In the JLA mission I put together with this construct, I required Martian Manhunter and let the player choose the other members of his or her squad.  In that case, MM said every line.
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/

apfarmakis

Thanks again, Bent. I've got another issue that I can't seem to find a solution for. I've set up my first and second mission, tested them in Rumble Room and they work find.

Unfortunately, when I set them up in the campaign, the first mission (just a cutscene and recruit encounter) plays well but the base screen for mission two is completely black. What's up with that?
Like an eye that sees but cannot see itself,
Like a sword that cuts but cannot cut itself.

BentonGrey

No problem man, I'm always happy to help beginning EZScripters!  We don't have nearly enough modders these days. 

As for your question, well, it could be a host of things.  Base scenes are the bane of my existence.  Why don't you post your script so I can give it the once-over.  If I had to guess, I'd say you've probably forgotten an unfade, camera on, are referencing a character who isn't there, or something like that.
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/

apfarmakis

Thanks yet again Benton. Right before you posted, I discovered that I had failed to put in an unfade command at the beginning of the base.

One issue I stumbled onto was that the base.py and mission.py files also needed m25minimod.OnPostInit(campaign=1, base=1) and m25minimod.OnPostInit(campaign=1) respectively. If I used m25minimod.OnPostInit(campaign=1) in the base.py, it would skip the base completely and move onto the mission?
Like an eye that sees but cannot see itself,
Like a sword that cuts but cannot cut itself.

BentonGrey

Haha, you're getting into the under-the-hood stuff that I don't really understand, Apfarmakis.  I'm afraid I'm not sure, but that sounds about right.

I'm glad the issue with your base screen was something simple like that!
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/