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 - snobes

Pages: [1]
1
SCI Syntax Help / Priority of overlapping views
« on: September 15, 2023, 12:23:41 PM »
Hello.

I have a use case where an Actor (a hen) walks in front of a static Actor (an ogre). I want the hen Actor to always take priority when it walks in front of the ogre Actor. My issue is that when the hen enters the "boundary box" of the ogre (meaning the hen does not appear to be in front of the ogre but from a View perspective, the hen has entered the box around the whole ogre view), the hen is no longer clickable ("V_DO-able").

What is the correct way to keep a view on top of another view even within the boundary box.

I have a script that tries to do this, but, like I said, the hen is not clickable when it walks in front of the boundary box of the ogre. Here is my script:


   (method (changeState newState &tmp nextHenX nextHenY)
      (= state newState)
      (= nextHenX (Random 75 75))
      (= nextHenY (Random 140 140))
      (switch state
         (0
            (if (== gKeyholePic CABIN_KEYHOLE_PIC_SLEEP) (self cue:))
         )
         (1
            (ogre init: setCycle: Forward setSpeed: 60) ; init the ogre
                 (self cue:)
         )
         (2
            (if (not (gEgo has: INV_HEN))
               (hen posn: 87 159 init: ignoreActors: FALSE setSpeed: 3 setCycle: StopWalk -1) ; init the hen
               (self cue:)
            )
         )
         (3
            (hen setMotion: PolyPath nextHenX nextHenY self) ; move the hen (could possibly get moved in front of the ogre)
         )
         (4
            (= seconds 1)
         )
         (5
            (self changeState: 3)
         )
      )
   )


; the hen Actor
; this should take priority over the ogre
(instance hen of Actor
   (properties
      view HEN_VIEW
      signal ignAct
      loop 0
      cel 0
      noun N_HEN
   )
   
   (method (doVerb theVerb)
       (switch theVerb
           (V_DO
            (if (<= (self distanceTo: gEgo) 15)
               (rm1701 setScript: getHen)
            else
               (gMessager say: N_ROOM 0 C_NOT_CLOSE_HEN 0)
            )
           )
           (else
               (super doVerb: theVerb &rest)
           )
       )
   )
)

; the ogre
(instance ogre of Actor
   (properties
      view OGRE_SLEEPING_VIEW
      x 242
      y 170
      signal ignAct
      noun N_OGRE
   )
)


I don't know what I'm doing wrong to cause the hen to no longer be clickable when in the ogre's boundary box. Any suggestions would be helpful.

Thanks.

2
SCI Syntax Help / Wander within polygons
« on: September 15, 2023, 12:12:41 PM »
Hello

I'm tying to get an Actor (a hen) to randomly walk around within a bounded region.

I have a script that does this by using Random and PolyPaths, but I wonder if there is a simpler way to do this. In English, the script picks a new x,y coordinate, sends the Actor to that coordinate using PolyPath, then repeats.


   (method (changeState newState &tmp nextHenX nextHenY)
      (= state newState)
      (= nextHenX (Random 75 75))
      (= nextHenY (Random 140 140))
      (switch state
         (0
            (if (== gKeyholePic CABIN_KEYHOLE_PIC_SLEEP) (self cue:))
         )
         (1
            (ogre init: setCycle: Forward setSpeed: 60)
            (self cue:)
         )
         (2
            (if (not (gEgo has: INV_HEN))
               (hen posn: 87 159 init: ignoreActors: FALSE setSpeed: 3 setCycle: StopWalk -1)
               (self cue:)
            )
         )
         (3
            (hen setMotion: PolyPath nextHenX nextHenY self)
         )
         (4
            (= seconds 1)
         )
         (5
            (self changeState: 3)
         )
      )
   )


I'm aware of the Wander class, but this class ignores polygons (I'm using SCI 1.1). Is there a similar class where I can pass in a polygon and only that Actor is affected by the polygon and thus will wander within the specific polygon? Or is what I've implemented the way to "wander" within a bounded region?

Thanks.

3
SCI Syntax Help / PAvoider not working
« on: September 15, 2023, 12:04:17 PM »
Hello.

So I'm trying to use PAvoider since my use case is to have an Actor (a hen) avoid another Actor (the gEgo) (ie. gEgo walks to the hen and the hen walks away and tires to avoid the gEgo). However, I think PAvoider is not meant for this. From the code, the description of PAvoider is:

;   
;    In contrast to the Avoider in SCI0 that makes an Actor avoid certain control colors, this
;    avoider has been adjusted to use polygons for SCI1.1.
;   
;    Example usage::
;   
;       (gEgo setAvoider: PAvoider)


From the description, it sounds like PAvoider is meant to avoid certain polygons, not other Actors. However, I still do not understand which polygons the Actor would avoid if given a PAvoider. I've tried (gEgo setAvoider: PAvoider) in the init of the Room object, but nothing happens. Am I missing something on how to use PAvoider?

As a side note, since most likely PAvoider is not suitable for my use case, is there a class that makes one Actor avoid another Actor?

Thanks.


4
SCI Syntax Help / Ego Moonwalk
« on: September 15, 2023, 11:06:08 AM »
Hello.

I have a bug in my code where after a short automatic sequence, the game is restored back to the player and the gEgo is once again controllable. However, the issue is that when I give control back to the player, the first movement of the gEgo moonwalks if certain conditions are met (by "conditions" I mean the gEgo is facing east and the player clicks west or vice versa).

The sequence is a series of change states to pick up a hen.
Here is what I'm trying to achieve with my code in English (there are two actors: 1) gEgo and 2) hen):
- Remove control from player
- Halt the hen's movement
- Swap out the view of gEgo with a different view where the gEgo bends down and then stands up (ie. pick something up)
- Set the cel of gEgo to 0 so the "pick up" loop will animate from the beginning
- Set the speed of the gEgo to slow down the "pick up" animation
- Based on if gEgo is to the right or left of the hen, set the "pick up" loop of the gEgo correctly (ie. facing west or east, respectively)
- Set the cycle of the gEgo to "bend down"
- Animate the "bend down" cycle
- Dispose the hen
- Put the hen in the gEgo's inventory
- Set the cel of gEgo to 0 so the "stand up" loop with animation from the beginning
- Set the loop of the gEgo to be the "stand up" loop of the "pick up" view
- Set the cycle of the gEgo to "stand up"
- Animate the "stand up" cycle
- Give control back to the player
- Set the view of gEgo to be the normal movement view (ie. up, down, right, left, diagonals, idle)
- Set the speed of the gEgo to what is was before the "pick up" sequence
- Set the cycle of the gEgo to be StopWalk so the gEgo will cycle correctly after the "pick up" sequence
- Give control back to the player
- Set the script back to the general RoomScript

I think my bug is how I'm setting the cycle of the gEgo once the "pick up" animation is complete. Since I set it to StopWalk -1, I it will also set the direction. But since the gEgo is not moving it picks the wrong idle cel. Then when I move the gEgo, the direction is wrong because I did not change the gEgo's cycle and direction correctly.

I would also take other suggestions to make the code cleaner. I'm learning the syntax and the many methods and procedures available. Callout if you see a better way to write what I've described.


(instance getHen of Script
   (properties)
   
   (method (changeState newState &tmp newSpeed)
      (= state newState)
      (switchto state
         (
            (gGame handsOff:)
            (hen setMotion: NULL)
            (self cue:)
         )
         (
            (= newSpeed gGEgoMoveSpeed)
            (gEgo view: ROSELLA_PEASANT_PICKUP_VIEW setCel: 0 setSpeed: (+ newSpeed 2))
            (if (<= (gEgo x?) (hen x?))
               (gEgo setLoop: 0)
            else
               (gEgo setLoop: 2)
            )
            (self cue:)
         )
         (
            (gEgo setCycle: EndLoop self)
         )
         (
            (hen dispose:)
            (gEgo get: INV_HEN setCel: 0 setLoop: (+ (gEgo loop?) 1))
            (self cue:)
         )
         (
            (gEgo setCycle: EndLoop self)
         )
         (
            (DebugPrint {gGEgoMoveSpeed: %d} gGEgoMoveSpeed)
            (gEgo view: ROSELLA_PEASANT_VIEW setSpeed: gGEgoMoveSpeed)
            (self cue:)
         )
         (
            (gEgo setCycle: StopWalk -1)
            (self cue:)
         )
         (
            (gGame handsOn:)
            (rm1701 setScript: RoomScript)
         )
      )
   )
)


Thanks

(I just thought of something.... Perhaps I can have another Actor in the script called "gEgoPickup". This Actor would have the "pick up" view. When the "pick up" sequence begins, I would hide the gEgo, show the gEgoPickup using the x,y of gEgo, animate the "pick up" cycle, hide the gEgoPickup, and then show the gEgo. I'll test this out to see if it works, but I'd think this less ideal than simply acting on the gEgo)

5
SCI Syntax Help / "Generate Lip-sync Data" action button not working
« on: February 06, 2023, 05:34:40 PM »
Hello, everyone!

First time poster, long time Sierra player/fan.

I'm new to SCI programming as of a month (it's been an awesome month so far). I'm experimenting with Talkers and lip syncing and am running into a wall. I'd appreciate anyone's help/suggestions.

I'm trying to generate automatic lip sync data. I've created "lip sprites", created a "phenome_to_cell" file, imported my audio file, and supplied the text. That part I am missing is the "tick to cel" file, which I think should be automatically generated after clicking the "Generate Lip-sync Data" button in the "Advanced" popout window. My issue is that after clicking the "Generate Lip-sync Data" button, nothing happens. No file is generated, and in fact it removes any pre-loaded file with a black "tick to cel" list.

Can someone help me with this issue? I'm basing my knowledge on the SCICompanion website: http://scicompanion.com/Documentation/lipsync.html. I think this is the same application as SCIProgramming (I could be wrong).

Please let me know if I can provide any more information.
Thanks

Version: SCICompanion 3.0.1.7

Pages: [1]

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

Page created in 0.052 seconds with 19 queries.