On Sat, 25 Nov 2006 15:35:15 +0000
Stuart J Urquhart <[EMAIL PROTECTED]> wrote:

> 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.

Yep i renamed some functions to get more consistency in the ScummC
API, this is IMHO more important than using the same names as ScummVM.
Regarding these sub parameter, they are not really parameters but
functions with 16 bit opcodes. ScummVM implement them with switch()
but it can be done in other ways, in scvm i just used 2 opcode tables.

> 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)

Hmm, are you sure of the argument order ? From the ScummVM code
(script_v6.cpp:o6_saveRestoreVerbs) it seems the saveID come last
and not first.

> 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).

Again one need to somewhat group verbs together. Currently one can just
enforce the addresses (like with the inventory verbs in road), but it would
probably be better to have some construct to tell the linker that a given
group of symbol need consecutive addresses. Any suggestion for a nice
syntax to represent that is welcome.

> 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?

Not yet but i will look at that a bit too.

        Albeu

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

Reply via email to