Basic Tutorial for SCI1.1 - Actors: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
m Andrew Branscom moved page Actors to Basic Tutorial for SCI1.1 - Actors
Andrew Branscom (talk | contribs)
No edit summary
Line 4: Line 4:
<div align="center">
<div align="center">
Chapter:  
Chapter:  
[[Customizing the Title Screen|1]] |  
[[Basic Tutorial for SCI1.1 - Customizing the Title Screen|1]] |  
[[The First Room|2]] |  
[[Basic Tutorial for SCI1.1 - The First Room|2]] |  
[[Interacting with Objects|3]] |  
[[Basic Tutorial for SCI1.1 - Interacting with Objects|3]] |  
[[Adding a Background and Static Objects|4]] |
[[Basic Tutorial for SCI1.1 - The Priority Screen|4]] |  
[[The Priority Screen|5]] |  
[[Basic Tutorial for SCI1.1 - Animating Props|5]] |  
[[Animating Props|6]] |  
[[Basic Tutorial for SCI1.1 - Managing the Player’s Inventory|6]] |  
[[Managing the Player’s Inventory|7]] |  
[[Basic Tutorial for SCI1.1 - Actors|7]] |  
[[Actors|8]] |  
[[Basic Tutorial for SCI1.1 - Dying|8]] |  
[[Dying|9]] |  
[[Basic Tutorial for SCI1.1 - Using Inventory Items|9]] |  
[[Using Inventory Items|10]] |  
[[Basic Tutorial for SCI1.1 - Scoring and Flags|10]] |  
[[Scoring and Flags|11]] |  
[[Basic Tutorial for SCI1.1 - Adding a Second Room|11]]
[[Adding a Second Room|12]]
</div><br />
</div><br />



Revision as of 12:50, 28 April 2025

SCI Tutorials and Guides

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11


Actors
Author: Phil Fortier


IMPORTANT:: SCI1.1 only


Let's add another character! Open the template ego character, and **Save As** a new view resource (say view number 1).

Then use the shift color functionality to change the colors so he looks different. This evil ego will wear grey clothing and have purple skin.

Go into your room script file and add a new :class:`Actor` at the bottom:

SCI Code:
    (instance evilEgo of Actor
        (properties
            view 1
            x 231
            y 131
            signal ignAct
            noun N_EVILEGO
        )
    )

Also add the N_EVILEGO to the message resource (you should be good at this now).

Now go up to the room's init() method and initialize the evil ego:

SCI Code:
    (evilEgo
        init:
        setCycle: StopWalk -1
    )

StopWalk is the standard Walk cycler that will switch to a special loop or different view when it is stopped. We don't have a different view, but the ego view we used has a special 9th loop that is used for the stop pose. In this case, -1 says to use the final loop of the view as the stop pose.

Compile and run the game (you may need to (use "StopWalk")), and you should see the evil ego standing menacingly on the other side of the room.

Maybe give him some messages so you can look at him or talk to him:

Now let's make him wander around:

SCI Code:
   (evilEgo
        init:
        setCycle: StopWalk -1
        setMotion: Wander
   )

You'll need to (use "Wander"). Compile and run, and you'll see him wander around. setMotion sets a :class:`Motion` class on an :class:`Actor`. This is used to control how the Actor moves.

You might notice that he'll walk right through walls. The :class:`Wander` Motion doesn't obey the room obstacles, so it's not very useful for us here.

The Motion classes that obey obstacles generally start with the letter P. So maybe we can use PFollow instead:

SCI Code:
    (evilEgo
        init:
        setCycle: StopWalk -1
        ; Follow the ego to a distance of 20
        setMotion: PFollow gEgo 20
    )

Compile and run the game, and now he'll be following the ego around!! That's a bit scary, so let's slow him down:

SCI Code:
    (instance evilEgo of Actor
        (properties
            view 1
            x 231
            y 131
            signal ignAct
            noun N_EVILEGO
            moveSpeed 30
            cycleSpeed 30
        )
    )

Now we at least have a chance to escape.


References



Also See

 

< Previous: Managing the Player’s Inventory Next: Dying >