Recent Posts

Pages: [1] 2 3 ... 10
1
SCI Syntax Help / Re: Instance Priorities
« Last post by troflip on Yesterday at 04:52:44 PM »
Yes, I added support for most constant expressions to be resolved at compile time, thus allowing for that to work ;-)

Setting priority in the properties block, and including the fixPriOn flag is how I usually deal with fixed priority sprites.
2
SCI Syntax Help / Re: Customized Dialogue Windows
« Last post by Kawa on Yesterday at 03:18:22 PM »
It's interesting that you'd specify Quest for Glory 2, since that game already had a concept of a Talker. Assuming you want an SCI11 game, you could suffice by simply giving each of your characters' Talker instances different color and back values. It seems to already be all set up to pass these values along to a clone of gWindow. That means the only thing preventing these colors from showing up correctly is that the SCI11 template's gWindow is a BorderWindow by default. If you were to change this to a SysWindow (look for instance mainWindow of BorderWindow in Main.sc), that'd simplify things a lot and you get title bars back.

As for how custom window frames work in general... basically just like how a BorderWindow does it. Instead of letting the interpreter draw the window, they set the Custom bit ($80) and draw it themselves.

Here's the custom window frame from The Colonel's Bequest, with my annotations, as an example:
Code: [Select]
(class myWindow of SysWindow
(properties
top 0
left 0
bottom 0
right 0
color 15
back 8
priority -1
window 0
type $0081 ;Custom, no save
title 0
brTop 0
brLeft 0
brBottom 190
brRight 320
underBits 0
)

(method (dispose)
(SetPort 0)
(Graph grRESTORE_BOX underBits)
(Graph grREDRAW_BOX (- top 8) (- left 8) (+ bottom 8) (+ right 8))
(DisposeWindow window)
(DisposeClone self)
)

(method (open &tmp screens t l b r trHeight blHeight tlHeight tlWidth)
(= tlHeight (CelHigh 657 0 0))
(= trHeight (CelHigh 657 0 1))
(= blHeight (CelHigh 657 1 0))
(= tlWidth (CelWide 657 0 0))
(SetPort 0)

; Make room for the corners
(= t (- top 8))
(= l (- left 8))
(= b (+ bottom 8))
(= r (+ right 8))

(= screens VISUAL)
(if (!= priority -1) (= screens (| screens PRIORITY)))

;We've set the No Save bit, so the kernel won't do it for us.
(= underBits (Graph grSAVE_BOX t l b r screens))

;Fill in the box to start with.
(Graph grFILL_BOX t l b r screens back priority)

;Draw the corners
(DrawCel 657 0 0 l t -1)
(DrawCel 657 0 1 l (- b trHeight) -1)
(DrawCel 657 1 0 (- r blHeight) t -1)
(DrawCel 657 1 2 (- r blHeight) (- b trHeight) -1)

;Draw the double edges
(Graph grDRAW_LINE t (+ l tlWidth) t (- r tlWidth) 31 -1 -1) ;top
(Graph grDRAW_LINE (+ t 2) (+ l tlWidth) (+ t 2) (- r tlWidth) 31 -1 -1)
(Graph grDRAW_LINE (- b 1) (+ l tlWidth) (- b 1) (- r tlWidth) 31 -1 -1) ;bottom
(Graph grDRAW_LINE (- b 3) (+ l tlWidth) (- b 3) (- r tlWidth) 31 -1 -1)
(Graph grDRAW_LINE (+ t tlHeight) l (- b tlHeight) l 31 -1 -1) ; left
(Graph grDRAW_LINE (+ t tlHeight) (+ l 2) (- b tlHeight) (+ l 2) 31 -1 -1)
(Graph grDRAW_LINE (+ t tlHeight) (- r 1) (- b tlHeight) (- r 1) 31 -1 -1) ;right
(Graph grDRAW_LINE (+ t tlHeight) (- r 3) (- b tlHeight) (- r 3) 31 -1 -1)

;Make sure we can see it on screen.
(Graph grREDRAW_BOX t l b r 1)

;Make sure we're still (| Custom NoSave)
(= type $81)

;Let the kernel worry about the rest
(super open:)
)
)
3
SCI Syntax Help / Re: Instance Priorities
« Last post by Kawa on Yesterday at 03:10:32 PM »
That was the second example I gave.
4
SCI Syntax Help / Re: Instance Priorities
« Last post by lskovlun on Yesterday at 11:26:36 AM »
(does Companion support OR-ing constant flags together to make a constant signal initializer?)
As in, can you do (someRandomExampleActor state: (| fixPriOn noTurn)), or have an iconbar button's property list have signal (| icHIDEBAR icRELEASE) instead of $0041? Yes.
I meant in the properties section, as in
Code: [Select]
(instance someRandomExampleActor of Actor
  (properties
    x blah
    y blah
    priority 9
    signal (| fixPriOn noTurn etc.)
  )
)
5
SCI Syntax Help / Customized Dialogue Windows
« Last post by NilG on Yesterday at 10:56:08 AM »
Hi again.  Most of the code for the demo is done (act 1 of a 3 act game).  Still a ton to do, replace edited Sierra backgrounds with original ones, add and pretty up some views, clean up some code (aside from a bit of scripting and the C++ courses I took in high school 20 years ago, I'm not a programmer), and waaaaay too many "responseless" possibilities.  Still, there are two complete positive paths through the end of the section I have, it's been amazingly rewarding, and thank you so much for the help with my absolute beginner's questions.

One thing that isn't necessary, but I'd love to include, and I realize it may require a ton of rewrites or additions, is customized dialogue boxes for conversation, similar to QfG2.  Basically just background and text colors customized depending on who's speaking.  Snail Trek (love it and looking forward to Cascadia Quest) also has something very similar; I don't know that speech bubbles would fit stylistically here, but it is basically that idea.

I've looked at the code and guess what's there can be used to implement this, but as a non-coder, my method for doing so would probably be super convoluted.  Is there any kind of built-in method for the customization of dialogue boxes, or a sample of code that doesn't suck for doing so?  I can certainly add sucky code, but I know many of you have been here for a long time doing these things, so figured I'd ask before tromping ahead recklessly.  :D  Thanks!
6
SCI Syntax Help / Re: Instance Priorities
« Last post by Kawa on Yesterday at 10:27:22 AM »
(does Companion support OR-ing constant flags together to make a constant signal initializer?)
As in, can you do (someRandomExampleActor state: (| fixPriOn noTurn)), or have an iconbar button's property list have signal (| icHIDEBAR icRELEASE) instead of $0041? Yes.
7
SCI Syntax Help / Re: Instance Priorities
« Last post by lskovlun on Yesterday at 09:52:32 AM »
I'd imagine it still wouldn't set the "fixed priority" bit and get overwritten.
Let's put that in clearer terms. There's a property called signal in views that does a lot of marvelous things (it's a bitfield, so it represents 16 boolean flags). Among those things are whether the priority is determined by the engine as others have described or not. To make it easier to use, there are methods you can call that manipulate the signal property in just the right way (setPri, stopUpd, startUpd, etc.)

You'll notice in decompiled games, that they sometimes set the signal property to magical values in addition to setting a particular priority. That is how you can avoid having to call setPri directly, but I guess it could be said to be an advanced technique (does Companion support OR-ing constant flags together to make a constant signal initializer?).
8
SCI Syntax Help / Re: Instance Priorities
« Last post by Kawa on Yesterday at 06:45:29 AM »
I'd imagine it still wouldn't set the "fixed priority" bit and get overwritten.
9
SCI Syntax Help / Re: Instance Priorities
« Last post by NilG on Yesterday at 03:32:22 AM »
Thanks Troflip and everyone.  setpri did do what I needed.  It seems a bit odd to me that a specified priority in the instance code would be overwritten, but that makes sense, and setpri totally does what's needed here.  To follow up, does setting priority: during instantiation do anything, or is it always just overwritten by the y value?
10
AGI Development Tools / Re: Need Testers for WinAGI
« Last post by AGKorson on February 11, 2019, 09:05:25 AM »
THANK YOU Eric!

I'll take a look at that bug in the reserved defines editor.
Pages: [1] 2 3 ... 10

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

Page created in 0.07 seconds with 16 queries.