Script Classes for Adventure Games/User Class: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
m 2 revisions imported
Andrew Branscom (talk | contribs)
No edit summary
 
Line 1: Line 1:
[[Category:SCI Pages]]
[[Official SCI Documentation]]<br />
[[Official SCI Documentation]]<br />
[[Script Classes for Adventure Games | Table of Contents]]
[[Script Classes for Adventure Games | Table of Contents]]
<div align="center">
<div align="center">
Chapter:  
Chapter:  
Line 32: Line 32:
[[Script Classes for Adventure Games/Global Variables|27]] |  
[[Script Classes for Adventure Games/Global Variables|27]] |  
[[Script Classes for Adventure Games/Index|Index]]
[[Script Classes for Adventure Games/Index|Index]]
</div><br />
</div>
 
<div align="center"><span style="font-size: 22pt">The User Class</span><br />''Author: [[Jeff Stephenson]]''<br />''1988-04-05''</div></div>
<div align="center"><span style="font-size: 22pt">The User Class</span><br />
''Author: [[Jeff Stephenson]]''<br />
''Date: 5 April 1988''</div>
 
&nbsp;


<br />
==<br /> The User Class ==
==<br /> The User Class ==


Line 76: Line 72:
==<br /> References ==
==<br /> References ==


<references />
<references /><!-- Do not edit this section. It is autopopulated by <ref></ref> tags -->


==<br /> See Also: ==
==<br /> Also See ==


* [[:Category:SCI Documentation|SCI Documentation]]
* [[:Category:Official SCI Documentation|Official SCI Documentation]]
* [[:Category:SCI Scripting|SCI Scripting]]
* [[:Category:SCI Classes|SCI Classes]]
* [[:Category:Animation|Animation Articles]]
* [[:Category:SCI Animation|SCI Animation Articles]]
* [[:Category:SCI User Class | The SCI User Class]]
* [[SCI Specifications]]
* [[SCI Specifications]]
&nbsp;
&nbsp;


[[Official SCI Documentation]]<br />
[[Script Classes for Adventure Games | Table of Contents]]
[[Script Classes for Adventure Games | Table of Contents]]


<span style="float: left">[[Script Classes for Adventure Games/Event Class|&lt; Previous: The Event Class]]</span>
<span style="float: left">[[Script Classes for Adventure Games/Event Class|&lt; Previous: The Event Class]]</span>
<span style="float: right">[[Script Classes for Adventure Games/Game Class|Next: The Game Class &gt;]]</span>
<span style="float: right">[[Script Classes for Adventure Games/Game Class|Next: The Game Class &gt;]]</span>
&nbsp;
&nbsp;
[[Category:References]]
[[Category:References]]
[[Category:SCI References]]
[[Category:SCI References]]
[[Category:Historical Pages]]
[[Category:SCI Historical Pages]]
[[Category:Development]]
[[Category:SCI Development]]
[[Category:Documentation]]
[[Category:Documentation]]
[[Category:SCI Documentation]]
[[Category:SCI Documentation]]
[[Category:Official Documentation]]
[[Category:Official SCI Documentation]]
[[Category:Scripting]]
[[Category:Scripting]]
[[Category:SCI Scripting]]
[[Category:SCI Scripting]]
[[Category:Classes]]
[[Category:Classes]]
[[Category:SCI Classes]]
[[Category:SCI Classes]]
[[Category:Animation]]
[[Category:SCI User Class]]
[[Category:SCI User Class alterEgo Property]]
[[Category:SCI User Class canInput Property]]
[[Category:SCI User Class canControl Property]]
[[Category:SCI User Class doit Method]]

Latest revision as of 19:29, 17 January 2026

Official SCI Documentation
Table of Contents

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Index

The User Class
Author: Jeff Stephenson
1988-04-05



The User Class

A User is an object which corresponds to the person playing the game and acts as the intermediary between the person and the other objects in the game. In the current games there is only one User, and thus we use the class User rather than an instance of the class.

In file: user.sc
Inherits from: Object
Inherited by: none


Properties

alterEgo

The ID of the Ego which is controlled by the User.

canInput

TRUE if the User should accept input lines from its player, FALSE otherwise. Any time you don't want the player to be able to type an input line, just set canInput to FALSE. Default at startup is FALSE.

canControl

Set to TRUE to let the User control the alterEgo with direction keys, mouse, etc. Anytime you want to set the alterEgo on a pre- programmed motion, set canControl to FALSE to prevent the player from interrupting the motion and taking control. Default at startup is FALSE.


Methods

doit:

The doit: method for User checks for an event. If one is present, User sends the handleEvent: event message in succession to TheMenuBar (the game's menu bar), alterEgo, and regions (the list of regions, beginning with the current room). If any of these objects respond to the event, they should set the claimed property of the event to TRUE to let the other objects receiving the event know that it has been dealt with. If, after everyone has had a look at it, the event is still unclaimed, User puts up an input line and waits for the player to type a line of input. If a line is entered and the kernel is able to parse the line, the User turns the event into a saidEvent, indicating that valid input has been entered, and again sends the handleEvent: event message to the above objects. Once it has done so, it disposes of the event and returns.


References



Also See

 

Official SCI Documentation
Table of Contents

< Previous: The Event Class Next: The Game Class >