Author Topic: [SOLVED] SCI0 - Globalizing my local death sheet Script  (Read 780 times)

0 Members and 1 Guest are viewing this topic.

Offline doomlazer

Re: SCI0 - Globalizing my local death sheet Script
« Reply #15 on: February 21, 2022, 04:28:59 PM »
If I'm understanding the current issue correctly, your iterator is displaying all possible deaths listed in 650.txt, not just the ones that have happened to the player?
« Last Edit: February 21, 2022, 05:54:12 PM by doomlazer »

Offline Doan Sephim

Re: SCI0 - Globalizing my local death sheet Script
« Reply #16 on: February 21, 2022, 04:41:37 PM »
No, the iteration is working properly. It's only showing the ones that have their conditions met.

The thing I'm having problems with is writing the code to properly display them in a window, and then closing that window. I build the code in a random roomscript and it works, but I'm not able to make it its own script (so that I can trigger it from say, the menubar)

Offline doomlazer

Re: SCI0 - Globalizing my local death sheet Script
« Reply #17 on: February 21, 2022, 05:40:19 PM »
I tested this in the SCI0 template and it "works"

Code: [Select]
;;; Sierra Script 1.0 - (do not remove this comment)
(script# 777)
(include sci.sh)
(use Main)
(use SysWindow)
(use Obj)

(public
theInvSheet 0
)



(class InvSheet of Obj
(properties
nsTop 10
nsLeft 10
nsBottom 40
nsRight 160
theWindow 0
)

(method (init &tmp i temp1 y [str 40])
(super init:)
(= theWindow
(NewWindow nsTop nsLeft nsBottom nsRight {} 0 -1 clBLUE clWHITE)
)

;your iterate over deaths code here
(Display
(Format @str {You have died test times:} )
dsCOORD 10 10
)
                ;end iterate code
)

(method (doit &tmp newEvent newEventType)
(= newEventType 0)
(while (not newEventType)
(GlobalToLocal (= newEvent (Event new:)))
(= newEventType (newEvent type?))
(newEvent dispose:)
)
(self dispose:)
)

(method (dispose)
(DisposeWindow theWindow)
(super dispose:)
(DisposeScript 206)
)
)

;;;(procedure (deathCountIterator)
;;; (Display
;;; (Format @str 650 i)
;;; dsCOORD 20 textDown
;;; dsFONT 4
;;; )
;;; (= textDown (+ textDown 9))
;;;)

(instance theInvSheet of InvSheet
(properties)
)


call the window with:
Code: [Select]
((ScriptID 777 0) init: doit:)

« Last Edit: February 21, 2022, 07:42:55 PM by doomlazer »

Offline Doan Sephim

Re: SCI0 - Globalizing my local death sheet Script
« Reply #18 on: February 21, 2022, 09:03:23 PM »
Great! That worked perfectly once I incorporated my iteration code.

I think the thing I was really missing out on was what class to make it. I think I was confused when I tried to follow the QfG1 script's direction when I also made it of the object class, but Companion didn't like that because I didn't realize in the template game the class is Obj (and the capital O matters!)

Thanks for helping me troubleshoot this. It feels really good to have this squared away.

Offline doomlazer

Re: [SOLVED] SCI0 - Globalizing my local death sheet Script
« Reply #19 on: February 21, 2022, 10:10:35 PM »
That decompile archive is a valuable reference, once you get used to a few minor differences from the template game. You can basically just look up how the Sierra devs solved these problems.
« Last Edit: February 21, 2022, 10:12:55 PM by doomlazer »


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

Page created in 0.158 seconds with 23 queries.