Author Topic: Adding a room to Quest for Glory 1 (VGA)  (Read 22207 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #15 on: April 16, 2020, 02:17:32 AM »
I can't be sure but from the sounds of it it seems like Companion is setup to deal with implementing Messages in a certain way and QFG1 works in a different way that doesn't agree with Companion. Or maybe it's a compile issue or something? Something getting corrupted maybe? 
Brass Lantern Prop Competition

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #16 on: April 16, 2020, 03:56:19 AM »
It must be something like like that. its odd though, i've recompiled a few of the existing de-compiled scripts and they seem to handle it fine. i just cant figure what could be different.

is there another way i could approach the situation? i know sci0 used Text resources, are they still compatible with sci1.1? i looked it up in the scicompanion documentation and tried to use it like the example but i got a compilation error. either i did it wrong or its not compatible.

maybe i can just put the messages directly in the script. it wouldn't be pretty but it might work

Offline EricOakford

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #17 on: April 16, 2020, 06:48:18 AM »
SCICompanion's destruction of message resources in QFG1VGA and PQ1VGA is a known issue. I reported it here. Kawa took a look at it, and confirmed that this is the result of Companion not properly supporting the older message resources that this game uses.
Maybe once I finish my new and improved decompilation of the game, I could look into creating a patch to port the game to a newer version of the interpreter, bringing it in line with the Macintosh version from 1994. That could be difficult, though.
My SCI templates
SCI0 SCI0.1 SCI1.0 SCI1.1
SCI2.1 planned

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #18 on: April 16, 2020, 02:00:32 PM »
Thank you very much EricOakford! valuable information! in the mean time, is there anything i can do to make my thing work? can i use Text resources? I tried but couldn't figure it out. maybe someone can help?

Offline Kawa

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #19 on: April 16, 2020, 06:35:26 PM »
You could use text resources, if you forewent all use of the Messager class.

The Narrator and Talker classes' say method should allow you to pass a string pointer and caller. SQ5 and the template game it's based on have a Messager::sayFormat method that'd let you do something like (gMessager sayFormat: 99 "There's nothing here." self), but QFG1 seems to be missing this. And it wouldn't let you specify a text resource tuple anyway, taking only straight string pointers so you couldn't do (gMessager say: 99 scriptNumber 4 self) and load text line #4 that way anyway.

Doesn't mean you can't write a local procedure to do it yourself in just that room.

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #20 on: April 16, 2020, 07:52:56 PM »
Thanks Kawa.
I don't mind leaving out messenger class. My new room has no one to talk to so i don't need talkers. all i need is something that will display, for instance, line 4 from text resource 118. Can you help me get something like that working? i couldn't figure it out from the documentation. i must be missing somthing obvious.

Offline Kawa

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #21 on: April 17, 2020, 09:15:19 AM »
Code: [Select]
(procedure (Narrate line caller &tmp [buffer 1000])
(GetFarText scriptNumber line @buffer)
(gNarrator say: line caller)
)

(procedure (Say who line caller &tmp talker [buffer 1000])
(GetFarText scriptNumber line @buffer)
(= talker (gMessager findTalker: who))
(talker say: line caller)
)


(Narrate 2 self) ; have Narrator say line 2 from this script's text resource and call back after.

(Say 99 2 self) ; same, because talker 99 is the Narrator.

Put it in the script for your new room. I won't guarantee this is at all correct, I hacked it together in an external text editor. I included a version that takes a talker # just in case you decide otherwise.

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #22 on: April 17, 2020, 11:30:34 AM »
Thank you Kawa, I very much appreciate you help.

I tried both versions of the code you posted. They both compile without error but neither one works, unfortunately.

 The one without Talker support kicks back the error "Msg 999: 22 0 0.2 not found" then the game stops responding to input, the cursor moves around but won't anything else, not even bring down the menu.

 The version with Talker support give the error "<Messager findTalker:> can't find talker" then the game crashes.

Any thoughts?

I'm sorry I can't figure these things out on my own. this is my first time coding SCI and if its not in the tutorial its gonna take me a while.

Offline Kawa

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #23 on: April 17, 2020, 04:33:25 PM »
Hmm. Okay. So clearly I either misunderstood the Narrator/Talker-level say method, or QFG's is just that different.


Fuck it, let's not be too damn smart.
Code: [Select]
(procedure (Narrate line caller &tmp [buffer 1000])
(GetFarText scriptNumber line @buffer)
(Print addText: @buffer init: caller)
)

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #24 on: April 17, 2020, 06:38:16 PM »
Thank you very much Kawa. it seems to be working quite well. soon i'll be able to move on to the part of the project i expected to be hard. lol

I do have one more question, for now. gMessager class by default displays the messages toword the top of the screen. this new Narrate procedure you have written displays at the middle of the screen. is it possible to modify the code so that it will disply toward the top?

Again, the help you've been is enormous, thank you
« Last Edit: April 17, 2020, 07:02:14 PM by richruss691 »

Offline Kawa

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #25 on: April 18, 2020, 03:20:17 AM »
(Print addText: @buffer posn: -1 20 init: caller)

Replace the 20 as you like.

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #26 on: April 18, 2020, 10:08:21 AM »
Fantastic! Thank you so much! :)

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #27 on: April 24, 2020, 12:33:59 AM »
I just ran into something weird! I went to put the troll in my new room and it turned the entire background pic to black. I scratched my head for a few hours over it but did eventually manage to fix it. All the unused colors in the troll's pallet were set to used, and therefore showing as black. I changed them all to unused and it seems to have fixed the problem. i hope it doesn't creep into any other views.

Offline richruss691

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #28 on: May 13, 2020, 07:41:30 PM »
I've made some decent progress on this room now. The room now knows whether or not the troll is dead, the troll will fight you if he's not dead and you get too close to his pile of stuff, after the fight it returns you to the room and the troll falls over dead, and you can search his pile of stuff and only get treasure once. I am, however, seeing a problem with that last one.

If i hack a game save first thing so i can beat the troll right away, the first place i go it to the troll cave. I can get in and fight the troll in the first part of the cave, the part that existed in the release, and i can go to the new part of the cave and get the loot from the pile. No troll in that part, i can only get the loot once, works perfect. However, if i play longer before visiting the cave, it thinks the loot is already taken even when it's not. the rest of the room works as expected. It's as though the flag is being set at some other point in the game but that shouldn't be possible. It uses a global variable that I added myself that shouldn't be referenced anywhere else in the game.

I'll drop some code below. If anyone has any thoughts i'd like to hear them, please.

Quote
(instance robLoot of Script
   (properties)
   
   (method (changeState newState)
      (switch (= state newState)
         (0 ;N_LOOT
            (Narrate 13 self) ;dig through loot
         )
         (1
            (if (Btst digPile)
               (= rando (Random 15 16))
               (Narrate rando self) ;already got loot
            else
               (Narrate 14 self) ;get the loot
               (ego get: iSilver 30)
               (ego get: iGold 5)
               (Bset digPile)
            )
         )
      )
   )
)

Offline troflip

Re: Adding a room to Quest for Glory 1 (VGA)
« Reply #29 on: May 13, 2020, 08:16:11 PM »
Where is digPile defined? Are you sure it's at a higher index than any other global flag?
Check out my website: http://icefallgames.com
Groundhog Day Competition


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

Page created in 0.048 seconds with 23 queries.