Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
SCI Syntax Help / Re: Customized Dialogue Windows
« Last post by Kawa on September 06, 2020, 06:31:23 AM »
It's all good. This is a good necro-ing.
42
SCI Syntax Help / Re: Customized Dialogue Windows
« Last post by cosmicr on September 05, 2020, 11:52:11 PM »
Here's the custom window frame from The Colonel's Bequest, with my annotations, as an example:
Code: [Select]
;Make sure we can see it on screen.
(Graph grREDRAW_BOX t l b r 1)

Hi sorry to necro a thread, but I was using this example from Colonel's bequest to make my own custom dialog box.... Only to pull my hair out for hours trying to understand why my views were still drawing on top of my window.

I ended up examining the decompilation of the actual game(Colonel's Bequest) to discover that Kawa's code above had a mistake! The code should read:

Code: [Select]
;Make sure we can see it on screen.
(Graph grUPDATE_BOX t l b r 1)

Phew! At least I learned a lot through the process and now consider myself well learned on custom windows haha! Anyway thought it was worth posting in case someone finds this code and wants to use it for themselves. It makes it pretty easy to adapt to something else.

If anyone does want to implement this, don't forget that after you create your custom window class if you want to override the default Print procedure with yours you need to update this section in "Controls.sc" (edit: this isn't the best way to do it):
Code: [Select]
(method (open theType thePriority)
(if (and (PicNotValid) gCast)
(Animate (gCast elements?) 0)
)
(= window (myWindow new:)) ; originally just "Window" type
(window
top: nsTop
left: nsLeft
bottom: nsBottom
right: nsRight
title: text
type: theType
priority: thePriority
color: gWndColor
back: gWndBack
open:
)
(= seconds time)
(self draw:)
)

And here's my annotated version of the Colonel's Bequest code, from the decompilation:

Code: [Select]
(class myWindow of SysWindow
(properties
top 0
left 0
bottom 0
right 0
color 15
back 8
priority -1 ;negative 1 is no priority
window 0
type (| nwTRANSPARENT nwON_TOP)
title 0
brTop 0
brLeft 0
brBottom 190
brRight 320
underBits 0
)

(method (dispose)
(SetPort 0) ; use the window graphics port (0)
(Graph grRESTORE_BOX underBits) ; restore what was under the window
(Graph grREDRAW_BOX (- top 8) (- left 8) (+ bottom 8) (+ right 8) ) ; redraw the area
(DisposeWindow window) ; delete the window handle
(DisposeClone self) ; unload this instance
)

(method (open &tmp screens t l b r trHeight blHeight tlHeight tlWidth)
; get the dimensions of the corners
(= tlHeight (CelHigh 657 0 0)) ; view number 657 contains the corner images
(= trHeight (CelHigh 657 0 1)) ; loop 0, cel 1
(= blHeight (CelHigh 657 1 0)) ; loop 1, cel 0
(= tlWidth (CelWide 657 0 0))  ; loop 0, cell 0
; set to window port (0)
(SetPort 0)
; set the new bounds of the window
(= t (- top 8))
(= l (- left 8))
(= b (+ bottom 8))
(= r (+ right 8))
; visual screen
(= screens VISUAL)
; draw to priority also if priority value is present
(if (!= priority -1) (= screens (| screens PRIORITY)))
; save a buffer of the screen
(= underBits (Graph grSAVE_BOX t l b r screens) )
; draw background box
(Graph grFILL_BOX t l b r screens back priority)
; draw corners
(DrawCel 657 0 0 l t -1) ; top left
(DrawCel 657 0 1 l (- b trHeight) -1) ; bottom left
(DrawCel 657 1 0 (- r blHeight) t -1) ; top right
; note: there was a mistake made by sierra here, I have corrected it.
;       the cel number was set to 2, not 1.
(DrawCel 657 1 1 (- r blHeight) (- b trHeight) -1) ; bottom right
; draw borders
(Graph grDRAW_LINE t (+ l tlWidth) t (- r tlWidth) 31 -1 -1) ;top outside (31 is white)
(Graph grDRAW_LINE (+ t 2) (+ l tlWidth) (+ t 2) (- r tlWidth) 31 -1 -1) ;top inside
(Graph grDRAW_LINE (- b 1) (+ l tlWidth) (- b 1) (- r tlWidth) 31 -1 -1) ;bottom outside
(Graph grDRAW_LINE (- b 3) (+ l tlWidth) (- b 3) (- r tlWidth) 31 -1 -1) ;bottom inside
(Graph grDRAW_LINE (+ t tlHeight) l (- b tlHeight) l 31 -1 -1) ;left outside
(Graph grDRAW_LINE (+ t tlHeight) (+ l 2) (- b tlHeight) (+ l 2) 31 -1 -1) ;left inside
(Graph grDRAW_LINE (+ t tlHeight) (- r 1) (- b tlHeight) (- r 1) 31 -1 -1) ;right outside
(Graph grDRAW_LINE (+ t tlHeight) (- r 3) (- b tlHeight) (- r 3) 31 -1 -1) ;right inside
; update the draw area
(Graph grUPDATE_BOX t l b r VISUAL)
; update type incase it changed
(= type (| nwTRANSPARENT nwON_TOP))
; call the base class (SysWindow) open procedure
(super open:)
)
)
43
A whole year! Today, one year ago, I posted that I'm working on BA2.

Just wanted to let you know, I'm still working. Little by little, every day. The current goals have changed a little bit. When I first posted, the idea was to complete both Books 2 and 3, but after working a while, I realized the workflow works better if I complete the book 2 before working on book 3.

I also am looking to finish sometime in 2022.

I've put up a One-Year-Retrospective/DevLog on my website if you want to check it out.

I also update and share info/pics on my twitter account.
44
thank you for your interest mrprmiller and thank you for the info! good to know!
45
This is just so great; something good in 2020.

One thing the VGA is missing is a few places where time-skips can happen.  For example, getting thrown out of the bar advances time significantly in EGA, but does nothing in VGA.  Also, you can "nap" or "sleep" at the barracks in EGA and it advances time to night.
46
SCI Syntax Help / Re: Where to get SCI0 documentation in 2020?
« Last post by Doan Sephim on September 01, 2020, 11:11:57 PM »
Great thanks.

This should be enough to keep me going. It's all coming together :)

I may end up writing a tutorial if I can get far enough. Even with my experience it has taken a bit of head scratching to get my head around it all. I think another perspective may help some people.
I'll be quite interested in what you come up with/what you're working on.

I'm also working on SCI0 game using sierra script!
47
SCI Syntax Help / Re: Where to get SCI0 documentation in 2020?
« Last post by cosmicr on September 01, 2020, 09:09:01 PM »
Great thanks.

This should be enough to keep me going. It's all coming together :)

I may end up writing a tutorial if I can get far enough. Even with my experience it has taken a bit of head scratching to get my head around it all. I think another perspective may help some people.
48
SCI Syntax Help / Re: Where to get SCI0 documentation in 2020?
« Last post by OmerMor on September 01, 2020, 02:29:23 AM »
You're right. This part was removed from SCI Companion's documenatation.

You can view its latest snapshot here:
https://htmlpreview.github.io/?https://github.com/icefallgames/SCICompanion/blob/2b0553c61a04def0f35d378579dc87b5e272f6ac/SCICompanion/Help/Legacy/index.html

However, this is just SCI Studio's documentation which can be also found here:
http://sci.sierrahelp.com/SCIStudio3Help/SCC/Index.html
49
SCI Syntax Help / Re: Where to get SCI0 documentation in 2020?
« Last post by cosmicr on August 31, 2020, 05:02:34 PM »
Thanks but unfortunately it also has a broken link to the SCI0 stuff I need.

http://scicompanion.com/Documentation/legacy.html

I think I've found what I want now anyway at http://sciwiki.sierrahelp.com//index.php?title=SCI_Kernel_Documentation assuming it's compatible.
50
SCI Syntax Help / Re: Where to get SCI0 documentation in 2020?
« Last post by OmerMor on August 31, 2020, 04:46:57 AM »
SCI Companion has very good documentation:
http://scicompanion.com/Documentation/index.html
Pages: 1 ... 3 4 [5] 6 7 ... 10

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.1 seconds with 18 queries.