lfnetwork.com mark read register faq members calendar

Thread: Is there a tool to read/edit Scumm-Script ?
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-20-2009, 07:07 AM   #1
Damien.fa
Lurker
 
Damien.fa's Avatar
 
Join Date: Jul 2009
Posts: 2
Question Is there a tool to read/edit Scumm-Script ?

Hello,

I'm looking for a tool which permits to read Scumm-Scripts in an understandable language (I mean "not in Hex").
Is there a tool to edit a script ? (change a var, add instructions...)

I knew "Descumm" (a ScummVM tool") and it's quite interesting but I just want to know if an editor still exists before I start to build my own ?

Thks !

Damien
Damien.fa is offline   you may: quote & reply,
Old 07-20-2009, 08:22 AM   #2
s-island
Music man
 
s-island's Avatar
 
Status: Administrator
Join Date: Sep 2003
Posts: 1,080
The International House of Mojo Staff 
One of the last Scummrev betas/alphas can decompile SCUMM scripts. You should be able to find it over at LucasHacks.
s-island is offline   you may: quote & reply,
Old 07-20-2009, 02:06 PM   #3
bgbennyboy
Festively Plump
 
bgbennyboy's Avatar
 
Status: Super Moderator
Join Date: Feb 2002
Location: England
Posts: 1,984
LFN Staff Member 
http://hibernatus34.free.fr/scumm/

bgbennyboy is offline   you may: quote & reply,
Old 07-20-2009, 07:28 PM   #4
cocomonk22
Rookie
 
Join Date: Sep 2005
Posts: 72
Use scummtr on that page.

EDIT: Sorry, thought you mean just the text. Use jestar jokin's tools.

Last edited by cocomonk22; 04-03-2010 at 11:14 PM.
cocomonk22 is offline   you may: quote & reply,
Old 07-22-2009, 02:53 AM   #5
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
I have written a tool called Scummbler that can compile scripts output from Descumm. It supports scripts from SCUMM V3, 4, and 5.

http://www.jestarjokin.net/

Manual:
http://www.jestarjokin.net/sw/scummbler_manual.html

There is also ScummC for creating new scripts for SCUMM V6.

http://alban.dotsec.net/7.html
jestar_jokin is offline   you may: quote & reply,
Old 07-22-2009, 03:55 PM   #6
bgbennyboy
Festively Plump
 
bgbennyboy's Avatar
 
Status: Super Moderator
Join Date: Feb 2002
Location: England
Posts: 1,984
LFN Staff Member 
Bloody hell, well done jestar. I've been wanting a tool to do that for years.

bgbennyboy is offline   you may: quote & reply,
Old 07-23-2009, 05:21 AM   #7
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
I tried Scummbler, but it doesn't seem to work for me. Scummpacker does, though.
I tried it with the example code from the manual, and this is what I got:
Code:
Traceback (most recent call last):
  File "F:\monkey_test\scummbler.py", line 409, in <module>
    main_selector()
  File "F:\monkey_test\scummbler.py", line 399, in main_selector
    main()
  File "F:\monkey_test\scummbler.py", line 377, in main
    compile_script(infile, SCUMM_version)
  File "F:\monkey_test\scummbler.py", line 286, in compile_script
    results = comp.compileFile(infile)
  File "F:\monkey_test\scummbler_compiler.py", line 86, in compileFile
    results = self.rootExpression.parseFile(filename)
  File "E:\Python26\lib\site-packages\pyparsing.py", line 1405, in parseFile
    return self.parseString(file_contents, parseAll)
  File "E:\Python26\lib\site-packages\pyparsing.py", line 1070, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2352, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2717, in parseImpl
    loc, tokens = self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2604, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2418, in parseImpl
    return maxMatchExp._parse( instring, loc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2352, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2461, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2336, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 945, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 2461, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "E:\Python26\lib\site-packages\pyparsing.py", line 971, in _parseNoCache
    tokens = fn( instring, tokensStart, retTokens )
  File "F:\monkey_test\scummbler_compiler.py", line 711, in do_grFunc_cutscene
    op = self.opFunctionTable[toks.function]
KeyError: 'cutscene'
Results from anything taken directly from descrumm produces similar results.
Any idea what I did wrong? I'm new to Python.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-23-2009, 07:28 AM   #8
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by LogicDeLuxe View Post
I tried Scummbler, but it doesn't seem to work for me. Scummpacker does, though.
I tried it with the example code from the manual, and this is what I got:
Code:
Traceback (most recent call last):
*snip*
Results from anything taken directly from descrumm produces similar results.
Any idea what I did wrong? I'm new to Python.
I MAY have uploaded the latest version of Scummbler without actually testing that it worked, and I MAY not have finished writing the code before I uploaded it. Then again, the moon landing MAY have been faked; we just can't be sure about these things, can we?

Anyway, you may find this more useful.

(outdated link removed, see below for new links)

Last edited by jestar_jokin; 08-03-2010 at 07:52 AM.
jestar_jokin is offline   you may: quote & reply,
Old 07-23-2009, 08:05 AM   #9
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Still doesn't work. Now, with the example code, I get:
Code:
Traceback (most recent call last):
  File "F:\monkey_test\scummbler.py", line 409, in <module>
    main_selector()
  File "F:\monkey_test\scummbler.py", line 399, in main_selector
    main()
  File "F:\monkey_test\scummbler.py", line 377, in main
    compile_script(infile, SCUMM_version)
  File "F:\monkey_test\scummbler.py", line 288, in compile_script
    header = comp.generateHeader(len(results))
  File "F:\monkey_test\scummbler_compiler.py", line 2497, in generateHeader
    objdata += to_byte(self.scriptNum)
  File "F:\monkey_test\scummbler_misc.py", line 143, in to_byte
    inval = int(inval)
ValueError: invalid literal for int() with base 10: '\xca'
I tried another script from descumm, unchanged, and scummbler says "Parsing "script.txt"..." and then just hangs.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-23-2009, 08:25 AM   #10
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by LogicDeLuxe View Post
Still doesn't work. Now, with the example code, I get:
Code:
Traceback (most recent call last):
  File "F:\monkey_test\scummbler.py", line 409, in <module>
    main_selector()
  File "F:\monkey_test\scummbler.py", line 399, in main_selector
    main()
  File "F:\monkey_test\scummbler.py", line 377, in main
    compile_script(infile, SCUMM_version)
  File "F:\monkey_test\scummbler.py", line 288, in compile_script
    header = comp.generateHeader(len(results))
  File "F:\monkey_test\scummbler_compiler.py", line 2497, in generateHeader
    objdata += to_byte(self.scriptNum)
  File "F:\monkey_test\scummbler_misc.py", line 143, in to_byte
    inval = int(inval)
ValueError: invalid literal for int() with base 10: '\xca'
I tried another script from descumm, unchanged, and scummbler says "Parsing "script.txt"..." and then just hangs.
Fixed the first problem, download again from the same location and let me know how it goes.

As for the hanging up, just let it go for a bit longer and it should finish. I have not implemented blocks very well, so it gets stupidly slow on nested "if" statements.
jestar_jokin is offline   you may: quote & reply,
Old 07-23-2009, 10:37 AM   #11
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Thanks. It works now. I can put the stump joke back.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-24-2009, 01:52 AM   #12
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
So far, I've noticed two oddities using this tool on MI1:

000_LECF\083_LFLF_cu-dock\000_ROOM\032_LSCR.dmp
Error parsing input file: Local script number must be greater than 200.

000_LECF\030_LFLF_store\000_ROOM\050_LSCR.dmp
decompiled with descumm and then compiled again with scummbler results in a different file. Using descumm on that gives an error:
ERROR: opcode 0xAB: Unhandled subop 0!


EDIT: I did some further testing:
I tried to recompile every script with ^255^3-text in it. To be sure that it is no issue with my splitline-tool, I recompiled them unchanged to see if it works.

Apparently, there are some compiler bugs as scummtr gives the following errors:
ERROR: Script error at 0x18FFDA in MONKEY.001 (Bad jump(s)) [030:LSCR#0204]
ERROR: Script error at 0x2104BA in MONKEY.001 (Bad jump(s)) [037:LSCR#0205]
ERROR: Script error at 0x210672 in MONKEY.001 (Bad jump(s)) [037:LSCR#0207]
ERROR: Script error at 0x212075 in MONKEY.001 (Bad jump(s)) [037:SCRP#0060]
ERROR: Script error at 0x223214 in MONKEY.001 (Bad jump(s)) [038:SCRP#0120]
ERROR: Script error at 0x2F0DDE in MONKEY.001 (Bad jump(s)) [053:LSCR#0217]
ERROR: Script error at 0x346456 in MONKEY.001 (Bad jump(s)) [059:SCRP#0056]

And for another minor problem:
000_LECF\030_LFLF_store\000_ROOM\049_LSCR.dmp won't compile. It gives this error: Exception: Invalid escape code: ^375
I can see the problem here. Luckily, this is not a problem with my tools, since it is solved as a side effect of this line split.

I'm using the talkie-hack without sample references.

Last edited by LogicDeLuxe; 07-24-2009 at 05:51 AM.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-24-2009, 06:58 PM   #13
cocomonk22
Rookie
 
Join Date: Sep 2005
Posts: 72
Those bad jumps occur because jumps are based on hex addresses. When you split the lines to multiple prints and waits, this corrupts some of the jumps.

Here's an example:
1. jump to this plus 1 (line 2)
2. jump to this plus 2 (line 4)
3. print
4. local[0]+=1
5. jump to this plus 2 (line 7)
6. jump to this minus 5 (line 1)
6. end

After line split (O is correct, X is incorrect):
1. jump to this plus 1 (line 2) O
2. jump to this plus 2 (line 4) X
3. print
4. wait
5. print
6. wait
7. local[0]+=1
8. jump to this plus 2(line 10) O
9. jump to this minus 5 (line 4) X
10. end

That's just a simple example. The actual change is even more since a jump might go to the wrong hex value than the start of an opcode. So to fix this you need to change all jump values based on the additional bytes added between the jumps.

Last edited by cocomonk22; 04-03-2010 at 11:10 PM.
cocomonk22 is offline   you may: quote & reply,
Old 07-24-2009, 11:30 PM   #14
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by cocomonk22 View Post
Those bad jumps occur because jumps are based on hex addresses. When you split the lines to multiple prints and waits, this corrupts some of the jumps.

*snip*

That's just a simple example. The actual change is even more since a jump might go to the wrong hex value than the start of an opcode. So to fix this you need to change all jump values based on the additional bytes added between the jumps.
This is not necessary when using version v2+ of Scummbler, it uses labels for jumps. The actual text in the label is irrelevant. This means you can insert as many instruction as you want between a jump and the jump target, and it will still behave as normal. The actual cause for these "bad jump" errors is mentioned below.

Quote:
Originally Posted by LogicDeLuxe View Post
So far, I've noticed two oddities using this tool on MI1:
I'll use the original, non-speech-hacked Monkey Island 1 CD files as reference here (not the files in MI:SE).

Quote:
000_LECF\083_LFLF_cu-dock\000_ROOM\032_LSCR.dmp
Error parsing input file: Local script number must be greater than 200.
Compiles/decompiles fine for me, the script number should be 204. Slightly different files due to descumm automatically commenting out a goto instruction. Could you upload your descummed script to http://pastebin.com/ ?

Quote:
000_LECF\030_LFLF_store\000_ROOM\050_LSCR.dmp
decompiled with descumm and then compiled again with scummbler results in a different file. Using descumm on that gives an error:
ERROR: opcode 0xAB: Unhandled subop 0!
My fault; the delayVariable opcode was being incorrectly modified to indicate that the following parameter was a variable (not a constant), which is unnecessary (delayVariable, funnily enough, only ever takes a variable).

Quote:
Apparently, there are some compiler bugs as scummtr gives the following errors:
ERROR: Script error at 0x18FFDA in MONKEY.001 (Bad jump(s)) [030:LSCR#0204]
... etc...
I had somehow entered the wrong opcode for loadRoomWithEgo. Instead, it was the opcode for "jump if class of object is" instruction, which is what causes the "bad jump" errors.

I looked at the first three scripts you listed here and they all have the "loadRoomWithEgo", so I'm assuming that's the only problem with those scripts.

Quote:
And for another minor problem:
000_LECF\030_LFLF_store\000_ROOM\049_LSCR.dmp won't compile. It gives this error: Exception: Invalid escape code: ^375
I can see the problem here. Luckily, this is not a problem with my tools, since it is solved as a side effect of this line split.
Yes, this is a problem with descumm's escape character handling. It would be nice if I implemented an alternative way of writing escape characters in Scummbler. I know you've gotten around this problem now, but a simple fix is to just put a space between the escape character digits and the dialogue text digits.

Here's the latest fixed version of Scummbler:
(link removed)

Hope it works this time

Last edited by jestar_jokin; 08-03-2010 at 07:48 AM. Reason: Removing outdated links
jestar_jokin is offline   you may: quote & reply,
Old 07-25-2009, 01:36 AM   #15
cocomonk22
Rookie
 
Join Date: Sep 2005
Posts: 72
That certainly did it! Scummtr extracts without error now.

Last edited by cocomonk22; 04-03-2010 at 11:07 PM.
cocomonk22 is offline   you may: quote & reply,
Old 07-25-2009, 01:58 AM   #16
purple_tentacle_
Junior Member
 
purple_tentacle_'s Avatar
 
Join Date: Jun 2009
Location: California, United States
Posts: 374
Quote:
Originally Posted by Damien.fa View Post
Hello,

I'm looking for a tool which permits to read Scumm-Scripts in an understandable language (I mean "not in Hex").
Is there a tool to edit a script ? (change a var, add instructions...)

I knew "Descumm" (a ScummVM tool") and it's quite interesting but I just want to know if an editor still exists before I start to build my own ?

Thks !

Damien
Ok a couple of questions from me because I am not good with script and can baraley get the whole concept of it.

What is Descumm for? and what is a Scumm Script and why would you want to edit it/make your own? Please answer. Thanks.


http://www.lucasforums.com/image.php?type=sigpic&userid=162626&dateline=12954  72528
"The Simple truth is that we've
lost control of our own borders,
and no nation can do that and survive"
-Ronald Reagan
purple_tentacle_ is offline   you may: quote & reply,
Old 07-25-2009, 03:51 AM   #17
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by purple_tentacle_ View Post
Ok a couple of questions from me because I am not good with script and can baraley get the whole concept of it.

What is Descumm for? and what is a Scumm Script and why would you want to edit it/make your own? Please answer. Thanks.
SCUMM is the scripting language used in LucasArts adventure games. In the game files, SCUMM scripts are stored in a format known as "bytecode", which is easily read by machines. descumm is a tool by the ScummVM developers to translate that bytecode into a human-readable format. Scummbler is a tool I wrote to translate that human-readable format back into bytecode.

All of the game's logic is stored in SCUMM scripts. This includes cutscenes, conversations, interactions with objects, and more technical matters like loading game resources. As for why you want to edit it or make your own? Some people just like to hack around in old games, really.
jestar_jokin is offline   you may: quote & reply,
Old 07-25-2009, 05:51 AM   #18
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Quote:
Originally Posted by jestar_jokin View Post
Compiles/decompiles fine for me, the script number should be 204.
It is with the original game data. Must be a bug with cocomonk22's patch. There it is Script# 155.

Scummbler compiles all fine with lines split with the original game data. Now I'm trying the new version with cocomonk22's patch applied.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-25-2009, 08:58 AM   #19
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by LogicDeLuxe View Post
It is with the original game data. Must be a bug with cocomonk22's patch. There it is Script# 155.

Scummbler compiles all fine with lines split with the original game data. Now I'm trying the new version with cocomonk22's patch applied.
Well, I don't want to change the check in Scummbler, since the numbering convention for SCUMM scripts is that all global scripts are from 1 to 199, all local scripts are 200-255 (I think, anyway). I'm not sure if there are conflicts when you have a local script with the same number as a global script.

If you really want, you can disable the check by commenting out lines 181 and 182 in scummbler_compiler.py, like so:

Code:
#        if int(toks.scriptnum) < 200: # will throw exception if scriptnum can't be cast to int.
#            raise ScummblerParseException("Local script number must be greater than 200.")
cocomonk22, would it be possible to change the script number & any calls to it?
jestar_jokin is offline   you may: quote & reply,
Old 07-26-2009, 04:25 PM   #20
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Yet another bug:
000_LECF\036_LFLF_mansion-e\000_ROOM\021_LSCR.dmp
gives:
Error parsing input file: Expected end of text (at char 92), (line:4, col:1)
[0009] (48) if (Local[0] == 566) {
LogicDeLuxe is offline   you may: quote & reply,
Old 07-26-2009, 08:36 PM   #21
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Quote:
Originally Posted by LogicDeLuxe View Post
Yet another bug:
000_LECF\036_LFLF_mansion-e\000_ROOM\021_LSCR.dmp
gives:
Error parsing input file: Expected end of text (at char 92), (line:4, col:1)
[0009] (48) if (Local[0] == 566) {
Perhaps, but not with Scummbler! This sort of error indicates either a syntax error in the script, or an otherwise unknown instruction. I can compile this script fine. Have you made any changes to the script, and if so, what are they?

(As an aside, this error will always point to the start of the block containing the error, rather than the offending line. This is partially because of my implementation of "if" blocks, and partially the parsing library I'm using which does not seem to have a fail-fast behaviour)
jestar_jokin is offline   you may: quote & reply,
Old 07-27-2009, 01:51 AM   #22
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Quote:
Originally Posted by jestar_jokin View Post
Have you made any changes to the script, and if so, what are they?
Yes, the file was accidentally altered. I tried again, and it works indeed.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-27-2009, 02:32 AM   #23
cocomonk22
Rookie
 
Join Date: Sep 2005
Posts: 72
Quote:
Originally Posted by jestar_jokin View Post
Well, I don't want to change the check in Scummbler, since the numbering convention for SCUMM scripts is that all global scripts are from 1 to 199, all local scripts are 200-255 (I think, anyway). I'm not sure if there are conflicts when you have a local script with the same number as a global script.

If you really want, you can disable the check by commenting out lines 181 and 182 in scummbler_compiler.py, like so:

Code:
#        if int(toks.scriptnum) < 200: # will throw exception if scriptnum can't be cast to int.
#            raise ScummblerParseException("Local script number must be greater than 200.")
cocomonk22, would it be possible to change the script number & any calls to it?
Yes, I already corrected that, it was an error on my part:
http://www.lucasforums.com/showthrea...73#post2654773

Last edited by cocomonk22; 04-03-2010 at 10:56 PM.
cocomonk22 is offline   you may: quote & reply,
Old 07-16-2010, 06:41 PM   #24
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
I've found a bug with 000_LECF_original\061_LFLF_sword-mas\001_SCRP_058.dmp

Here is the problematic excerpt of the original:
Code:
[027D] (48) } else if (Var[284] == 2) {
[0287] (80)   breakHere()
[0288] (94)   print(VAR_EGO,[Text("OK, I think I got it this time.")]);
[02AC] (AE)   WaitForMessage()
[02AE] (18)   goto 0693;
[02B1] (48) } else if (Var[284] == 3) {
[02BB] (80)   breakHere()
[02BC] (94)   print(VAR_EGO,[Text("I return, fresh from a kill!")]);
[02DD] (AE)   WaitForMessage()
[02DF] (18)   goto 0693;
[02E2] (18) } else {
[02E5] (80)   breakHere()
And this is the same section decompiled from what scummbler produces:
Code:
[027D] (48) } else if (Var[284] == 2) {
[0287] (80)   breakHere()
[0288] (94)   print(VAR_EGO,[Text("OK, I think I got it this time.")]);
[02AC] (AE)   WaitForMessage()
[02AE] (18)   goto 0693;
[02B1] (18) } else {
[02B4] (48)   if (Var[284] == 3) {
[02BB] (80)     breakHere()
[02BC] (94)     print(VAR_EGO,[Text("I return, fresh from a kill!")]);
[02DD] (AE)     WaitForMessage()
[02DF] (18)     goto 0693;
[02E2] (18)   } else {
[02E5] (80)     breakHere()
The result is, that the dialog options appear on screen, and then it goes right to "Let's get this over with.", and the fight starts. With the additional { in there, an entire block between those is erroneously skipped.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-17-2010, 05:48 AM   #25
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
I see the problem now. It is actually descumm which got confused here.
There are two "} else {" blocks in a row when the latter really just should be a "goto"-instruction prior to a "}". I can manually change this, and scummbler compiles it fine, and the game plays as ususal. When I use descumm on the recompiled script, I'll get those "} else {" blocks again.
I'll report it on the ScummVM site as well.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-30-2010, 03:18 PM   #26
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Now I found a real bug in scummbler. SetPalColor always adds a stopObjectCode() after it, which of course is not acceptable.
Fortunately, I was able to locate the problem:
In scummbler_compiler.py line 2840:
index, auxop = resolve_parameter(toks.index, auxop, 0x80, RP_WORD)
This needs to be byte instead of word.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-31-2010, 04:01 PM   #27
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
More bugs:
restoreVerbs and CursorCommand don't seem to compile.
LogicDeLuxe is offline   you may: quote & reply,
Old 07-31-2010, 10:38 PM   #28
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Could you please send me examples of the affected scripts? My address is public@jestarjokin.net
jestar_jokin is offline   you may: quote & reply,
Old 08-02-2010, 05:43 PM   #29
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
drawBox does not compile correctly. Example: 000_LECF\089_LFLF_cu-works\001_SCRP_130.dmp

restoreVerbs does not compile correctly. Example: 000_LECF\010_LFLF_logo\016_SCRP_017.dmp

And btw., the latest descumm.exe writes a lot more semicolons now which seems to confuse scummbler. It compiles fine if I just remove them all.

All examples are unmodified Monkey CD.
LogicDeLuxe is offline   you may: quote & reply,
Old 08-03-2010, 07:44 AM   #30
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
New version of Scummbler (v2 r12).
  • Fix drawBox modifying main opcode instead of auxilliary opcode.
  • Fix drawObject using wrong sub-opcode.
  • Fix saveVerbs/restoreVerbs outputting the wrong opcode.
  • Fix SetPalColor outputting a word instead of a byte for last parameter.
  • Fix the auxilliary opcode values for SetPalColor, drawBox, setRGBRoomIntensity.
  • Supports new descumm formatting, also with support for legacy descumm. Some workarounds in place since descumm's output is still a bit buggy.

(EDIT: removed, see below for latest version)


I tried testing the CursorCommand instructions, but I couldn't see any problems in the output or parsing.

Funny thing is, I submitted the patch to descumm to add all the semicolons and tidy up the code, but forgot to upload the updated Scummbler that supported it. I didn't get the descumm patch quite right, there's now semicolons in odd places, but Scummbler will support them. I'll try to get around to submitting another descumm patch.

Let me know if you find any more problems.

Last edited by jestar_jokin; 08-20-2010 at 12:36 AM.
jestar_jokin is offline   you may: quote & reply,
Old 08-03-2010, 03:31 PM   #31
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Thanks a lot for that update. Unfortunately, this gives me some new problems.

I have a bunch of old scripts I'm still editing, thus downward compatibility would be good.
I'm getting strange errors like "Error parsing input file: Duplicate label declaration on line 1: 0000 (at char 0), (line:1, col:1)" when "startScript(189,[170,5]);" doesn't have the semicolon at the end, but compiles fine with it. In my current example, this particular instruction is located in line 76, not 1.
The old version worked fine just without any semicolons at all. Couldn't you just ignore them, if present?

Similar problems occur with additional ')' characters, which the old descumm put in on some instructions. It weren't too much a hassle for me to fix in my script files, if it weren't for those cryptic error message which take me forever to figure out what's wrong.

And I noticed, the string handling changed in descumm too. Instead of those decimal '^###', there is now '\##x'. Can I still use my old scripts, or do I have to change them too?

I can't reproduce any CursorCommand problems too. I don't remember what I did. I'll post, if it occurs again.
LogicDeLuxe is offline   you may: quote & reply,
Old 08-03-2010, 07:52 PM   #32
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
There's a new command line parameter, "-l" (lowercase L) or "--legacy-descumm", which should handle scripts decompiled with old versions of descumm. It has lots of workarounds for missing parentheses, and uses karats ("^") instead of backslashes for escape characters.

If this doesn't solve your problem, let me know and I'll investigate further.
jestar_jokin is offline   you may: quote & reply,
Old 08-07-2010, 01:06 PM   #33
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Could you add "GMD " (general MIDI music) support to scummpacker? Eventhough, no official SCUMM V5 game has them, it works just fine when using GMIDI.IMS from the Sam & Max WIP demo, thus supporting them makes sense.
I'm using scummpacker for the talkie patch in order to replace some sounds with higher quality samples from the SE.
Unfortunately, scummpacker stops working as soon as the first GMD resource is reached.

I can add "GMD " to the source file and it works just fine, but I don't know how to compile it into an EXE file, which I'd like to include with my patch.
LogicDeLuxe is offline   you may: quote & reply,
Old 08-10-2010, 08:11 AM   #34
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
Here you go. I've also added "setup.py" and "setup.bat" to the source files; if you want to make your own build, just install the py2exe package for Python, and either run "setup.bat" (you'll need to edit it as appropriate), or just run "python setup.py install" from the command line.

I haven't actually tested this, so no guarantees it will work.

ScummPacker v2 r2
  • Added support for GMD sound blocks

Source:
http://www.jestarjokin.net/sw/scummp...c_20100810.zip

Win32 Binaries:
http://www.jestarjokin.net/sw/scummp...n_20100810.zip
jestar_jokin is offline   you may: quote & reply,
Old 08-20-2010, 12:36 AM   #35
jestar_jokin
Rookie
 
Join Date: Sep 2004
Posts: 39
I got sick of the unhelpful error messages you get in Scummbler, so here's a small update.

Scummbler v2 r13

* Much more accurate error reporting.
* Pyparsing library now included in the source (Iíve had to modify it in order to support better error reporting).
* Fix example script in the manual (escape codes were ď\x033″ instead of ď\x03″).

Source/Python Script

http://www.jestarjokin.net/sw/scummb...c_20100820.zip

Win32 Binaries

http://www.jestarjokin.net/sw/scummb...n_20100820.zip
jestar_jokin is offline   you may: quote & reply,
Old 08-21-2010, 05:45 AM   #36
LogicDeLuxe
Rookie
 
Join Date: Oct 2004
Posts: 215
Quote:
Originally Posted by jestar_jokin View Post
I got sick of the unhelpful error messages you get in Scummbler, so here's a small update.
Thanks. This made me find typos in no time. Very helpful improvement.
LogicDeLuxe is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Mixnmojo.com > Community Discussion Forums > SCUMM > Is there a tool to read/edit Scumm-Script ?

Tags
script scumm

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:33 AM.


LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.