Hey again,

I was asking Alban the other day how conversations were handled in SCUMM. Sadly though, he hadn't investigated this area very much, so naturally i decided to do a little digging myself.

Firstly, i got a bit confused since the function names in SCUMMVM often have different names compared to SCUMMC. Add to that the fact that a lot of the opcodes have sub parameters which are exposed as separate functions in SCUMMC, which led me off track a bit.

A crucial element of conversations seems to be the saveRestoreVerbs op-code, which is exposed as three functions in SCUMMC:

saveVerbs(saveID, start, end)
   Sets saveid for each verb from start -> end, where saveid == 0
restoreVerbs(saveID, start, end)
Sets saveid to 0 for each verb from start -> end, where saveid == saveID. Any verbs where saveid is already 0 are killed.
deleteVerbs(saveID, start, end)
   Kills verbs from start -> end where saveid == saveID.

(Note that in all cases, start and end are indexes in the verb list)

This function is called a few times before and after conversations. I haven't seen it being called during conversations, so i can only assume that all the conversation items must be plonked on all at once.

How does this work in a conversation? well its rather simple.

To start off with, you'll want to remove all the verbs on the screen, which can be done in the road demo by calling :
   saveVerbs(1, SntcLine, Pull);
(I assumed SntcLine was the first verb, and Pull was the last. This should of course be changed if this is not the case).

This has the effect in scummvm of making all the verbs disappear. Next it would be a good idea to plonk all your conversation item verbs on and set their values. I'm not quite familiar with scumm script yet, so I'll let you figure that part out. You might be able to make additional use of saveVerbs() / restoreVerbs() if you have the conversation item verbs stowed away elsewhere, though then again that might be a bad idea memory-wise.

Finally, after you have ended the conversation, you'll want to restore all of the verbs you had before you entered the conversation. This can be done in the demo by calling:

restoreVerbs(1, SntcLine, Pull);

This will resore all the verbs with saveid 1, which of course is the saveid of the verbs you hid before the conversation. It will also have the added effect of killing any verbs you have added since the call to saveVerbs(), which would fit in nicely if they were all conversation options.

I think that just about covers the theory. I also came across some "blast text" stuff, which seems to be used to v8 games, but then again we're dealing with v6 here :)

Anyone got anything to add?

- SJU

_______________________________________________
ScummC-general mailing list
[EMAIL PROTECTED]
https://mail.gna.org/listinfo/scummc-general

Reply via email to