Author Topic: SCI Companion V3 - alpha build notes/bugs/feature requests  (Read 619176 times)

0 Members and 5 Guests are viewing this topic.

Offline troflip

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #675 on: May 24, 2016, 06:16:59 PM »
Yeah, Sierra used that a lot to check ranges.

Code: [Select]
(if (< 5 (ego x?) 20)
    (Prints "Ego x is between 5 and 20")
)

It's one of the few places that uses the pprev register, and the decompiler doesn't handle that properly (and it's not trivial to fix).


http://scicompanion.com/Documentation/Compiler/relationaloperators.html
« Last Edit: May 24, 2016, 08:42:41 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lskovlun

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #676 on: May 25, 2016, 06:25:15 AM »
wait what

I can understand (+ 1 2 3) and such but <?
Code: [Select]
if 2 < a and a < 5 then ....
becpmes
Code: [Select]
(if (< 2 a 5) ...)

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #677 on: May 25, 2016, 03:07:48 PM »
Reminds me of Python's chained comparisons: if (a < b < c) ...
« Last Edit: May 25, 2016, 07:03:12 PM by OmerMor »

Offline lskovlun

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #678 on: May 25, 2016, 06:02:47 PM »
Reminds of Python's chained comparisons: if (a < b < c) ...
Python has that? *goes to test* ... hm, sure does. I learned something new there.

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #679 on: May 25, 2016, 06:25:31 PM »
I am intrigued.

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #680 on: May 25, 2016, 07:04:24 PM »
Reminds of Python's chained comparisons: if (a < b < c) ...
Python has that? *goes to test* ... hm, sure does. I learned something new there.

Yeah, I was shocked the first time I learned that. Now I wish every other language had that as well...  ::)

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #681 on: June 01, 2016, 03:17:48 PM »
Minor bug:
When decompiling both "old" and "new" versions of KQ4-SCI (1.000.111 / 1.006.004), script #120, I noticed that the old version sometimes confuse properties with methods, and call class methods with getter notation '?'.
For example, in introSc::changeState()

Old:
Code: [Select]
      (addToPics dispose?)

New:
Code: [Select]
      (addToPics dispose:)

Their disassembly is the same:
Code: [Select]
      pushi    #dispose
      pushi    0
      lag      addToPics
      send     4

the dispose method is declared in the Collect class, and is decompiled correctly in both versions.
This behavior is not consistent: sometimes method are called correctly with the ':' notation:
Code: [Select]
(hatActor hide: stopUpd:)
I am using the Sierra Script flavor in both games.

Offline troflip

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #682 on: June 01, 2016, 04:44:03 PM »
Well it doesn't really matter from the compiler's view point, as you know. But it's still weird that this is happening.

I'm confused by what you're saying is inconsistent... are you saying that the same method (dispose) is being output with both ? and : notation within the same version of a game?

The logic should be that a ':' is used when there are more than zero parameters passed, or when a method of that selector name is implemented on any object in the game and never used as a property on any object in the game. Given that dispose() is almost certainly a method on some objects in any version of KQ4, it should always be output with ':' notation. So it looks like I have a bug somewhere.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #683 on: June 01, 2016, 05:46:09 PM »
are you saying that the same method (dispose) is being output with both ? and : notation within the same version of a game?

Yes. Even for the same objects:

Room29.sc:
Code: [Select]
(if (timers contains: local4) (local4 dispose?))
Room3.sc:
Code: [Select]
(if (timers contains: local5) (local5 dispose: delete:))
Both scripts from version 1.000.111.




Offline troflip

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #684 on: June 01, 2016, 08:50:50 PM »
Ok, so the early KQ4 uses a slightly different script resource format. I'm surprised it even decompiles :-). At any rate, my code that attempts to discern props vs methods doesn't read the selectors properly.

I actually doubt anything will compile successfully unless I do more work to make that happen. I could at least put up a warning or something saying compiling to this version of SCI isn't supported.

Although it might not be too much work to support it...

fyi, SV.exe doesn't even show KQ4 scripts...
« Last Edit: June 01, 2016, 10:37:16 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline OmerMor

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #685 on: June 02, 2016, 04:46:25 AM »
fyi, SV.exe doesn't even show KQ4 scripts...

Yes, I know - I assumed you had special treatment for early KQ4, and it was related to the bug.

Just wanted to repeat that this is a very minor bug - so don't bother too much with it. I just wanted to let you know.

Offline Collector

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #686 on: June 02, 2016, 01:41:19 PM »
That is only with the earlier versions of the game. SV does see the scripts in later versions. I do not have all versions, but I suspect that it does from 1.003.006 on. SV does not see the scripts in the earlier versions 1.000.106 and 1.000.111. They also do not support patch files. 1.000.111 seems to be one of the more commonly available, so I assume that is the version that Phil has.
KQII Remake Pic

Offline troflip

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #687 on: June 02, 2016, 03:43:59 PM »
Correct, 1.000.111 is the KQ4 I have.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lskovlun

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #688 on: June 02, 2016, 04:02:37 PM »
There is one very old version of LSL2 that uses the old script format as well.

Offline Kawa

Re: SCI Companion V3 - alpha build notes/bugs/feature requests
« Reply #689 on: June 02, 2016, 04:41:12 PM »
I can see the scripts in SV's list, but I can't actually see the disassemblies. So I guess I have those KQ4 and LSL2 versions.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.068 seconds with 22 queries.