Author Topic: SCI01 Template Game  (Read 44480 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: SCI01 Template Game
« Reply #15 on: November 30, 2018, 07:45:27 AM »
:O
Brass Lantern Prop Competition

Offline Kawa

Re: SCI01 Template Game
« Reply #16 on: December 03, 2018, 06:39:05 PM »
Y'know what? I think the one thing better than a VGA SCI01 template to make parser-based VGA games in is one that's based on SCI11, considering the different levels of support in SCI Companion and certain runtime stability issues I've noticed when I first hacked The Seasoned Professional.

There's a folder in SCI16-master named NL. It is clearly parser code, but I have little to no clue how to integrate it into SCI11. I could study it a whole bunch and give it my best shot, of course.

The other option depends on the availability of SCI01 source code. After all, if it's already integrated into the one engine, it'd be almost trivial to get it in the other. Okay, maybe not that trivial, but certainly compared to figuring out the NL folder, I'd bet.


Offline lskovlun

Re: SCI01 Template Game
« Reply #17 on: December 04, 2018, 05:44:44 AM »
You're gonna have at least one problem: Where to place the said strings. Remember, the script format was redesigned in SCI1.1; you could place them with the strings and hope that nothing else breaks, but I'm not sure about that.

Offline Kawa

Re: SCI01 Template Game
« Reply #18 on: December 04, 2018, 10:05:30 AM »
You're gonna have at least one problem: Where to place the said strings. Remember, the script format was redesigned in SCI1.1; you could place them with the strings and hope that nothing else breaks, but I'm not sure about that.
... fffffffuuuu-


I ain't even mad.

Offline OmerMor

Re: SCI01 Template Game
« Reply #19 on: December 04, 2018, 04:30:02 PM »
The other option depends on the availability of SCI01 source code.

Unfortunately I have not managed to get SCI interpreter source earlier than SCI16.

Offline EricOakford

Re: SCI01 Template Game
« Reply #20 on: December 17, 2018, 09:23:20 PM »
I've completed the death handler! Here is the procedure. None of that "Order a Hintbook" nonsense, and all of the Sierra Script.

Code: [Select]
(procedure (Die message &tmp buttonPressed)
;This procedure handles when Ego dies. It closely matches that of QFG1EGA.
;To use it: "(Die {death message})". You can add a title and icon in the same way as a normal Print message.
(LockEgo)
(curRoom setScript: 0)
(Wait 100)
(SFX stop:)
(music number: deathSound play:)
(repeat
(= buttonPressed
(Print message
#button {Restore} 1
#button {Restart} 2
#button {__Quit__} 3
&rest
)
)
(switch buttonPressed
(1
(if (!= (theGame restore:) 0) (return))
)
(2 (theGame restart:) (return))
(3 (= quit TRUE) (return))
)
)
)
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline lskovlun

Re: SCI01 Template Game
« Reply #21 on: December 17, 2018, 10:20:10 PM »
You'll probably want to change the code so it accepts far strings at least, or maybe both. Having to put death messages on the heap could become a memory drain if you plan on having as many deaths as usual in a Sierra game  :)

Offline Kawa

Re: SCI01 Template Game
« Reply #22 on: December 18, 2018, 05:53:59 AM »
It's that repeat statement that messes up so many functions, isn't it?

Offline lskovlun

Re: SCI01 Template Game
« Reply #23 on: December 18, 2018, 06:23:28 AM »
It was at one point. I'm not sure whether it still is.

Offline Kawa

Re: SCI01 Template Game
« Reply #24 on: December 18, 2018, 07:15:26 AM »
One way to find out.

*decompiles QFG1 script 0*
Code: [Select]
Decompiling script 0
WARNING:  ::proc0_1: Analyzing control flow: Expected node with two successors (then/else): 1 at 1121
Falling back to disassembly for proc0_1
WARNING:  ::proc0_31: Analyzing control flow: Inconsistent then/else branches. Possible "continue" statement?: 1 at 1835
Falling back to disassembly for proc0_31
Generated c:\users\kawa\documents\scicompanion\quest for glory 1 ega\src\Main.sc
Decompiled 60 of 62 functions successfully (96%).
Overall bytecount success rate: 95%.
Fell back to assembly for the remaining functions.
And blam.
Code: [Select]
(procedure (proc0_1 param1)
(asm
pushi    0
call     proc0_5,  0
pushi    1
pushi    100
callk    Wait,  2
pushi    #setCursor
pushi    2
lsg      global20
pushi    1
lag      gGame
send     8
pushi    #eachElementDo
pushi    1
pushi    132
lag      gSounds
send     6
lag      global325
bnt      code_10da
pushi    #number
pushi    1
push   
pushi    63
pushi    1
pushi    15
pushi    87
pushi    0
pushi    42
pushi    0
lofsa    music
send     20
code_10da:
pushi    11
&rest    param1
pushi    70
pushi    250
pushi    81
lofsa    {Restore}
push   
pushi    1
pushi    81
lofsa    { Restart_}
push   
pushi    2
pushi    81
lofsa    { Quit_}
push   
pushi    3
calle    proc255_0,  22
push   
dup     
ldi      1
eq?     
bnt      code_110f
pushi    #restore
pushi    0
lag      gGame
send     4
jmp      code_112f
code_110f:
dup     
ldi      2
eq?     
bnt      code_1121
pushi    #restart
pushi    0
lag      gGame
send     4
jmp      code_112f
code_1121:
dup     
ldi      3
eq?     
bnt      code_112f
ldi      1
sag      global4
jmp      code_1133
code_112f:
toss   
jmp      code_10da
code_1133:
ret     
)
)

Offline OmerMor

Re: SCI01 Template Game
« Reply #25 on: December 18, 2018, 09:46:27 AM »
Here's the actual EgoDead procedure from QfG2:
Code: [Select]
;*****************************************************
;
; EGODEAD PROCEDURE -- to kill ego off
;
(procedure (EgoDead useRandomIcon  &tmp printRet)
   (HandsOff)
   (Wait 100)
   (= normalCursor ARROW_CURSOR)
   (theGame setCursor: normalCursor TRUE)

   (sounds  eachElementDo: #stop:)     ; Stop any other music
   (if deathMusic
      (miscSound
         number: deathMusic,
         priority: 15,
         loop: 1,
         play:
      )
   )

   (repeat
      (cond
         ((not useRandomIcon)    ; Specfic icon being used
            (= printRet
               (Print
                  &rest
                  #width:  250
                  #button: {Restore}   1
                  #button: {_Restart_} 2
                  #button: {_Quit_}    3
               )
            )
         )
         ((or (== sillyClowns clownsOff)
               (and (== sillyClowns clownsOtto) (not (Random 0 1)))
            )
            ; Give a serious death icon
            (= printRet
               (Print
                  &rest
                  #width:  250
                  #button: {Restore}   1
                  #button: {_Restart_} 2
                  #button: {_Quit_}    3
                  #icon:   vStaticIcons 2 0
               )
            )
         )
         (else
            (cIcon
               loop: (Random 0 1),
               cel: 0,
               cycleSpeed: (if (== loop 1) 20 else 10)
            )

            (= printRet
               (Print
                  &rest
                  #width:  250
                  #button: {Restore}   1
                  #button: {_Restart_} 2
                  #button: {_Quit_}    3
                  #icon:   cIcon
               )
            )
         )
      )

      (switch printRet
         (1
            (theGame restore:)
         )
         (2
            (theGame restart:)
         )
         (3
            (= quit TRUE)
            (break)
         )
      )
   )
)

Offline Kawa

Re: SCI01 Template Game
« Reply #26 on: December 18, 2018, 02:18:12 PM »
Just casually drop that procedure in there like no big deal  ::)

Offline EricOakford

Re: SCI01 Template Game
« Reply #27 on: December 21, 2018, 09:33:53 PM »
Here is the third release of the SCI01 Template!

Various bug fixes (thanks to my work on R44QSCI, which revealed some scripting errors when changing rooms), more original Sierra names for procedures, and the death message procedure are all here.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline MusicallyInspired

Re: SCI01 Template Game
« Reply #28 on: December 22, 2018, 10:05:49 AM »
Wicked.
Brass Lantern Prop Competition

Offline EricOakford

Re: SCI01 Template Game
« Reply #29 on: January 16, 2019, 08:51:02 PM »
To make it easier for others to update, I've placed the template game at Github. I think it's mature enough for that now.

Here it is.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned


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

Page created in 0.045 seconds with 22 queries.