Community
SCI Programming => SCI Syntax Help => Topic started by: Doan Sephim on December 10, 2018, 09:10:10 PM
-
How'd they do this? I assume it saved a file that contains values for certain variables, but what how would one accomplish actually importing this into another program?
-
I doubt it's a standard SCI save file. I haven't looked into it at all, but my guess is it's more likely a completely custom format in byte code that they scripted the games to understand. AGDI's QFG2VGA remake (made in AGS) will also understand these files and produce a new one for use in QFG3 onward.
-
True enough on being a custom format.
-
I attached the original save and import scripts I could find.
-
It's interesting seeing these original scripts (especially since I think SCI Companion's decompiler has trouble decompiling those particular scripts).
I remember reading about one of the bugs in QFG2's exporting, related to one poor coder's misunderstanding of how boolean math works, but it's neat being able to see it in black and white.
;; Bits in svMiscEquip
(define FINESWORD_BIT $0001) ; fine sword
(define FLAMESWORD_BIT $0002) ; flaming sword
(define COMPASS_BIT $0003) ; compass [NB, COMPASS_BIT == FINESWORD_BIT & FLAMESWORD_BIT]
(define PIN_BIT $0004) ; spahire pin
(define LAMP_BIT $0008) ; brass lamp
(define TOKEN_BIT $0010) ; EOF token
(define GLASSES_BIT $0020) ; X-Ray Glasses
; things transferred from "Quest for Glory 1"
(define BABA_BIT $0030) ; Flag set from QG1 [NB, BABA_BIT == TOKEN_BIT & GLASSES_BIT]
(define SWORD_BIT $0040) ; Sword
(define CHAIN_BIT $0080) ;
(define PICK_BIT $0100) ;
(define TOOL_BIT $0200) ;
I knew about the COMPASS_BIT, but the BABA_BIT is new to me. It's interesting to see that the QFG3 import code also replicates the bug... I wonder if it just wasn't noticed as being wrong then. I imagine the AGD team had to leave that bug as is in QFG2VGA, because it's just too intwined to change, without breaking compatibility with QFG3/4.
-
And here are my recreations of the QFG3 Import and CharSave scripts! It's interesting that the game saves your inventory and whether you bought the blackbird from the junk dealers, since QFG4 doesn't use those at all (as you start with no items).
EDIT 2/10/2021: The import and export scripts for QFG4 are here! Also, I slightly updated the QFG3 scripts.
-
It's like Christmas in February.
-
It's like Christmas in February.
Agreed! I just wish I were capable of understanding more of this stuff.
-
Agreed! I just wish I were capable of understanding more of this stuff.
That just means the code needs lots of comments!
-
That just means the code needs lots of comments!
And/or a design doc.
-
And/or a design doc.
Imagine if the Coles followed in Lowe's footsteps and released the code for their games. There'd probably be either a fat document on hero importing, or a hefty comment block.
-
Imagine if the Coles followed in Lowe's footsteps and released the code for their games. There'd probably be either a fat document on hero importing, or a hefty comment block.
Unfortunately the Coles didn't keep most of their code. I do have a few character import/export scripts. Have I not released them here somewhere?
-
Have I not released them here somewhere?
Nevermind. Here they are.
-
Huh. Surprisingly small amount of green in QfG3 RIMPORT there...
-
Huh. Surprisingly small amount of green in QfG3 RIMPORT there...
I'm not sure what you mean there. But it's definitely not the latest version of that script; it doesn't use the message system at all, which the final one of course does.
and yes, I've seen those before. I can't believe I haven't noticed this until now.
-
Huh. Surprisingly small amount of green in QfG3 RIMPORT there...
What green?
it's definitely not the latest version of that script; it doesn't use the message system at all, which the final one of course does.
That's correct. This is the qfg3 import script written during the qfg2 development time.
-
I'm not sure what you mean there.
Comments. Often colorcoded in green.