changeState-yeah, its pissing me off

Fronzel Hi, I'm working on a game in SCI and am trying to use states and that sort of thing.
Is there a changeState tutorial? or about as good, is there a game that uses changeState that has its scripts available to look at?
I have gotten most things, but changeState throws me (I can do my first state, and then it won't get to state two)
Fronzel Oops, as I posted this the other thread got bumped up here, I'd still like to know about the games though.
Brian_Provinciano http://bripro.com/scistudio/tutorial/chapter15.html

I suggest you read the entire tutorial from start to finish, and you'll have no trouble making your game. If you have trouble, just go back to the part when you've finished reading the rest of the chapters.

Here's another thing I wrote about states. I should clearly explain them fully:

The changeState method is executed. So, for example, if you call changeState(0), it will execute state #0 because of this:

(switch(= state newState)
(case 0
= cycles 10
)
(case 1
= seconds 20
)
(case 2
// do nothing
)
(case 3
= cycles 10
)

Cycle #0 will be executed, then 10 cycles later, cycle #1 will be executed, then 20 seconds later, cycle #2 will be executed. Since cycle #2 doesn't set the seconds or cycle property, the changeState loop will stop. cycle #3 will not be executed.

Now take for instance this:
(switch(= state newState)
(case 0
= cycles 10
)
(case 1
= seconds 20
)
(case 3
= cycles 10
)

It is EXACTLY the same thing. It executes cycle#0, then cycle#1, there's no cycle#2, so when it executes cycle#2, there's nothing to set the seconds or cycles properties, and thus, the changeState loop will halt execution.

Separating case#16 and #20 has no advantage to using case #16 and case #17, provided that case #16 doesn't set the cycles or seconds property, it will not continue to #17. Also, it's possible to execute the changeState from the middle of a normal case array.