Advanced SCI Tutorials - The z-coordinate: Difference between revisions

From Sierra Wiki
Jump to navigationJump to search
Andrew Branscom (talk | contribs)
m 1 revision imported
Andrew Branscom (talk | contribs)
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Chapter 6 - z-coordinate=
[[Category:SCI Pages]]
[[Category:SCI Pages to be Edited]]
[[SCI Tutorials and Guides|SCI Tutorials and Guides Table of Contents]]
 
<div align="center"><span style="font-size: 22pt">Chapter 5 - z-coordinate</span><br />''By [[]]''</div>
 
<br />
==<br /> Introduction ==


All the classes that extend from '''Feature''' ('''PV''', '''View''', '''Prop''', '''Act''', '''Ego''') have a z coordinate. This can be used to 'elevate' the object above or below the ground. The same ''could'' be accomplished with the y coordinate, but change this will affect the motion classes applied to the actor, and it will also change the priority of the actor.
All the classes that extend from '''Feature''' ('''PV''', '''View''', '''Prop''', '''Act''', '''Ego''') have a z coordinate. This can be used to 'elevate' the object above or below the ground. The same ''could'' be accomplished with the y coordinate, but change this will affect the motion classes applied to the actor, and it will also change the priority of the actor.
Line 22: Line 29:
Incidentally, changing the z-coordinate has the same effect as changing the Y coordinate of a view's 'placement' (these are the X and Y coordinates of the view in SCI Studio's view editor). However, the placement of a view is fixed, while the z-coordinate can be changed in code.
Incidentally, changing the z-coordinate has the same effect as changing the Y coordinate of a view's 'placement' (these are the X and Y coordinates of the view in SCI Studio's view editor). However, the placement of a view is fixed, while the z-coordinate can be changed in code.


&nbsp;
==<br /> References ==
 
<references />


<span style="float: left">[[Jumping Bug|&lt; Previous: Chapter 5 - Jumping Bug]]</span>
==<br /> Related Links ==
<span style="float: right">[[Memory Management|Next: Chapter 7 - Memory Management (advanced) &gt;]]</span>


* &nbsp;
&nbsp;
&nbsp;
 
<span style="float: left">[[Advanced SCI Tutorials - Jumping Bug|&lt; Previous: Chapter 4 - Jumping Bug]]</span>
<span style="float: right">[[Advanced SCI Tutorials - SCI Memory Management|Next: Chapter 6 - SCI Memory Management (advanced) &gt;]]</span>
&nbsp;
[[Category:Technical Info]]
[[Category:z-coordinate]]
[[Category:z-coordinate]]
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:SCI Tutorials]]

Latest revision as of 14:33, 29 April 2025

SCI Tutorials and Guides Table of Contents

Chapter 5 - z-coordinate
By [[]]



Introduction

All the classes that extend from Feature (PV, View, Prop, Act, Ego) have a z coordinate. This can be used to 'elevate' the object above or below the ground. The same could be accomplished with the y coordinate, but change this will affect the motion classes applied to the actor, and it will also change the priority of the actor.

Walking on elevated ground.

Suppose we have a section of elevated ground on which the ego can walk. We could draw a particular control color over this elevated ground in the pic.

Supposing ctlGREEN was the control color:

Code:
   (method (doit)
       (super:doit())
       
       (if (& (send gEgo:onControl()) ctlGREEN)
           (send gEgo:z(3)) // Ego is elevated by 3 pixels.
       )(else
           (send gEgo:z(0)) // Ego is back to normal
       )
   )

Incidentally, changing the z-coordinate has the same effect as changing the Y coordinate of a view's 'placement' (these are the X and Y coordinates of the view in SCI Studio's view editor). However, the placement of a view is fixed, while the z-coordinate can be changed in code.


References



Related Links

  •  

  < Previous: Chapter 4 - Jumping Bug Next: Chapter 6 - SCI Memory Management (advanced) >