Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - gumby

Pages: [1] 2 3 ... 8
1
I ran into a need to have a view displayed at different scales based on the room it was displayed in.  Making things more difficult, it wasn't just one view, I needed logic for N views.  No way I was going to make 20+ different versions of the same view cel for all my views to accommodate all the different scales that I needed.

I started by creating views that were 'full size', meaning either 320 on the x-axis or 190 on the y.  Then I assigned relative 'scale values' or 'sizes' between them so they would sized appropriately when displayed with any other views.  For example:

Code: [Select]
(define SWORD_SCALE 80) 
(define LAMP_SCALE 65)              ; the lamp is 80% the size of the sword
(define CLOVE_OF_GARLIC_SCALE 5)    ; the clove of garlic is 6% the size of the sword

Then determine what your room scale value should be, 1 being a 'zoomed in' room and larger values get you 'further away' from them, effectively making them scaled down.

I added this procedure in the Actor.sc script:

Code: [Select]
;;;
;;;  Calculates what the scale should be based on the relative room scale (current room) and relative view scale
;;;    viewScale - a relative scaling value between ~5 (smallest) to ~100 (largest).
;;;    roomScale - value between 1 ('closest' or 'largest views') to ~50  ('furthest' or 'smallest views')
;;;
(procedure (calcRelativeScale view loop cel viewScale roomScale &tmp width height dim tmpScale)
   (= width  (CelWide view loop cel))
   (= height (CelHigh view loop cel))
   
   (if (> width height)
      (= dim width)
    else
      (= dim height)
   )

   (= tmpScale (/ (/ (* dim viewScale) 100) roomScale))
   
   (if (< tmpScale 3)
      (= tmpScale 3)    ; smallest possible scale with full-screen views
   )
   
   (if (> tmpScale 100) 
      (= tmpScale 100) ; full size
   )
   
   (return tmpScale)
)

Then prior to initing your view, calculate the scale by passing in the view, loop, cel and your viewScale and roomScale.  Just to be safe, make sure that the computed value is sane.

Code: [Select]
   
   (= view 10)   ; the sword view
   (= loop 4)
   (= cel 0)
   (= viewScale SWORD_SCALE)
   (= roomScale 50)    ;  I actually added a new property to the Room object and set the scales for the rooms there

   (= tmpScale (calcRelativeScale view loop cel viewScale roomScale))

   ; don't attempt to scale if we have no scale value defined
   (if (> tmpScale 0)   
      (myView init: show: setScale: Scaler tmpScale tmpScale)
    else
      (myView init: show:) 
   ) 

The scaled views that I generated from a 'full size' seemed pretty good at any size but this code could be improved by having more than just one view to choose from.  We could make a 'half-size' view with max dimensions of 160x85 and perhaps another 'quarter-size' one.  Compute the scales against all 3 views and choose the one that has a resulting scale nearest to 100 - this may help with any visual degradation when the scale size gets too small.

I've attached a screenshot of 3 different views, scaled at 5 different 'room sizes' using this process:

2
SCI Syntax Help / Scaler error
« on: November 11, 2017, 10:16:51 AM »
I'm having a problem using the scaler.  When I call it with a view that has an instance explicitly declared in room (Egg) it works just fine, but when I call it on a view I create 'on-the-fly', the scaler throws an error of "<View setScale:> y value less than vanishingY".  My best guess is that I'm improperly creating the on-the-fly view, but I don't know how else to do it.

Code: [Select]
(method (init)
     (super init:)

     (Egg         view:24 loop:4 cel:0 x:100 y:100 init: setScale: Scaler 50 50)
     ((View new:) view:24 loop:4 cel:0 x:100 y:150 init: setScale: Scaler 50 50)
)
...

(instance Egg of Prop)

EDIT: Deferring the scaling doesn't seem to make a difference either.  The 'egg' instance works just fine, the dummy fails in the same way as the code above.
Code: [Select]
        (Egg view:24 loop:4 cel:0 x:100 y:100 init: )
        (Egg setScale: Scaler 50 50)
       
        (= dummy ((View new:) view:24 loop:4 cel:0 x:100 y:150 init:))
        (dummy setScale: Scaler 50 50)

EDIT2: I figured it out.  Shouldn't be using the 'View' class, should be using the 'Prop' class.  Once I changed the code to new-up a Prop it worked fine, which made perfect sense once I discovered the scaler property associated to Prop.  :-[

3
SCI Syntax Help / SCI 1.1 - DrawPic & dpOPEN_INSTANTLY
« on: November 04, 2017, 08:39:36 AM »
I'm having a problem when calling DrawPic with dpOPEN_INSTANTLY (defined as -1 in sci.sh) - I get the request room pic, but it's flipped horizontally when displayed.

Here's my code (in the room instance):
Code: [Select]
(method (handleEvent pEvent)
(super handleEvent: pEvent)
(switch ((gUser curEvent?) message?)
(V_LOOK
   (DrawPic 5 dpOPEN_INSTANTLY)
)
)
)


EDIT: I found a workaround, used the dpOPEN_NO_TRANSITION (100) option instead.

4
SCI Syntax Help / Inventory views
« on: October 18, 2017, 07:58:41 PM »
Documenting this as I haven't found this explicitly stated anywhere yet.  With SCI 1.1, when creating views, by default the template game wants/expects the following:

loop 0 = cursor view
loop 1 = inventory icon
loop 2 = icon bar

When declaring your inventory items in Inventory.sc, set the loop 1 for the views.  I noticed that if you set it to loop = 0, it'll show the loop 0 view the first time you open the inventory screen but any subsequent times it'll display loop 1.

5
SCI Syntax Help / String pain
« on: October 14, 2017, 11:12:07 AM »
The below code lives in a room script, in the doVerb method of a prop. I have a text resource that contains all of my noun names, resource 1 and in this case hard-coded to index position 35 (sword).  I've ripped everything out except for the code that I'm struggling with:

Code: [Select]
; On first invocation, prints  "The sword won't fit in the box". 
; On subsequent invocations, only prints "sword"

    (method (doVerb theVerb param2 &tmp [test1 50])
         (Printf "The %s won't fit in the box" (GetFarText 1 35))
    )

I tried this with the same results as above:
Code: [Select]
; On first invocation, prints  "The sword won't fit in the box". 
; On subsequent invocations, only prints "sword"

    (method (doVerb theVerb param2 &tmp [test1 50])
         (StrCpy @test1 (GetFarText 1 35))
         (Printf "The %s won't fit in the box" @test1)
    ) 
   
The only thing that does work is this:
Code: [Select]
; On every invocation, prints  "The sword won't fit in the box".

    (method (doVerb theVerb param2 &tmp [test1 50])
         (Printf "The %s won't fit in the box" (Format @test1 1 35))
    )   

Can someone help me understand what's going on here?  Seems like #1 & #2 should work fine, #3 sort of makes sense (I assume a pointer to @test1 is being returned from the Format call and the Printf statement is able to use it).

6
SCI Syntax Help / SCI 1.1 view palettes
« on: September 14, 2017, 07:29:46 PM »
So I'm starting to create views for my rooms.  I discovered pretty quickly that they tend to stand out because of the limited colors when creating a view.  The views I'm creating are specific to individual rooms, so conflicting palettes shouldn't be a problem. 

I suspect I can get around this by building an embedded palette? I found the 'Import' option in the palette editor, not sure how to use it - is there a way to import the palette from the corresponding PIC resource?

EDIT:  Never mind, found it.  Just open the PIC, go to the palette and export the .pal.  Then just import it into the view.  Nice.

7
SCI Syntax Help / Background scrolling
« on: September 07, 2017, 05:04:09 AM »
I'm trying to create in-game mapping functionality, but a single 320x200 pic is just too small - I figure I need about 4 times the size of a standard room pic. Anyone know of a SCI1.1 game that implemented room pic scrolling that I could decompile to see how they did it?  Or if there is another way of accomplishing this in a similar manner?

8
SCI Syntax Help / Drop inventory item (SCI 1.1)
« on: March 23, 2017, 08:27:21 PM »
I have chosen an item from my inventory and I want to drop it in a room.  The item is selected from inventory and the mouse cursor is changed to represent the item the ego is holding. 

Here's what I have in the doVerb method (conditional logic removed for clarity):
Code: [Select]
   (gEgo put: INV_LEAFLET)   ;Remove item from inventory
   (leaflet show:)                     ;Display the prop in the room

What I can't seem to figure out is how to get the mouse cursor (a leaflet) to change back to say the look or walk icon & have the verb change as well.  I can set the cursor manually:

Code: [Select]
   (gGame setCursor: 996 1)

But that doesn't change the verb, and I'm sure this isn't the right way to be doing this. What am I missing here?

9
SCI Community How To's & Tutorials / SCI0 - Graph fill box and Dithering
« on: November 27, 2016, 10:58:59 AM »
The Graph() kernel method doesn't support using a dithered color.  So to overcome this I wrote this procedure:

Code: [Select]
(procedure (GraphDither y1 x1 y2 x2 clColor1 clColor2)
   (var xI, xII, yI, yII, yOdd)
   
          Graph(grFILL_BOX y1 x1 y2 x2 VISUAL clColor1)
     
          = yOdd 0
  (if (<> (% (- y2 y1) 2) 0)
    = yOdd 1
  )
 
  = xI x1
  = yI (- y2 2)
  = xII (- (+ x1 2) 1)
  = yII (- y2 1)
 
          (if (yOdd)
     = yI (- y2 1)
     = xII x1  
  )

  (while (1)
             (if ((>= xII x2))
                = xII (- x2 1)
                = yII (- yII 1)
      )
     
      Graph(grDRAW_LINE yI xI yII xII clColor2)
     
      (if (<= (+ xII 2) x2)
    = xII (+ xII 2)
      )(else
  = yII (- yII 2)
      )
 
      (if (>= (- yI 2) y1)
    = yI (- yI 2)
      )(else
      = xI (+ xI 2)        
      )

      (if (>= xI x2)
   break
      )
  )
)

The procedure starts by drawing a box with the first specified color, then draws parallel lines (slope = 1) which colors every other pixel in the box with the 2nd dither color.

10
I had a need to input multiple values from the user and the template game out-of-the-box only supports a single edit control in the Print routine.  Here's how you can enable multiple edit boxes in a single print statement, perhaps for that RPG you always wanted to make. 

Note that this example uses the SCI Studio syntax, not the Sierra syntax.

Make a new procedure called PrintMultiEdit() based on the Print() procedure in Controls.sc.  You could just override the existing Print() procedure, but you'll need to make other changes everywhere an #edit is used in existing Print statements in the template code (shouldn't be too hard, but left out here for brevity).

Code: [Select]
(procedure public (PrintMultiEdit params)
(var hDialog, hDText, hIcon, hEdits[10], btnPressed, paramCnt, diagX, diagY,
maxWidth, newPrintDlg, hFirstEnabled, oldPort, hButtons[6], btnsWidth,
buttonCnt, btnX, msgBuf[1013], moveToX, moveToY, editCnt, leftMargin[10],fontHeight)
= diagY  -1
= diagX  -1
= buttonCnt 0
= editCnt 0
= hEdits  NULL
= hIcon  NULL
= btnsWidth 0
= maxWidth  0
= newPrintDlg  NULL
= hDialog (Dialog:new())
(send hDialog:
window(gTheWindow)
name("PrintD")
)
= hDText (DText:new())
(if(<u params[0] 1000)
GetFarText(params[0] params[1] @msgBuf)
= paramCnt 2
)(else
  (if(params[0])
  StrCpy(@msgBuf params[0])
  = paramCnt 1
)(else
= msgBuf 0
= paramCnt  0
)
)
(send hDText:
text(@msgBuf)
moveTo(4 4)
font(gDefaultFont)
setSize()
)

(send hDialog:add(hDText))


  (while(< paramCnt paramTotal)
  (switch(params[paramCnt])
  (case #mode
  ++paramCnt
  (send hDText:mode(params[paramCnt]))
)
(case #font
  ++paramCnt
  (send hDText:
  font(params[paramCnt])
  setSize(maxWidth)
  )
)
(case #width
= maxWidth params[++paramCnt]
(send hDText:setSize(maxWidth))
)
(case #time
++paramCnt
(send hDialog:time(params[paramCnt]))
)
(case #title
++paramCnt
(send hDialog:text(params[paramCnt]))
)
(case #at
= diagX params[++paramCnt]
= diagY params[++paramCnt]
)
(case #draw
Animate(
(send gCast:elements)
0
)
)
(case #edit
++paramCnt
= hEdits[editCnt] (DEdit:new())

(send hEdits[editCnt]:
text(params[paramCnt])
)

++paramCnt
(send hEdits[editCnt]:
max(params[paramCnt])
setSize()
)

= leftMargin[editCnt] params[++paramCnt]

// if this is the first edit control, get the required font height value
(if (== 0 editCnt)
  = fontHeight params[++paramCnt]
)

++editCnt
)

(case #button
    = hButtons[buttonCnt] (DButton:new())
(send hButtons[buttonCnt]:
text(params[++paramCnt])
value(params[++paramCnt])
setSize()
    )
    = btnsWidth (+ btnsWidth (+ (send hButtons[buttonCnt]:nsRight) 4))
    ++buttonCnt
)

(case #icon
(if(IsObject(params[+ paramCnt 1]))
= hIcon (send params[+ paramCnt 1]:new())
(send hIcon:setSize())
= paramCnt (+ paramCnt 1)
    )(else
    = hIcon (DIcon:new())
    (send hIcon:
    view(params[+ paramCnt 1])
    loop(params[+ paramCnt 2])
    cel(params[+ paramCnt 3])
    setSize()
    )
    = paramCnt (+ paramCnt 3)
    )
)
(case #dispose
(if(gPrintDlg)
(send gPrintDlg:dispose())
)
= newPrintDlg hDialog
)
(case #window
++paramCnt
(send hDialog:window(params[paramCnt]))
)
)
++paramCnt
)
(if(hIcon)
(send hIcon:moveTo(4 4))
(send hDText:moveTo( (+ 4 (send hIcon:nsRight)) (send hIcon:nsTop) ))
(send hDialog:add(hIcon))
)
  (send hDialog:setSize())
 
= paramCnt 0
(while(< paramCnt editCnt)
    (send hEdits[paramCnt]:moveTo(
    (+ leftMargin[paramCnt] (send hDText:nsLeft))
    (+ (- (send hDText:nsBottom) (* fontHeight editCnt)) (* fontHeight (paramCnt)))
    ))
    (send hDialog:
    add(hEdits[paramCnt])
    setSize()
    )
   
++paramCnt
)


  (if(> btnsWidth (send hDialog:nsRight))
= btnX 4
)(else
  = btnX (- (send hDialog:nsRight) btnsWidth)
        //If you wanted the button centered...
        //   = btnX / ( - (send hDialog:nsRight) btnsWidth ) 2
)

= paramCnt 0
(while(< paramCnt buttonCnt)
(send hButtons[paramCnt]:moveTo( btnX (send hDialog:nsBottom) ))
(send hDialog:add(hButtons[paramCnt]))
= btnX (+ 4 (send hButtons[paramCnt]:nsRight))
++paramCnt
)

  (send hDialog:
  setSize()
  center()
  )
  (if(hIcon and not StrLen(@msgBuf))
(send hIcon:
moveTo(
    (
    / (- (- (send hDialog:nsRight) (send hDialog:nsLeft))
    (- (send hIcon:nsRight) (send hIcon:nsLeft))) 2
    )
    4
    )
)
)

(if(== -1 diagX)
= moveToX (send hDialog:nsLeft)
)(else
= moveToX diagX
)
(if(== -1 diagY)
= moveToY (send hDialog:nsTop)
)(else
= moveToY diagY
)
  (send hDialog:moveTo( moveToX moveToY ))

= oldPort GetPort()

(if(send hDialog:text)
= moveToX nwTITLE
)(else
= moveToX nwNORMAL
)
(if(newPrintDlg)
= moveToY 15
)(else
= moveToY -1
)
(send hDialog:open(moveToX moveToY))

(if(newPrintDlg)
= gOldPort GetPort()
SetPort(oldPort)
return(= gPrintDlg newPrintDlg)
)
  (if( (= hFirstEnabled (send hDialog:firstTrue(#checkState 1)))
       and (not (send hDialog:firstTrue(#checkState 2)) ) )
    (send hFirstEnabled:state(| (send hFirstEnabled:state) 2))
)
  = btnPressed (send hDialog:doit(hFirstEnabled))
  (if(== btnPressed -1)
= btnPressed 0
)

  (for (= paramCnt 0) (< paramCnt buttonCnt) (++paramCnt)
  (if(== btnPressed hButtons[paramCnt])
    = btnPressed (send btnPressed:value)
    break
)
)
  (if(not (send hDialog:theItem) )
= btnPressed 1
)
  (send hDialog:dispose())

return(btnPressed)
)

Basically, I used the existing button code and applied it to edit controls.  Let's take it for spin:

In your room:
Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (var inp1[5], inp2[5], inp3[5], inp4[5], inp5[5], inp6[5], inp7[5], inp8[5], inp9[5], inp10[5], attributes[100])
        (super:handleEvent(pEvent))

            // you must initialize these or you will get garbage in your print
            = inp1 0
    = inp2 0
    = inp3 0
    = inp4 0
    = inp5 0
    = inp6 0
    = inp7 0
            = inp8 0
            = inp9 0
            = inp10 0
                   
            PrintMultiEdit("Input character attributes:\nStrength:\nConstitution:\nWisdom:\nDexterity:\nIntelligence:\nCharisma:\nSocial Standing:\nMagic Resistance:\nLuck:\nHealth:"
       #edit @inp1 3 100 12
       #edit @inp2 3 100
       #edit @inp3 3 100
       #edit @inp4 3 100
       #edit @inp5 3 100
       #edit @inp6 3 100
       #edit @inp7 3 100
       #edit @inp8 3 100
       #edit @inp9 3 100
       #edit @inp10 3 100
       #button "  OK  " 0
)
          )
)
 

Ok, let's go through this. 

First, the text to be displayed in the dialog.  For each edit control, we are going to be putting labels to the left of the edit controls.  The approach I took was to embed these into the normal text displayed when Print() is called, each edit control label separated by newlines.

Next, examine the new attributes for #edit.  There are two, the first (set to 100 for all edit controls in this example) is the left margin/padding for the edit control.  This is used to bump the edit controls to the right so that the edit labels don't get clobbered.  The 2nd, which only appears on the 1st #edit is the font height.  We only need this once because we aren't going to have mixed fonts within a single Print() call.  This value represents the vertical spacing we will use for spacing the edit controls apart.

Here's the result:



Let's show off the left margin attributes a bit and put in default values of zero:
Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (var inp1[5], inp2[5], inp3[5], inp4[5], inp5[5], inp6[5], inp7[5], inp8[5], inp9[5], inp10[5], attributes[100])
        (super:handleEvent(pEvent))

            // you must initialize these or you will get garbage in your print
            StrCpy(@inp1 "0")
    StrCpy(@inp2 "0")
    StrCpy(@inp3 "0")
    StrCpy(@inp4 "0")
    StrCpy(@inp5 "0")
    StrCpy(@inp6 "0")
    StrCpy(@inp7 "0")
            StrCpy(@inp8 "0")
            StrCpy(@inp9 "0")
            StrCpy(@inp10 "0")
                   
            PrintMultiEdit("Input character attributes:\nStrength:\nConstitution:\nWisdom:\nDexterity:\nIntelligence:\nCharisma:\nSocial Standing:\nMagic Resistance:\nLuck:\nHealth:"
       #edit @inp1 3 50 12
       #edit @inp2 3 73
       #edit @inp3 3 48
       #edit @inp4 3 54
       #edit @inp5 3 67
       #edit @inp6 3 56
       #edit @inp7 3 87
       #edit @inp8 3 94
       #edit @inp9 3 31
       #edit @inp10 3 40
       #button "  OK  " 0
)
          )
)



Just for fun, let's put in some default randomized attribute values:

Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (var inp1[5], inp2[5], inp3[5], inp4[5], inp5[5], inp6[5], inp7[5], inp8[5], inp9[5], inp10[5], attributes[100])
        (super:handleEvent(pEvent))

            // you must initialize these or you will get garbage in your print
    Format(@inp1 "%d" Random(0 20))  
            Format(@inp2 "%d" Random(0 20))
            Format(@inp3 "%d" Random(0 20))
            Format(@inp4 "%d" Random(0 20))
            Format(@inp5 "%d" Random(0 20))
            Format(@inp6 "%d" Random(0 20))
            Format(@inp7 "%d" Random(0 20))
            Format(@inp8 "%d" Random(0 20))
            Format(@inp9 "%d" Random(0 20))
            Format(@inp10 "%d" Random(0 20))
                   
            PrintMultiEdit("Input character attributes:\nStrength:\nConstitution:\nWisdom:\nDexterity:\nIntelligence:\nCharisma:\nSocial Standing:\nMagic Resistance:\nLuck:\nHealth:"
       #edit @inp1 3 50 12
       #edit @inp2 3 73
       #edit @inp3 3 48
       #edit @inp4 3 54
       #edit @inp5 3 67
       #edit @inp6 3 56
       #edit @inp7 3 87
       #edit @inp8 3 94
       #edit @inp9 3 31
       #edit @inp10 3 40
       #button "  OK  " 0
)
          )
)



I would be remiss if I didn't show that we can get these values out of our print statement - they are stored in the same input values.  This screenshot below doesn't show it, but if you change the values when in the Print() dialog, they will be reflected in the final output.

Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (var inp1[5], inp2[5], inp3[5], inp4[5], inp5[5], inp6[5], inp7[5], inp8[5], inp9[5], inp10[5], attributes[100])
        (super:handleEvent(pEvent))

            // you must initialize these or you will get garbage in your print
    Format(@inp1 "%d" Random(0 20))  
            Format(@inp2 "%d" Random(0 20))
            Format(@inp3 "%d" Random(0 20))
            Format(@inp4 "%d" Random(0 20))
            Format(@inp5 "%d" Random(0 20))
            Format(@inp6 "%d" Random(0 20))
            Format(@inp7 "%d" Random(0 20))
            Format(@inp8 "%d" Random(0 20))
            Format(@inp9 "%d" Random(0 20))
            Format(@inp10 "%d" Random(0 20))
                   
            PrintMultiEdit("Input character attributes:\nStrength:\nConstitution:\nWisdom:\nDexterity:\nIntelligence:\nCharisma:\nSocial Standing:\nMagic Resistance:\nLuck:\nHealth:"
       #edit @inp1 3 50 12
       #edit @inp2 3 73
       #edit @inp3 3 48
       #edit @inp4 3 54
       #edit @inp5 3 67
       #edit @inp6 3 56
       #edit @inp7 3 87
       #edit @inp8 3 94
       #edit @inp9 3 31
       #edit @inp10 3 40
       #button "  OK  " 0
)

           StrCpy(@attributes "Character attributes are:")
           StrCat(@attributes " \nStrength:")
           StrCat(@attributes @inp1)
           StrCat(@attributes " \nConstitution:")
           StrCat(@attributes @inp2)
           StrCat(@attributes " \nWisdom:")
           StrCat(@attributes @inp3)
           StrCat(@attributes " \nDexterity:")
           StrCat(@attributes @inp4)
           StrCat(@attributes " \nIntelligence:")
           StrCat(@attributes @inp5)
           StrCat(@attributes " \nCharisma:")
           StrCat(@attributes @inp6)
           StrCat(@attributes " \nSocial Standing:")
           StrCat(@attributes @inp7)        
           StrCat(@attributes " \nMagic Resistance:")
           StrCat(@attributes @inp8)    
           StrCat(@attributes " \nLuck:")
           StrCat(@attributes @inp9)    
           StrCat(@attributes " \nHeath:")
           StrCat(@attributes @inp10)        

   
   Print(@attributes)
          )
)

And the final output:


One gotcha that I ran into is sometimes the formatting/spacing of a Print() call gets messed up.  One scenario is when the header text (e.g 'Input character attributes') is shorter than the edit control label + edit control.  If you run into an issue where the edit boxes are shifted up in the dialog, add leading/trailing whitespace to the text string in the Print() call to compensate.

One last thing.  The current implementation only supports up to 10 edit controls on a single print.  There really isn't more room on the screen for that, unless additional changes are made to support two columns or possibly three columns of edit controls.

11
SCI Development Tools / Scene Builder
« on: October 22, 2016, 11:35:16 AM »
Here's a project I've been working on and off for the past 3 years or so.  My original intent was build a 'view library'; a collection of views to be utilized in game development.  Now it has morphed into a dynamic scene builder, where every new room the ego visits is built on the fly with views.  I created all the views from PIC resources from the KQ1 remake and I intend to continue to build up the collection from other SCI games.

From a tool perspective, it's still in it's infancy.  Right now all it does is select 15 random views and drops them into the room with some positional help (e.g. a view that was originally clipped on the left side of the room will still be placed on the left side of the room).   I need to create menu options that will allow the developer to select characteristics of what a room should consist of (outside 'sunny', outside 'swamp', inside 'cave', inside 'building', etc), background options and/or color schemes.  After a room is created, the developer will be able save off a room script generated from the rendered scene so it is reproducible in their own game.  Being able to drag a view around the screen for re-placement would be a nice feature as well.

I've attached a few screenshots of some of the better results - the hit ratio of 'good' rooms to 'bad' rooms is about 1 to 5 right now, mostly because of conflicting view types (a bed placed in a forest or stalactites placed in a meadow for example).

12
Everything-Else / Hiatus
« on: October 20, 2014, 07:56:22 PM »
In addition to my recent appendicitis surgery, as of this past Saturday our family is moving.  Been putting stuff in storage, cleaning, etc. for the past 2 months.  Listed our current house on Friday & we got an offer on Saturday, turned around and lined up a new house & got it under contract on the same day.

I already have not been around much lately and I suspect my activity here won't increase until near the end of the year :(

13
SCI Syntax Help / Problems with 'break' command
« on: September 07, 2014, 11:31:02 AM »
Found another issue, this time effecting both Studio and Companion.  Apparently, neither will allow the use of a break statement in a do/while loop at compile time.  Note that in just a normal while loop, the break command works just fine:

Code: [Select]
   // this works
   (while(== 1 1)
       Print("While loop")
       break
   )

   // this does not
   (do
       Print("Do/While loop")
       break
   )while(== 1 1)
 

14
SCI Syntax Help / Big arrays in Companion
« on: September 04, 2014, 06:12:10 PM »
I ran into this today.  For some reason, the template game is dumping on me when I try to use an array that I've defined with an index over (about) 2000.

Here's my code
Code: [Select]
(local
   roomMap[2460]
)

-- then in the init of my room:
(for (= i 0) (< i 2460) (++i)
     = roomMap[i] 1
)


If I change my loop to only iterate say 2000 times, it's fine.  I tested this out in Studio and it seemed to work fine (no crashing) so it seems to only be impacting Companion.

EDIT:  I can change the loop to go up to 2024 before the game starts corrupting.  Starting at 2025, the top menu gets corrupted.

15
The Games and other Sierra Adventure stuff / View library
« on: August 08, 2014, 07:56:03 PM »
Cloudee's new port of Voodoo Girl to SCI game reminded me of this.  I've been thinking how nice it would be to have a massive library of views (non-animated) that could be used to shortcut some of the process of drawing pics without having to draw everything from scratch.  And now that I think about it, it wouldn't be all that hard.  We could cut/paste parts of existing pics from games and start from there.

Heap wouldn't be an issue because we can use the 'dropped view' approach when implementing the views onto a pic.

Any thoughts?

Pages: [1] 2 3 ... 8

SMF 2.0.11 | SMF © 2015, Simple Machines
Simple Audio Video Embedder

Page created in 0.176 seconds with 17 queries.