X Tutup
Skip to content

SCUMM: Fix MI1 storekeeper line being skipped (original script error)#6610

Merged
bluegr merged 1 commit intoscummvm:masterfrom
dwatteau:feat/scumm-monkey1-enhancement-storekeeper-cut-line
May 31, 2025
Merged

SCUMM: Fix MI1 storekeeper line being skipped (original script error)#6610
bluegr merged 1 commit intoscummvm:masterfrom
dwatteau:feat/scumm-monkey1-enhancement-storekeeper-cut-line

Conversation

@dwatteau
Copy link
Contributor

@dwatteau dwatteau commented May 12, 2025

When Guybrush needs to get a credit note from the storekeeper, he may pretend having various jobs; one of the options is him saying he's "waiting tables at the Scumm Bar".

But then, one of the storekeeper's lines was cut, because of a missing WaitForMessage() call before endCutscene(), in script 30-11.

So this PR tries to restore this missing call, looking at some Var/Bit context to be sure (script 30-11 is quite long and deals with various storekeeper interactions in Part 1, so I really want to avoid any bad side effect).

Releases I've tested:

  • EGA French
  • CD/DOS French
  • Floppy VGA/DOS English
  • Amiga English 1.2
  • Sega CD English
  • Macintosh English
  • Special Edition (the line's voiced)

Releases I've haven't tested or don't own:

  • FM-TOWNS
  • Atari
  • Amiga releases different from 1.2
  • testing all interactions with the storekeeper (not just the credit ones) to be sure nothing broke because of this change.

How to test, with the "Restore content" enhancement setting on:

  • have a nearby save, after Elaine's been kidnapped
  • OR use boot param 666, pick the fish, go at Stan's (give the fish to the troll on the way), ask for a ship and credit, go back to the storekeeper, ask for credit, say you're "waiting tables"

Fixed by LogicDeluxe in the Ultimate Talkie version, back in 2010. Yeah, I'm not telling you which line's missing, because it's quite a cool one and, if you have to figure it out yourself, it makes a new PR test ;)

@eriktorbjorn
Copy link
Member

Of course expressions like !(A && B) can be rewritten as !A || !B, but I guess that's a matter of taste. It was mainly the if (!(VAR(questionVarNo) == 121)) that gave me a bit of a start.

@dwatteau
Copy link
Contributor Author

Yeah I'm just doing if (!(expected stuff)) for each of them, where (expected stuff) come as-is from the original script. It's written this way to match the comment above it, too.

@eriktorbjorn
Copy link
Member

eriktorbjorn commented May 13, 2025

Since the workaround is in o5_endCutscene(), I think these are the interactions that primarily need to be tested:

  1. Not buying the sword. (Guybrush puts it back.)
  2. Asking for the price of the shovel (twice).
  3. Buying the shovel.
  4. Not buying the shovel. (Guybrush puts it back.)
  5. Asking about the sword master. There are several cases here:
    1. Guybrush doesn't know about the sword master. ("Well, if you're looking for a good fight...")
    2. Guybrush knows about the sword master from the pirate leaders. ("The Sword Master of Mêlée Island? Hmmm...")
    3. Guybrush has asked before. ("Look, I told you, she doesn't want to see you.")
    4. Guybrush tried to steal during the shopkeeper's absence. There are different reactions depending on how many times you tried it. The last one, just when he leaves, should be "This is really getting boring."
  6. Asking the shopkeeper for credit. ("All right. I'll get one of my notes and we'll fill it out.")
  7. Telling the shopkeeper you're a pirate. ("Foul-smelling, yes... Grog-swilling, maybe...")
  8. Telling the shopkeeper you're waiting tables. This is the one that the workaround addresses. ("...and I'm the Queen of England.")
  9. Telling the shopkeeper you work at the circus. ("You're one of the Fettucini brothers?")
  10. Telling the shopkeeper you have no job. There seems to be two different cases here:
    1. "To be honest, sir, I am not employed." (before he fetches the note)
    2. "To be honest, sir, I'm between jobs." (after he fetches the note)
  11. Buying a breath mint. ("Here take one... please. Take a whole roll!")
  12. Say you're just browsing. Prints one of several messages, picked at random:
    1. "Hey, this ain't no boutique."
    2. "Okay, but don't put your lips on anything."
    3. "Whatever."
    4. "Okay. Wake me up if you need anything."
    5. "Be my guest, fancy pants."

Did I miss any? (Telling the shopkeeper you work for Stan is not a cutscene, apparently.)

@eriktorbjorn
Copy link
Member

workaroundMonkey1StorekeeperWaitTablesLine() should probably return false if VAR(VAR_OVERRIDE) is set, because then the player has pressed Esc, trying to skip the cutscene.

Actually, that may apply to some of the other wait-for-message fixes as well?

@eriktorbjorn
Copy link
Member

eriktorbjorn commented May 15, 2025

I think I've now triggered all of the cases in my list above in the VGA CD version, without noticing any problems. The workaround was only triggered in the one case where it should, and then it worked as expected. (I had made my proposed modification but that shouldn't affect when the workaround is used.)

@dwatteau
Copy link
Contributor Author

OK thanks for the test! athrxx also worked on testing the FM-TOWNS port.

workaroundMonkey1StorekeeperWaitTablesLine() should probably return false if VAR(VAR_OVERRIDE) is set, because then the player has pressed Esc, trying to skip the cutscene.
[...]

Good point. I don't know much about this, though. I don't have a good understanding of how cutscenes and the various VAR_* stuff works, yet.

I think these are the interactions that primarily need to be tested:
[...]

I agree with the list. I've done a test on one v5 release (didn't note which one it was) with a debug line when the workaround is fully applied, and I only saw it once, so it looked good. I didn't test all actions, though.

I'm not sure I have the time/patience to test all storekeeper interactions in all releases, though. I may do a full play of the Sega CD release soon, but I think that's it. Since I doubt we'll release 2.10.0 soon, I think a good-enough number of checks/tests was done, and then if issues show up, we can wait for user reports, since Monkey1 is often played. (Hoping this approach is not too confident…)

(As for the style of the if checks, mentioned earlier, I can also change it, if others find it a bit unnatural too.)

@eriktorbjorn
Copy link
Member

I'm far from certain myself, but from what I understand VAR(VAR_OVERRIDE) is only set when you escape out of a cutscene. (Usually used by scripts to clean up, I believe, though MI1 uses it to make Cobb spout more advertising if you try to interrupt his little Loom speech.)

@eriktorbjorn
Copy link
Member

This needs to be updated now to use the new helpers, but you knew that already of course.

@dwatteau dwatteau force-pushed the feat/scumm-monkey1-enhancement-storekeeper-cut-line branch 2 times, most recently from 1faa65a to e42c82f Compare May 29, 2025 23:00
@dwatteau
Copy link
Contributor Author

Yes, sure, I've updated it.

I've also added the VAR_OVERRIDE you suggested earlier. Thanks for that; indeed it seems necessary here.

When Guybrush needs to get a credit note from the storekeeper, he may
pretend having various jobs; one of the options is him saying he's
"waiting tables at the Scumm Bar".

But then, one of the storekeeper's line was cut, because of a missing
WaitForMessage() call before endCutscene(), in script 30-11.

(Thanks to erik for reporting that VAR_OVERRIDE has to be taken care
of as well.)

Fixed by LogicDeluxe in the Ultimate Talkie version, back in 2010.
@dwatteau dwatteau force-pushed the feat/scumm-monkey1-enhancement-storekeeper-cut-line branch from e42c82f to 6ee31a3 Compare May 29, 2025 23:04
@bluegr
Copy link
Member

bluegr commented May 31, 2025

@dwatteau The older Amiga and Atari versions are quite exotic, but since every other version works, I don't see why these two won't be working.

If there aren't any objections, this looks good to be merged

@dwatteau
Copy link
Contributor Author

Thanks. Yes I thought some ScummVM users over Discord would test this on their Amiga/Atari versions, but so far it didn't happen.

I agree it should work there anyway

@bluegr
Copy link
Member

bluegr commented May 31, 2025

Thanks for your feedback. This is good to be merged. Nice work!

@bluegr bluegr merged commit b215d49 into scummvm:master May 31, 2025
8 checks passed
@dwatteau dwatteau deleted the feat/scumm-monkey1-enhancement-storekeeper-cut-line branch June 1, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup